Skip to content

Building

These are the manual instructions to build the karrots binaries. (Eventually CircleCI will build the targets and repos in automation.)

Brew (MacOS)

Brew relies on a tap which we host at https://github.com/zero-diff/homebrew-karrots. In the Formula/karrots.rb file you will find the configs that make this tap work:

class Karrots < Formula
  desc "creates fully gitops-automated kubernetes clusters"
  homepage "https://zero-diff.github.io/karrots"
  url "https://zero-diff.github.io/karrots/releases/binaries/brew/karrots-{version}-{release}.tar.gz"
  sha256 "{sha256}"
  version "{version}"

  bottle :unneeded

  def install
    bin.install "karrots"
  end
end

To update this tap we have to first build and locate the new binary and SHA256 in the docs folder. (We host our binaries in the Github Pages of this repo in order to reduce number of repos we have to track and maintain.)

./gradlew packageHomebrew

This will build the latest binary and SHA256 and install them into docs/releases/binaries/brew. Copy the contents of docs/releases/binaries/brew/karrots.tar.gz.sha256 to https://github.com/zero-diff/homebrew-karrots/blob/master/Formula/karrots.rb

To publish the updated binaries, you need to publish the update mkdocs directory:

cd ~/git/karrots/mkdocs
mkdocs gh-deploy --clean

Instructions to setup mkdocs

Once deployed, you need to update, add, commit and push the SHA256 key in the Formula/karrots.rb file.

Debian

The Debian repo build is a three-step process: gradle, reprepro and mkdocs.

Note

The following instructions require a GPG private signing key which you need to load from our offline secure storage. Once you have this key either manually add it to the local GPG environment or provide it to the command line. We built the signing keys following this tutorial: https://www.digitalocean.com/community/tutorials/how-to-use-reprepro-for-a-secure-package-repository-on-ubuntu-14-04.

We published two corresponding public keys:

gpg --keyserver keyserver.ubuntu.com --send-key B4D285C0003B4D71 # sub-key (signing)
gpg --keyserver keyserver.ubuntu.com --send-key 1055A3B919A4EF19 # master-key

To generate the signed Debian package, execute this command:

cd ~/git/karrots
./gradlew packageLinux

This will generate the signed Debian release package. To now update the Debian repo execute the following command (using the version of the package you generated above):

cd ~/git/karrots
reprepro -b mkdocs/docs/debian-repo includedeb karrots-github mkdocs/docs/releases/inux/karrots_[VERSION]-[RELEASE] _all.deb

The previous command has updated the Debian repo in our mkdocs/docs/debian-repo source directory. To publish this updated repo, execute the following command:

cd ~/git/karrots/mkdocs
mkdocs gh-deploy --clean

You can test that the repo is visible on the web and work on a local machine, e.g. Ubuntu, by executing the following commands:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys B4D285C0003B4D71
sudo add-apt-repository "deb https://zero-diff.github.io/karrots/debian-repo/ karrots-github main"
sudo apt-get install karrots
karrots --help