
Security News
Vite+ Joins the Push to Consolidate JavaScript Tooling
Evan You announces Vite+, a commercial, Rust-powered toolchain built on the Vite ecosystem to unify JavaScript development and fund open source.
@brigadecore/brigadier
Advanced tools
Brigadier is the library for writing Brigade scripts.
It provides core Brigade objects such as Events and Jobs that developers can use to construct expressive event-handling logic for their Brigade projects.
Brigadier supports writing scripts in either JavaScript or TypeScript.
Normally, the brigadier dependency is declared at the top of a Brigade script. The library itself is pre-loaded in the Brigade Worker:
const { events, Job } = require("@brigadecore/brigadier");
To facilitate script development, you may also install brigadier to your environment with Yarn, NPM, etc.:
$ yarn add @brigadecore/brigadier
The 0.x Brigadier npm releases are compatible with Brigade v1.x and under.
The 2.x brigadier npm releases are compatible with Brigade v2.x.
Note: the following examples are using brigadier 2.x, compatible with Brigade v2.
Here is an example brigade.js
script which declares an event handler for
GitHub push events, running tests for the project it is associated with:
const { events, Job } = require("@brigadecore/brigadier");
const localPath = "/workspaces/brigade";
events.on("brigade.sh/github", "push", async event => {
let test = new Job("test", "golang:1.17", event);
test.primaryContainer.sourceMountPath = localPath;
test.primaryContainer.workingDirectory = localPath;
test.primaryContainer.command = ["make"];
test.primaryContainer.arguments = ["test"];
await test.run();
})
events.process();
Or, the same can be written in TypeScript (brigade.ts
):
import { events, Event, Job } from "@brigadecore/brigadier"
const localPath = "/workspaces/brigade"
events.on("brigade.sh/github", "push", async event => {
let test = new Job("test", "golang:1.17", event)
test.primaryContainer.sourceMountPath = localPath
test.primaryContainer.workingDirectory = localPath
test.primaryContainer.command = ["make"]
test.primaryContainer.arguments = ["test"]
await test.run()
})
events.process()
To learn more, visit the official scripting guide or explore the Brigade example projects.
The Brigade project accepts contributions via GitHub pull requests. The Contributing document outlines the process to help get your contribution accepted.
We have a slack channel! Kubernetes/#brigade Feel free to join for any support questions or feedback, we are happy to help. To report an issue or to request a feature, open an issue here.
FAQs
Brigade library for pipelines and events
The npm package @brigadecore/brigadier receives a total of 47 weekly downloads. As such, @brigadecore/brigadier popularity was classified as not popular.
We found that @brigadecore/brigadier demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Evan You announces Vite+, a commercial, Rust-powered toolchain built on the Vite ecosystem to unify JavaScript development and fund open source.
Security News
Ruby Central’s incident report on the RubyGems.org access dispute sparks backlash from former maintainers and renewed debate over project governance.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.