Build information
The RelativeCI webpack-plugin and CLI use env-ci to read the necessary build information from the CI environment variables. When the agents run on a supported CI service, the following environment details are automatically collected:
slug
(required) the repository slugservice
the CI service namebranch
(required) the commit's corresponding branchpr
pull request numberbuild
CI build numberbuildUrl
CI build URLcommit
(required) commit SHAcommitMessage
commit message
Not supported CI services or non-CI environments
When the agent runs on a not-supported CI service or an environment that does not have access to the CI environment variables or git meta information, you need to provide the following environment variables:
RELATIVE_CI_SLUG
- required
The GitHub repository slug
Example
Repository URL:
https://github.com/relative-ci/example-webpack-plugin-github-action
Slug:
relative-ci/example-webpack-plugin-github-action
Other environment variables
Available on @relative-ci/agent@v4.2.0.
RELATIVE_CI_BRANCH
- required
The corresponding branch name. By default, the value is read from git:
RELATIVE_CI_BRANCH="$(git rev-parse --abbrev-ref HEAD)"
Docker example
from node:latest
## RelativeCI agent environment variablesARG CI=trueARG RELATIVE_CI_SERVICE="CI-SERVICE-container"ARG RELATIVE_CI_SLUGARG RELATIVE_CI_KEYARG RELATIVE_CI_BRANCHARG RELATIVE_CI_PRARG RELATIVE_CI_BUILDARG RELATIVE_CI_BUILD_URLARG RELATIVE_CI_COMMITARG RELATIVE_CI_COMMIT_MESSAGEARG DEBUG
COPY . /appWORKDIR /app
RUN npm installRUN npm run build