Skip to content

Deploy command environment ​

deploy_command runs with reconD's own environment plus these variables, which describe the release being deployed. During a rollback, they describe the release being restored.

VariableSourceExample
WORKLOAD_NAMEconfig namemy-app
WORKLOAD_CONTAINER_NAMEconfig container_namemy-app
WORKLOAD_IMAGEmetadata imageghcr.io/my-account/app-repo
WORKLOAD_IMAGE_TAGmetadata image_tagprod-sha-10a3e42
WORKLOAD_MANIFEST_DIGESTmetadata manifest_digestsha256:19779d90...
WORKLOAD_GIT_SHAmetadata git_sha10a3e42cc477e9e6...

Variables whose metadata field is missing are set to an empty string.

Example ​

sh
#!/bin/sh
set -eu
ref="$WORKLOAD_IMAGE@$WORKLOAD_MANIFEST_DIGEST"
echo "deploying $WORKLOAD_NAME at $WORKLOAD_GIT_SHA ($ref)"
docker pull "$ref"
docker rm -f "$WORKLOAD_CONTAINER_NAME" 2>/dev/null || true
docker run -d --name "$WORKLOAD_CONTAINER_NAME" --restart unless-stopped "$ref"

See Deploy command for how the command is run.

Released under the MIT License.