Control Pull Request¶
Fail the pipeline unless approved pull_request for this commit
docker run \
--env MERKELY_COMMAND=control_pull_request \
--env MERKELY_FINGERPRINT="${MERKELY_FINGERPRINT}" \
--env MERKELY_CI_BUILD_URL="${MERKELY_CI_BUILD_URL}" \
--env MERKELY_DESCRIPTION="${MERKELY_DESCRIPTION}" \
--env MERKELY_EVIDENCE_TYPE="${MERKELY_EVIDENCE_TYPE}" \
--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 /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 control_pull_request |
MERKELY_FINGERPRINT |
yes |
The artifact’s Fingerprint |
MERKELY_CI_BUILD_URL |
yes |
Link to the build in the ci system. |
MERKELY_DESCRIPTION |
no |
Bitbucket pull request. |
MERKELY_EVIDENCE_TYPE |
no |
The evidence type. Defaults to pull_request |
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: &fail_the_pipeline_unless_approved_pull_request_for_this_commit
name: Fail the pipeline unless approved pull_request for this commit
services: [ docker ]
script:
- *export_merkely_fingerprint_env_vars
- pipe: docker://merkely/change:latest
variables:
MERKELY_COMMAND: control_pull_request
MERKELY_FINGERPRINT: ${MERKELY_FINGERPRINT}
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 control_pull_request |
MERKELY_FINGERPRINT |
yes |
The artifact’s Fingerprint |
MERKELY_CI_BUILD_URL |
no |
Link to the build in the ci system. Defaults to https://bitbucket.org/${BITBUCKET_WORKSPACE}/${BITBUCKET_REPO_SLUG}/addon/pipelines/home#!/results/${BITBUCKET_BUILD_NUMBER} |
MERKELY_DESCRIPTION |
no |
Bitbucket pull request. |
MERKELY_EVIDENCE_TYPE |
no |
The evidence type. Defaults to pull_request |
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`. |