BUILD ENV instruction tells the layerfile to rebuild when a variable
$SUBDOMAINto ensure each branch has the proper value:
BUILD ENV SUBDOMAIN RUN echo "HOST=$SUBDOMAIN.mydomain.com" >> .env RUN docker-compose up -d
SUBDOMAIN variable is often used to set the
HOST variable for
It is a cleaned up version of the
$GIT_BRANCH variable, acceptable for use in
Common use is to set
DEPLOYMENT_HOST variable is set if a deployment exists for your run.
It’s often used to tell a webserver where it is being hosted.
If there are multiple deployments, a single one is returned.
CI variables are always
true while running a Layerfile.
DEBIAN_FRONTEND variable is always set to
noninteractive in webapp.io.
To change this behavior, use, e.g.,
GIT_TAG is the result of running
git describe --always in the repository.
GIT_COMMIT is the result of running
git rev-parse HEAD in the repository.
GIT_COMMIT is the first 12 characters of running
git rev-parse HEAD in the
GIT_COMMIT_TITLE="[improvement] do something"
GIT_CLONE_URL is a token which can be used to clone this repository.
git clone https://[email protected]/org/repo.git
EXPOSE_WEBSITE_HOST is the hostname exposed by
It’s often used to link a frontend with a backend when running both with
EXPOSE WEBSITE and
You can even reference this before
EXPOSE WEBSITE is ever used, but the URL is
only live after the run passes.
Note: Unavailable for use by BUILD ENV
WEBAPPIO is always
true when running a Layerfile
GIT_BRANCH is the branch which is checked out in this repository.
JOB_ID always exists. It’s set to the ID of the current running job.
PULL_REQUEST_URL may or may not exist. It’s a link to the pull request that
triggered this pipeline.
REPOSITORY_NAME is the name of the repository. If the repository is at
github.com/a/b, this would be “b”
REPOSITORY_OWNER is the name of the owner of this repository. If the
repository is at github.com/a/b, this would be “a”
ORGANIZATION_NAME is the name of the current organization. If the dashboard is
at webapp.io/myorg, this would be “myorg”
RUNNER_ID is the id of the current layerfile runner.
RETRY_INDEX is the current retry for the given runner (initially 1, then when
retried once, 2, etc)
API_EXTRA=some data passed from API
API_EXTRA is optional data passed in when a run is started by the API.