Skip to content

Latest commit

 

History

History
44 lines (31 loc) · 2.21 KB

File metadata and controls

44 lines (31 loc) · 2.21 KB

ENV vars passed to build containers

List of all ENV variables

Each CI like Travis CI, GitLab, GitHub actions etc. passes the revision ID from the VCS in a different variable. Bob normalizes that into these variables listed here:

Var Example Description
FRIENDLY_REV_ID 20200219_1609_9c39d027 Commit's date + time + short rev ID. Good for human readability / Docker tags while still being autogenerated
REV_ID 9c39d0271d0bd51c7ddfb55dc3051e68b6953c33 Full hash of the commit
REV_ID_SHORT 9c39d027 REV_ID but shorter (8 hexits), still really low chance of collision
FASTBUILD true Present only if running $ bob build --fast
BUILD_* (many) true Explained in the "OS / arch ENV variables" section

OS / arch ENV variables

The BUILD_<os>_<arch> variables tell which Operating System / Architecture combos to build for.

The naming follows Go's OS & Arch codes.

If your project builds for Linux OS with AMD64 and ARM CPU architectures, these environment variables will be present:

  • BUILD_LINUX_AMD64=true
  • BUILD_LINUX_ARM=true

Your build scripts should then check for presence of these variables to decide for which combinations to cross-compile. Our buildkit for Go does automatic cross-compilation for our Go projects.

Why have knowledge of this on Bob level? When doing quick development iteration builds, you want the builds to be fast. $ bob build builds for all combos that your project targets. $ bob build --fast and $ bob dev builds only for the OS/arch that you're currently running in.

Check out the list of OS/arch codes in Bob.