Skip to main content

Variables

Container Defaults

The following environment variables are injected into every step, service, or secret container.

Build Environment Variables

KeyValueExplanation
VELA_BUILD_APPROVED_AT1556720958unix timestamp representing when build was approved
VELA_BUILD_APPROVED_BYRepoAdminuser who approved the build
VELA_BUILD_AUTHORoctocatauthor from the source commit
VELA_BUILD_AUTHOR_EMAILoctocat@github.comauthor email from the source commit, available only in push events
VELA_BUILD_BASE_REFrefs/heads/devreference from the base commit
VELA_BUILD_BRANCHmainbranch from the source commit
VELA_BUILD_CHANNELvelaqueue channel the build was published to
VELA_BUILD_CLONEhttps://github.com/octocat/hello-world.gitclone url for the repository the build was triggered from
VELA_BUILD_COMMIT7fd1a60b01f91b314f59955a4e4d4e80d8edf11dcommit sha from the source commit
VELA_BUILD_CREATED1556720958unix timestamp representing build creation time
VELA_BUILD_DISTRIBUTIONlinuxdistribution where the build was executed
VELA_BUILD_ENQUEUED1556720958unix timestamp representing build enqueued time
VELA_BUILD_EVENTpushwebhook event that triggered the build
VELA_BUILD_EVENT_ACTIONcreatedwebhook event action that triggered the build
VELA_BUILD_HOSTvela-worker-1fully qualified domain name of the worker the build was executed on
VELA_BUILD_LINKhttps://vela.example.com/octocat/hello-world/1link to the build in the UI
VELA_BUILD_MESSAGEMerge pull request #6 from octocat/patch-1message from the source commit
VELA_BUILD_NUMBER1build number
VELA_BUILD_PARENT1previous build number
VELA_BUILD_REFrefs/heads/mainreference from the source commit
VELA_BUILD_RUNTIMEdockerruntime where the build was executed
VELA_BUILD_SENDERNealColemanuser who triggered the build
VELA_BUILD_STARTED1556730001unix timestamp representing build start time
VELA_BUILD_SOURCEhttps://github.com/octocat/hello-world/commit/7fd1a60b01f91b314f59955a4e4d4e80d8edf11dfull url for the source commit the build was triggered from
VELA_BUILD_STATUSsuccessstatus of the build
VELA_BUILD_TITLEpush received from https://github.com/octocat/hello-worldtitle for the build
VELA_BUILD_WORKSPACE/vela/src/github.com/octocat/hello-worldworking directory the build is executed in

comment event only

tip

The following table includes variables only available during the comment event.

KeyValueExplanation
VELA_BUILD_PULL_REQUEST1pull request number is populated from the source reference
VELA_PULL_REQUEST1pull request number is populated from the source reference
VELA_PULL_REQUEST_SOURCEdevpull request branch from the source reference
VELA_PULL_REQUEST_TARGETmainpull request branch for the target reference

deployment event only

tip

The following table includes variables only available during the deployment event.

All custom parameters are passed to the deployment available with a DEPLOYMENT_PARAMETER_ prefix of the key.

KeyValueExplanation
VELA_BUILD_TARGETproductionname of target environment for the deployment
VELA_DEPLOYMENTproductionname of target environment for the deployment
VELA_DEPLOYMENT_NUMBER12345ID of deployment from source

pull_request event only

tip

The following table includes variables only available during the pull_request event.

KeyValueExplanation
VELA_BUILD_PULL_REQUEST1pull request number is populated from the source reference
VELA_PULL_REQUEST1pull request number is populated from the source reference
VELA_PULL_REQUEST_SOURCEdevpull request branch from the source reference
VELA_PULL_REQUEST_TARGETmainpull request branch for the target reference

tag event only

tip

The following table includes variables only available during the tag event.

KeyValueExplanation
VELA_BUILD_TAGv1.0.0tag is populated from the source reference

OpenID Connect only

tip

The following table includes variables only available when the step id_request field has a value.

KeyValueExplanation
VELA_ID_TOKEN_REQUEST_URL<VELA_SERVER_ADDR>/api/v1/repos/<ORG>/<REPO>/builds/<BUILD>/id_tokenURL to request an ID token
VELA_ID_TOKEN_REQUEST_TOKENey123abc...bearer token for requesting ID token

Vela Environment Variables

KeyValueExplanation
VELAtrueenvironment is Vela
VELA_ADDRvela.example.comfully qualified domain name of the Vela server
VELA_CHANNELvelaqueue channel the build was published to
VELA_DATABASEpostgresdatabase Vela is connected to
VELA_HOSTvela-worker-1fully qualified domain name of the worker the build was executed on
VELA_QUEUEredisqueue build was published to
VELA_RUNTIMEdockerruntime environment build was executed in
VELA_SOURCEgithubqueue channel the build was published to
VELA_VERSIONv0.1.0Vela version
VELA_WORKSPACE/vela/src/github.com/github/octocat/hello-worldworking directory the build is executed in
CItrueIndicates this is a CI environment
VELA_OUTPUTS/vela/outputs/.envfile path for dynamic environment
VELA_MASKED_OUTPUTS/vela/outputs/masked.envfile path for dynamic environment for sensitive values

Repository Environment Variables

KeyValueExplanation
VELA_REPO_ACTIVEtrueactive setting for the repository
VELA_REPO_ALLOW_COMMENTfalsecomment enabled setting for the repository
VELA_REPO_ALLOW_DEPLOYfalsedeploy enabled setting for the repository
VELA_REPO_ALLOW_PULLtruepull enabled setting for the repository
VELA_REPO_ALLOW_PUSHtruepush enabled setting for the repository
VELA_REPO_ALLOW_TAGfalsetag enabled setting for the repository
VELA_REPO_BRANCHmaindefault branch of the repository
VELA_REPO_BUILD_LIMIT10limit of concurrent builds for the repository
VELA_REPO_CLONEhttps://github.com/octocat/hello-world.gitclone url of the repository
VELA_REPO_FULL_NAMEoctocat/hello-worldfull name of the repository
VELA_REPO_LINKhttps://github.com/octocat/hello-worlddirect url of the repository
VELA_REPO_NAMEhello-worldname of the repository
VELA_REPO_ORGoctocatorg of the repository
VELA_REPO_PRIVATEfalseprivacy setting for the repository
VELA_REPO_TIMEOUT30timeout setting for the repository
VELA_REPO_TOPICScloud,securitycomma-separated list of repository topics
VELA_REPO_TRUSTEDfalsetrusted setting for the repository
VELA_REPO_VISIBILITYpublicvisibility setting for the repository

User Environment Variables

KeyValueExplanation
VELA_USER_ACTIVEtrueactive setting for the user
VELA_USER_NAMEOctocatuser handle setting for the user

Step Only Defaults

The following environment variables are only injected into every step container.

KeyValueExplanation
VELA_STEP_CREATED1556720958unix timestamp representing step creation time
VELA_STEP_DISTRIBUTIONlinuxdistribution where the step was executed
VELA_STEP_EXIT_CODE0exit code of the step when container starts
VELA_STEP_HOSTvela-worker-1fully qualified domain name of the worker the step was executed on
VELA_STEP_IMAGEtarget/vela-git:latestname of the image executed
VELA_STEP_NAMEclonename of the step
VELA_STEP_NUMBER1number of the step executed within the pipeline
VELA_STEP_REPORT_AScypress testscontext to which to publish for the commit that reflects step status
VELA_STEP_RUNTIMEdockerruntime where the step was executed
VELA_STEP_STAGEclonename of the stage the step belongs to within the pipeline
VELA_STEP_STARTED1556730001unix timestamp representing step start time
VELA_STEP_STATUSsuccessstatus of the step

Service Only Defaults

The following environment variables are only injected into every step container.

KeyValueExplanation
VELA_SERVICE_CREATED1556720958unix timestamp representing service creation time
VELA_SERVICE_DISTRIBUTIONlinuxdistribution where the service was executed
VELA_SERVICE_EXIT_CODE0exit code of the service when container starts
VELA_SERVICE_HOSTvela-worker-1fully qualified domain name of the worker the service was executed on
VELA_SERVICE_IMAGEtarget/vela-git:latestname of the image executed
VELA_SERVICE_NAMEclonename of the service
VELA_SERVICE_NUMBER1number of the service executed within the pipeline
VELA_SERVICE_RUNTIMEdockerruntime where the service was executed
VELA_SERVICE_STARTED1556730001unix timestamp representing service start time
VELA_SERVICE_STATUSsuccessstatus of the service

Using Substitution For Platform Variables

There are a few default environment variables that need to be escaped when attempting to substitute, as they are not available or not accurate at compile time.

KeyCompile TimeBuild Time Example
VELA_BUILD_STARTED01556730001
VELA_BUILD_STATUSpendingrunning
VELA_BUILD_APPROVED_AT01556730001
VELA_BUILD_APPROVED_BY''Octocat
VELA_BUILD_ENQUEUED01556730001
VELA_BUILD_RUNTIME''docker
VELA_BUILD_DISTRIBUTION''linux
VELA_BUILD_HOST''vela-worker-42