Skip to content

How to Bulk Promote packages

Elliott Davis edited this page Nov 2, 2017 · 11 revisions

DON'T use the 'hab bldr job promote' command if there are any packages (eg, non-core) packages that should not be promoted.

DO THIS INSTEAD:

Get your job group id:

Check out the builder output for the most recent build for your package on https://bldr.habitat.sh/#/origins/core/packages

Look for this line (the number will vary)

  hab-studio: Exported: HAB_BLDR_CHANNEL=bldr-832040326113607680

Copy the number after "bldr-" - this is your job group id

Get the list of successfully built packages by issuing an API command and filtering it into a package list - Example below:

curl https://bldr.habitat.sh/v1/depot/pkgs/schedule/<group id> -h "Authorization:Bearer:${HAB_AUTH_TOKEN}" | jq '.projects[] | select(.state == "Success") | {ident} | .ident | values' | tr -d '"' > promote_idents

Check the 'promote_idents' file to make sure it looks sane. Remove anything from it you don't want promoted - Eg - DON'T promote hab or sup if you're not sure they should be promoted

Then, go to the bulk promote tool dir (in the habitat repo - /tools/bulk_promote Make sure HAB_BLDR_URL and HAB_AUTH_TOKEN are set appropriately (For prod, HAB_BLDR_URL should be "https://bldr.habitat.sh" and HAB_AUTH_TOKEN should be set to a github token on your own github account (the one you use to sign into prod builder) - the token needs to have repo and user access.

Then run the tool:

./promote.sh <promote idents file> <channel>