mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2026-04-15 01:41:56 +00:00
1.5 KiB
1.5 KiB
Variables
Drone injects the following namespaced environment variables into every build:
DRONE=trueDRONE_REPO- repository name for the current buildDRONE_BRANCH- branch name for the current buildDRONE_COMMIT- git sha for the current buildDRONE_DIR- working directory for the current buildDRONE_BUILD_NUMBER- build number for the current buildDRONE_PULL_REQUEST- pull request number fo the current buildDRONE_JOB_NUMBER- job number for the current build
Drone also injects CI_ prefixed variables for compatibility with other systems:
CI=trueCI_NAME=droneCI_REPO- repository name of the current buildCI_BRANCH- branch name for the current buildCI_COMMIT- git sha for the current buildCI_BUILD_NUMBER- build number for the current buildCI_PULL_REQUEST- pull request number fo the current buildCI_JOB_NUMBER- job number for the current buildCI_BUILD_DIR- working directory for the current buildCI_BUILD_URL- url for the current build
Injecting
A subset of variables may be injected directly into the Yaml at runtime using the $$ notation:
$$COMMITgit sha for the current build,--shortformat$$BRANCHgit branch for the current build$$REPOrepository full name (inowner/nameformat)
This is useful when you need to dynamically configure your plugin based on the current build. For example, we can alter an artifact name to include the branch:
publish:
s3:
source: ./foo.tar.gz
target: ./foo-$$BRANCH.tar.gz