TritonDataCenter / triton-kubernetes

Kubernetes on Triton
Mozilla Public License 2.0
183 stars 44 forks source link

Automated Build and Release with Travis CI #89

Closed nimajalali closed 6 years ago

nimajalali commented 6 years ago

This has the .travis.yml and Makefile setup. I've included below a write-up of what we need to get done to set up automated builds and releases.

Setting Up Travis CI

In order for Travis CI to start building and releasing, Travis CI must be configured for the triton-kubernetes repo. To let TravisCI upload Github releases, an encrypted Github API Key must be provided in the .travis.yml file.

  1. Create a Github API Key and save the API Key locally (https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line)
  2. Install the travis cli https://github.com/travis-ci/travis.rb#installation
  3. Run travis encrypt
  4. Enter the encrypted text in the .travis.yml file at deploy.api-key.secure

The Release Process

The release process involves two steps: publishing binaries to Github releases and adding the new release to the homebrew registry.

Creating a Release

To create a release, you just need to create and push a git tag with the proper name (e.g. v0.0.1). Once the tag is set, Travis CI will begin the release process.

  1. Using the git cli, checkout the commit you would like to release
  2. Run git tag v0.0.0, where v0.0.0 is the desired version number
  3. Run git push origin v0.0.0
  4. TravisCI will begin building the binaries using the commit that was tagged.
  5. After TravisCI is done, check the Github releases page to verify that the binaries have been uploaded.

Creating a Release Manually

To build the binaries locally, you will need to install the following on your machine:

Then run make build VERSION=0.0.0 where 0.0.0 is replaced with the desired version number.

Updating the homebrew registry

The github repository at: https://github.com/Homebrew/homebrew-core serves as the homebrew registry. To submit a pull request to that repo:

  1. Fork the homebrew-core repository
  2. In the Formula folder, add a brew formula for triton-kubernetes (triton-kubernetes.rb). Requires:
  3. Submit a pull request to the homebrew-core repository. Once it is merged, you can verify that it works by running brew update and then brew install triton-kubernetes.
nimajalali commented 6 years ago

@fayazg