Conveyor builds Docker images. Fast.
latest
, the git commit sha and the git branch.id_rsa
and id_rsa.pub
to the root of the bucket.repo
, admin:repo_hook
scopes.The server command has the following available options:
NAME:
server - Run an http server to build Docker images whenever a push event happens on GitHub
USAGE:
command server [command options] [arguments...]
OPTIONS:
--port '8080' Port to run the server on [$PORT]
--github.token GitHub API token to use when updating commit statuses on repositories. [$GITHUB_TOKEN]
--github.secret Shared secret used by GitHub to sign webhook payloads. This secret will be used to verify that the request came from GitHub. [$GITHUB_SECRET]
--dry Enable dry run mode. [$DRY]
--builder.image 'remind101/conveyor-builder' A docker image to use to perform the build. [$BUILDER_IMAGE]
--logger 'stdout://' The logger to use. Available options are `stdout://`, or `s3://bucket`. [$LOGGER]
Conveyor is designed to be faster than alternative build systems like the Docker Hub or Quay. It does this by making the following tradeoffs.
By default, conveyor will pull the last built image for the branch. This isn't always desirable, so you can disable the initial docker pull
by adding the following to the git commit description:
[docker nocache]
Conveyor supports two methods to scale out to multiple machines.
The first method to scale out Conveyor is to scale out using Docker Swarm. Using this method, Conveyor runs its builds across a cluster of Docker daemons. The advantage of using this method is that you don't need to provide a queue
flag since Conveyor can use an in memory queue.
The recommended way to scale out is to scale out using a build queue. Using this method, you run the conveyor worker
subcommand on a machine that hosts a local Docker daemon. The worker process will pull build requests off of the queue and perform the build. The conveyor server
command can then run completely separate from the worker nodes.
Conveyor currently supports the following build queues:
Conveyor can optionally expose some management tasks via Slack slash commands.
Setup
/conveyor
as the command.--slack.token
flag.Now, you can use Conveyor to automatically manage the GitHub webhook:
/conveyor setup org/repo
Conveyor also sports a restful API for triggering builds. You can use this with tooling to, say for example, trigger a build before you deploy.
See schema.md for documentation about the API.
First, bootstrap the remind101/conveyor-builder
image, SSH keys and docker config:
$ make bootstrap
Then start it up with docker-compose:
$ docker-compose up
You can test a simple dry run build of the remind101/acme-inc repo with:
$ make test-payload
If you want to test external GitHub webhooks, the easiest way to do that is using ngrok:
$ ngrok $(docker-machine ip default):8080
Then add a new push
webhook to a repo, pointed at the ngrok URL. No secret is necessary unless you set GITHUB_SECRET
in .env
.
NOTE: If you're testing on a private repo, you need to make sure that you've added the generated SSH key to your github account. The generated SSH key can be found in ./builder/docker/data/.ssh/id_rsa.pub
To run the full test suite. Note that you need to run make bootstrap
prior to running this:
$ go test ./...
To run only the unit tests (no need to run make bootstrap
):
$ go test ./... -short