Azure / brigade
- пятница, 27 октября 2017 г. в 03:15:54
Event-based Scripting for Kubernetes.
Script simple and complex workflows using JavaScript. Chain together containers, running them in parallel or serially. Fire scripts based on times, GitHub events, Docker pushes, or any other trigger. Brigade is the tool for creating pipelines for Kubernetes.
The easiest way to get started with Brigade is to install it using Helm:
$ git clone https://github.com/Azure/brigade.git
$ cd brigade
$ helm install --name brigade ./chart/brigade
You will now have Brigade installed.
To create new projects, use the brigade-project
Helm chart. While inside the Git
repository cloned above, run these commands:
$ helm inspect values ./brigade-project > myvalues.yaml
$ # edit myvalues.yaml
$ helm install --name my-project ./brigade-project -f myvalues.yaml
When editing myvalues.yaml
, follow the instructions in that file for configuring
your new project. Once you have customized that file, you can install the project
based on your new configuration by passing it with -f myvalues.yaml
.
Now creating your first brigade.js
is as easy as this:
const { events } = require('brigadier')
events.on("exec", (brigadeEvent, project) => {
console.log("Hello world!")
})
But don't be fooled by its simplicty. Brigade can be used to create complex distributed pipelines. Check out the tutorial for more.
brig
: The Brigade clientBrigade is an event-driven system. Brigade projects live inside of your cluster.
But it's easy to load and run brigade scripts with the brig
client.
$ make bootstrap build-client
$ bin/brig --help
Assuming you have a project named my/project
, you can run a brigade.js
file like this:
$ brig run -f brigade.js my/project
This will show you the detailed output of running your project.
We suggest starting with the simple
brigade.js
script above, then heading over to the docs to learn more.
To see the names of your projects, run brig project list
.
These directions assume you are using minikube
for development. For other environments,
you must make sure you push the Docker images to the right registry or cluster
Docker daemon.
To get started:
eval $(minikube docker-env)
make bootstrap build docker-build
to build the sourcehelm install -n brigade chart/brigade
Brigade is well-tested on Minikube and Azure Container Services.
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.