I’m trying to use $BITRISE_BUILD_NUMBER in a bash script, but it seems not be set in the environment.
I create a very simple workflow, with just one script step.
Contents:
echo $BITRISE_BUILD_NUMBER
It’s echo’s nothing.
When I connect to the VM using Rebuild With Remote Access feature, and run env
, I don’t see BITRISE_BUILD_NUMBER:
prd-std-x-e-xcode-10-2-190920085217-zNmZyTryWzvkRckdNb6n8g:~ vagrant$ env
ANDROID_NDK_VERSION=r16b
ANDROID_HOME=/usr/local/share/android-sdk
BITRISE_OSX_STACK_REV_ID=v2019_09_11_2
TERM=xterm-256color
SHELL=/bin/bash
TMPDIR=/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/
SSH_CLIENT=::1 49192 22
ANDROID_SDK_ROOT=/usr/local/share/android-sdk
BITRISE_DEPLOY_DIR=/Users/vagrant/deploy
BITRISE_KEYCHAIN=bitrise.keychain
BITRISE_LIBRARY_DIR=/Users/vagrant/Library/MobileDevice/Provisioning Profiles
BITRISE_SOURCE_DIR=/Users/vagrant/git
SSH_TTY=/dev/ttys000
LC_ALL=en_US.UTF-8
DOTPROFILE_LOADED=1
BITRISE_IO=true
USER=vagrant
HOMEBREW_NO_ANALYTICS=1
HOMEBREW_NO_AUTO_UPDATE=1
BITRISE_TOOLS_FOLDER_PATH=/Users/vagrant/bitrise/tools
BITRISE_SYM_ROOT=/Users/vagrant/build
MATCH_KEYCHAIN_PASSWORD=vagrant
BITRISE_STEP_DIR=/Users/vagrant/stepdir
MAIL=/var/mail/vagrant
PATH=/Users/vagrant/.jenv/shims:/Users/vagrant/.rbenv/shims:/usr/local/bin:/usr/local/sbin:~/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/opt/go/libexec/bin:/Users/vagrant/go/bin:/Users/vagrant/bitrise/tools/cmd-bridge/bin/osx:/opt/android-ndk:/usr/local/share/android-sdk/tools:/usr/local/share/android-sdk/tools/bin:/usr/local/share/android-sdk/platform-tools:/usr/local/flutter/bin:/Users/vagrant/.jenv/bin
JENV_LOADED=1
PWD=/Users/vagrant
LANG=en_US.UTF-8
BITRISE_FOLDER_PATH=/Users/vagrant/bitrise
BITRISE_STEP_FORMATTED_OUTPUT_FILE_PATH=/Users/vagrant/bitrise/stepdata/stepoutput
BITRISE_PROFILE_DIR=/Users/vagrant/profiles
BITRISE_STEP_DATA_FOLDER_PATH=/Users/vagrant/bitrise/stepdata
RBENV_SHELL=bash
BITRISE_KEYCHAIN_PASSWORD=vagrant
SHLVL=1
HOME=/Users/vagrant
LANGUAGE=en_US.UTF-8
LC_TERMINAL_VERSION=3.3.4
CI=true
DOTBASHPROFILE_LOADED=1
LOGNAME=vagrant
JENV_SHELL=bash
SSH_CONNECTION=::1 49192 ::1 22
LC_CTYPE=UTF-8
BITRISE_OBJ_ROOT=/Users/vagrant/bin
GOPATH=/Users/vagrant/go
ANDROID_NDK_HOME=/opt/android-ndk/android-ndk-r16b
LC_TERMINAL=iTerm2
DOT_BITRISE_PROFILE_LOADED=1
BITRISE_TOOLS_CMD_BRIDGE_PATH=/usr/local/bin/cmd-bridge
DOTBASHRC_LOADED=1
_=/usr/bin/env
OLDPWD=/Users/vagrant/git
prd-std-x-e-xcode-10-2-190920085217-zNmZyTryWzvkRckdNb6n8g:~ vagrant$
If I look here: https://devcenter.bitrise.io/builds/available-environment-variables/
…I would expect to see much more environment variables when I run env
.
Am I doing something wrong?