Approve Deployment¶
Logs a deployment approval in Merkely.
Open an example, similar to the fragment below, from a git repo.
docker run \
--env MERKELY_COMMAND=approve_deployment \
--env MERKELY_FINGERPRINT="${MERKELY_FINGERPRINT}" \
--env MERKELY_OLDEST_SRC_COMMITISH="${MERKELY_OLDEST_SRC_COMMITISH}" \
--env MERKELY_NEWEST_SRC_COMMITISH="${MERKELY_NEWEST_SRC_COMMITISH}" \
--env MERKELY_DESCRIPTION="${MERKELY_DESCRIPTION}" \
--env MERKELY_SRC_REPO_ROOT="${MERKELY_SRC_REPO_ROOT}" \
--env MERKELY_USER_DATA="${MERKELY_USER_DATA}" \
--env MERKELY_OWNER="${MERKELY_OWNER}" \
--env MERKELY_PIPELINE="${MERKELY_PIPELINE}" \
--env MERKELY_API_TOKEN="${MERKELY_API_TOKEN}" \
--env MERKELY_HOST="${MERKELY_HOST}" \
--env MERKELY_DRY_RUN="${MERKELY_DRY_RUN}" \
--rm \
--volume ${PWD}:/src \
--volume /var/run/docker.sock:/var/run/docker.sock \
merkely/change:latest
ENV_VAR_NAME |
Required? |
Notes |
|---|---|---|
MERKELY_COMMAND |
yes |
The Merkely command to execute. This page documents a value of approve_deployment |
MERKELY_FINGERPRINT |
yes |
The artifact’s Fingerprint |
MERKELY_OLDEST_SRC_COMMITISH |
yes |
The source commit-ish for the oldest change in the deployment approval. |
MERKELY_NEWEST_SRC_COMMITISH |
yes |
The source commit-ish for the newest change in the deployment approval. |
MERKELY_DESCRIPTION |
yes |
A description for the deployment approval. |
MERKELY_SRC_REPO_ROOT |
no |
The directory where the source git repository is volume-mounted. Defaults to /src. |
MERKELY_USER_DATA |
no |
A pathed filename containing json content to embed in the data logged to Merkely. If provided, must be volume-mounted in the container. If not provided, the json content defaults to {} |
MERKELY_OWNER |
yes |
Your user/organization name in Merkely. |
MERKELY_PIPELINE |
yes |
Your pipeline name in your user/organization in Merkely. |
MERKELY_API_TOKEN |
yes |
Your secret API token for Merkely. Set this to “DRY_RUN” to turn off all commands in all pipelines. |
MERKELY_HOST |
no |
The API hostname for Merkely. Defaults to https://app.merkely.com |
MERKELY_DRY_RUN |
no |
When set to “TRUE”, prints the command’s url+payload, does not make any HTTP calls to Merkely, and exits the command with a zero status code. Defaults to “FALSE”. See also setting the MERKELY_API_TOKEN (above) to code:`DRY_RUN`. |
- step: &approve_a_deployment
name: Approve a deployment
services: [ docker ]
script:
- *export_merkely_fingerprint_env_vars
- pipe: docker://merkely/change:latest
variables:
MERKELY_COMMAND: approve_deployment
MERKELY_FINGERPRINT: ${MERKELY_FINGERPRINT}
MERKELY_OLDEST_SRC_COMMITISH: "origin/production"
MERKELY_NEWEST_SRC_COMMITISH: ${BITBUCKET_COMMIT}
MERKELY_DESCRIPTION: "Production release requested"
MERKELY_SRC_REPO_ROOT: ${PWD}
MERKELY_OWNER: ${MERKELY_OWNER}
MERKELY_PIPELINE: ${MERKELY_PIPELINE}
MERKELY_API_TOKEN: ${MERKELY_API_TOKEN}
ENV_VAR_NAME |
Required? |
Notes |
|---|---|---|
MERKELY_COMMAND |
yes |
The Merkely command to execute. This page documents a value of approve_deployment |
MERKELY_FINGERPRINT |
yes |
The artifact’s Fingerprint |
MERKELY_OLDEST_SRC_COMMITISH |
yes |
The source commit-ish for the oldest change in the deployment approval. |
MERKELY_NEWEST_SRC_COMMITISH |
yes |
The source commit-ish for the newest change in the deployment approval. |
MERKELY_DESCRIPTION |
yes |
A description for the deployment approval. |
MERKELY_SRC_REPO_ROOT |
no |
The directory where the source git repository is volume-mounted. Defaults to /src. |
MERKELY_USER_DATA |
no |
A pathed filename containing json content to embed in the data logged to Merkely. If provided, must be volume-mounted in the container. If not provided, the json content defaults to {} |
MERKELY_OWNER |
yes |
Your user/organization name in Merkely. |
MERKELY_PIPELINE |
yes |
Your pipeline name in your user/organization in Merkely. |
MERKELY_API_TOKEN |
yes |
Your secret API token for Merkely. Set this to “DRY_RUN” to turn off all commands in all pipelines. |
MERKELY_HOST |
no |
The API hostname for Merkely. Defaults to https://app.merkely.com |
MERKELY_DRY_RUN |
no |
When set to “TRUE”, prints the command’s url+payload, does not make any HTTP calls to Merkely, and exits the command with a zero status code. Defaults to “FALSE”. See also setting the MERKELY_API_TOKEN (above) to code:`DRY_RUN`. |
- name: Approve a deployment
uses: docker://merkely/change:latest
env:
MERKELY_COMMAND: approve_deployment
MERKELY_FINGERPRINT: docker://${{ env.IMAGE_TAGGED }}
MERKELY_OLDEST_SRC_COMMITISH: origin/production
MERKELY_NEWEST_SRC_COMMITISH: ${{ github.event.inputs.deploy_commit }}
MERKELY_DESCRIPTION: "Approval created by ${{ github.actor }} on github"
MERKELY_SRC_REPO_ROOT: ${{ github.workspace }}
MERKELY_OWNER: ${{ env.MERKELY_OWNER }}
MERKELY_PIPELINE: ${{ env.MERKELY_PIPELINE }}
MERKELY_API_TOKEN: ${{ secrets.MERKELY_API_TOKEN }}
ENV_VAR_NAME |
Required? |
Notes |
|---|---|---|
MERKELY_COMMAND |
yes |
The Merkely command to execute. This page documents a value of approve_deployment |
MERKELY_FINGERPRINT |
yes |
The artifact’s Fingerprint |
MERKELY_OLDEST_SRC_COMMITISH |
yes |
The source commit-ish for the oldest change in the deployment approval. |
MERKELY_NEWEST_SRC_COMMITISH |
yes |
The source commit-ish for the newest change in the deployment approval. |
MERKELY_DESCRIPTION |
yes |
A description for the deployment approval. |
MERKELY_SRC_REPO_ROOT |
no |
The directory where the source git repository is volume-mounted. Defaults to /src. In a uses: directive the repository directory is automatically volume-mounted to ${{ github.workspace }}. |
MERKELY_USER_DATA |
no |
A pathed filename containing json content to embed in the data logged to Merkely. If provided, must be volume-mounted in the container. If not provided, the json content defaults to {} |
MERKELY_OWNER |
yes |
Your user/organization name in Merkely. |
MERKELY_PIPELINE |
yes |
Your pipeline name in your user/organization in Merkely. |
MERKELY_API_TOKEN |
yes |
Your secret API token for Merkely. Set this to “DRY_RUN” to turn off all commands in all pipelines. |
MERKELY_HOST |
no |
The API hostname for Merkely. Defaults to https://app.merkely.com |
MERKELY_DRY_RUN |
no |
When set to “TRUE”, prints the command’s url+payload, does not make any HTTP calls to Merkely, and exits the command with a zero status code. Defaults to “FALSE”. See also setting the MERKELY_API_TOKEN (above) to code:`DRY_RUN`. |