This document contains step-by-step details for how to release Habitat. All components are released from the master branch on a bi-weekly schedule occurring every other Thursday.
-
Create a
code
directory$ mkdir -p ~/code
-
Clone the Habitat repository into a subdirectory of your code directory
$ git clone [email protected]:habitat-sh/habitat.git ~/code/habitat
-
Clone the core-plans repository into a subdirectory of your code directory
$ git clone [email protected]:habitat-sh/core-plans.git ~/code/core-plans
-
Install AWS CLI
$ brew install awscli
-
Setup an AWS profile in
~/.aws/credentials
namedhabitat
with youraws_access_key_id
andaws_secret_access_key
$ cat ~/.aws/credentials # ~~~~~~~~~~~~~~~~~~~ # Your other profiles # ~~~~~~~~~~~~~~~~~~~ [habitat] aws_access_key_id=$(KEY_ID) aws_secret_access_key=$(SECRET_KEY) region=us-west-2
-
Download OSX 10.9 Vagrant Box
$ aws s3 cp --profile habitat s3://habitat-initial-hab/macosx-10.9-2.1.20160526021718.git.6fdd2e497a8fc2999c4195bab9f3f5127dd70d6a.vmware.box .
-
Install Vagrant
-
Install VMWare Fusion
-
Install OSX 10.9 Vagrant Box
$ vagrant box add bento/macosx-10.9 macosx-10.9-2.1.20160526021718.git.6fdd2e497a8fc2999c4195bab9f3f5127dd70d6a.vmware.box
-
Ensure you are on the master branch and have the latest of
~/code/habitat
and~/code/core-plans
$ cd ~/code/habitat $ git checkout master $ git pull origin master $ cd ~/code/core-plans $ git checkout master $ git pull origin master
-
Create a new release branch in the Habitat repo
$ cd ~/code/habitat $ git checkout -b <branch>
-
Remove the
-dev
suffix from the version number found in theVERSION
file$ vi ~/code/habitat/VERSION
-
Generate a new
CHANGELOG.md
$ export GITHUB_TOKEN=<your-token> $ make changelog
-
Commit the
CHANGELOG.md
andVERSION
changes and push your branch -
Issue a new PR await approval (in the form of a dank gif) from two maintainers
-
Pull master once again once the PR is merged into master
-
Create & push a Git tag
$ make tag-release $ git push origin --tags
-
Fetch the tags from the upstream Habitat repository and checkout the release tag
$ cd ~/code/habitat $ git fetch origin --tags $ git checkout <version>
-
Change to your code directory and enter a studio
$ cd ~/code $ hab studio enter
-
Build each of the following components with the instructions below
- hab -
habitat/components/hab
- hab-sup -
habitat/components/sup
- hab-sup-static -
habitat/components/sup/static
- hab-director -
habitat/components/director
- Create release in GitHub
- Publish each Linux component to the Depot (
hab pkg upload results/*-x86_64-linux.hart
) - Release to Bintray
- Drink beer
- Update the version number found in the
VERSION
file to the next target release and append the-dev
suffix to that number - Issue a PR and merge it yourself
Example: If the release version was
0.9.0
then the contents ofVERSION
might read0.10.0-dev
if your next target is0.10.0
.
- Create a new post in Habitat Announcements
- Message Slack channels and include the link to the release post
- cft-announce (Chef Slack)
- eng-announce (Chef Slack)
- habitat (Chef Slack)
- general (Habitat Slack)
- announcements (Habitat Slack)
Before we begin a build of a plan we first need to determine which other plans from the Habitat and core-plans repository depend on it and re-build each of those packages after we build our target component.
note: Dependency re-build will later be handled automatically by the Builder service
-
From outside of a studio, change into your code directory and run the build-dependent-order tool with the component's package identifier as the first argument. This will output a list of dependent packages. In the following example we will assume we are rebuilding
core/hab
$ cd ~/code $ rm build.manifest $ find core-plans habitat -name plan.sh | ./core-plans/bin/build-dependent-order.rb core/hab > build.manifest
-
From within a studio, run the build command first for the package we specified to build-dependent-order (in this case
core/hab
)$ cd ~/code $ hab studio enter > build habitat/components/hab
-
Now run the build command for each package path output by build-dependent-order
$ cat build.manifest | while read entry; do echo "Building $(echo $entry | cut -d ' ' -f 1)"; build $(echo $entry | cut -d ' ' -f 2) || break; done
-
Ensure no pre-existing old virtual machine, then turn on and enter the system
$ cd ~/code/habitat/components/hab/mac $ vagrant destroy $ vagrant up $ vagrant ssh
-
Have the secret core origin key ready for pasting into the terminal. The
mac-build.sh
script will interactively prompt for pasting the key contents if no core origin key is installed on the VM. -
Build Hab for Mac
$ cd /src/components/hab/mac $ sudo ./mac-build.sh
-
On your workstation, change your code directory and enter a studio
$ cd ~/code $ hab studio enter
-
Install the Bintray publishing code and export your credentials
$ hab install core/hab-bintray-publish $ export BINTRAY_USER=yourusername BINTRAY_KEY=yourkey BINTRAY_PASSPHRASE=commongpgkeypassphrase
-
Publish the new Docker Studio image
$ hab pkg exec core/hab-bintray-publish publish-studio
-
Publish the Linux and Mac artifacts by selecting the appropriate
.hart
file$ hab pkg exec core/hab-bintray-publish publish-hab \ ./results/core-hab-0.10.2-20160930230245-x86_64-linux.hart $ hab pkg exec core/hab-bintray-publish publish-hab \ ./habitat/components/hab/mac/results/core-hab-0.10.2-20160930230245-x86_64-darwin.hart
More documentation for the Bintray releasing software can be found in the component's Readme.