Skip to content

Latest commit

 

History

History
234 lines (169 loc) · 7.03 KB

RELEASE.md

File metadata and controls

234 lines (169 loc) · 7.03 KB

Releasing Habitat

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.

Workstation Preparation

  1. Create a code directory

    $ mkdir -p ~/code
    
  2. Clone the Habitat repository into a subdirectory of your code directory

    $ git clone [email protected]:habitat-sh/habitat.git ~/code/habitat
    
  3. Clone the core-plans repository into a subdirectory of your code directory

    $ git clone [email protected]:habitat-sh/core-plans.git ~/code/core-plans
    
  4. Install Habitat for Mac

  5. Install AWS CLI

    $ brew install awscli
    
  6. Setup an AWS profile in ~/.aws/credentials named habitat with your aws_access_key_id and aws_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
    
  7. 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 .
    
  8. Install Vagrant

  9. Install VMWare Fusion

  10. Purchase VMWare Fusion License

  11. Install Vagrant VMWare Fusion Provider & License

  12. Install OSX 10.9 Vagrant Box

    $ vagrant box add bento/macosx-10.9 macosx-10.9-2.1.20160526021718.git.6fdd2e497a8fc2999c4195bab9f3f5127dd70d6a.vmware.box
    

Prepare Master Branch for Release

  1. 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
    
  2. Create a new release branch in the Habitat repo

    $ cd ~/code/habitat
    $ git checkout -b <branch>
    
  3. Remove the -dev suffix from the version number found in the VERSION file

    $ vi ~/code/habitat/VERSION
    
  4. Generate a new CHANGELOG.md

    $ export GITHUB_TOKEN=<your-token>
    $ make changelog
    
  5. Commit the CHANGELOG.md and VERSION changes and push your branch

  6. Issue a new PR await approval (in the form of a dank gif) from two maintainers

  7. Pull master once again once the PR is merged into master

  8. Create & push a Git tag

    $ make tag-release
    $ git push origin --tags
    

Build Release

  1. Fetch the tags from the upstream Habitat repository and checkout the release tag

    $ cd ~/code/habitat
    $ git fetch origin --tags
    $ git checkout <version>
    
  2. Change to your code directory and enter a studio

    $ cd ~/code
    $ hab studio enter
    
  3. 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
  1. Build Mac Components

Publish Release

  1. Create release in GitHub
  2. Publish each Linux component to the Depot (hab pkg upload results/*-x86_64-linux.hart)
  3. Release to Bintray
  4. Drink beer

Bump Version

  1. Update the version number found in the VERSION file to the next target release and append the -dev suffix to that number
  2. Issue a PR and merge it yourself

Example: If the release version was 0.9.0 then the contents of VERSION might read 0.10.0-dev if your next target is 0.10.0.

Release Notification

  1. Create a new post in Habitat Announcements
  2. Message Slack channels and include the link to the release post
  3. cft-announce (Chef Slack)
  4. eng-announce (Chef Slack)
  5. habitat (Chef Slack)
  6. general (Habitat Slack)
  7. announcements (Habitat Slack)

How-To: Build a Linux Component

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

  1. 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
    
  2. 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
    
  3. 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
    

How-To: Build Mac Components

  1. 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
    
  2. 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.

  3. Build Hab for Mac

    $ cd /src/components/hab/mac
    $ sudo ./mac-build.sh
    

How-To: Release to Bintray

  1. On your workstation, change your code directory and enter a studio

    $ cd ~/code
    $ hab studio enter
    
  2. 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
    
  3. Publish the new Docker Studio image

    $ hab pkg exec core/hab-bintray-publish publish-studio
    
  4. 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.