github-deploy - Track deployments on GitHub
An opinionated command-line utility that integrates deployments with the github Deployment API.
This is a wrapper command that abstracts the deployment method through a set of scripts which interfaces are clearly defined.
The wrapper command tracks the deployment statuses by interacting with the github API.
The command is being run in the checkout of the project that is about to be deployed, with the right git commit checked out.
$ ./github-deploy --help
NAME: github-deploy - A CLI that integrates deployments with github USAGE: github-deploy [global options] command [command options] [arguments...] VERSION: 0.3.0 AUTHOR: zimbatm <email@example.com> COMMANDS: please Initiates a deployment cleanup Removes old temporary deployments help, h Shows a list of commands or help for one command GLOBAL OPTIONS: --git-commit value git commit ID [$BUILDKITE_COMMIT, $CIRCLE_SHA1, $TRAVIS_PULL_REQUEST_SHA] --git-branch value git branch [$BUILDKITE_BRANCH, $CIRCLE_BRANCH, $TRAVIS_BRANCH] --git-origin value URL of the repo [$BUILDKITE_REPO, $CIRCLE_REPOSITORY_URL] --git-ref-commit use the commit as deployment reference instead of branch --github-token value Github Personal access token to interact with the Github API (default: <secret:github-token>) [$GITHUB_AUTH_TOKEN] --help, -h show help --version, -v print the version
The deploy script takes an optional deployment name an argument and returns the target URL on stdout.
Depending on the script exit status, the deployment is marked as a failure or success.
Returns the list of all the temporary deployments on stdout.
Deletes a deployment named
<TARGET>. Should not undeploy production.
To install, use
$ go get -d github.com/zimbatm/github-deploy
Create a token
Create the wrapper scripts
- Fork (https://github.com/zimbatm/github-deploy/fork)
- Create a feature branch
- Commit your changes
- Rebase your local changes against the master branch
- Run test suite with the
go test ./...command and confirm that it passes
- Create a new Pull Request