Log Artifact¶
Logs an artifact in Merkely.
Open an example, similar to the fragment below, from a git repo.
docker run \
--env MERKELY_COMMAND=log_artifact \
--env MERKELY_FINGERPRINT="${MERKELY_FINGERPRINT}" \
--env MERKELY_IS_COMPLIANT="${MERKELY_IS_COMPLIANT}" \
--env MERKELY_ARTIFACT_GIT_COMMIT="${MERKELY_ARTIFACT_GIT_COMMIT}" \
--env MERKELY_ARTIFACT_GIT_URL="${MERKELY_ARTIFACT_GIT_URL}" \
--env MERKELY_CI_BUILD_NUMBER="${MERKELY_CI_BUILD_NUMBER}" \
--env MERKELY_CI_BUILD_URL="${MERKELY_CI_BUILD_URL}" \
--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 /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 log_artifact |
MERKELY_FINGERPRINT |
yes |
The artifact’s Fingerprint |
MERKELY_IS_COMPLIANT |
yes |
Set this to “TRUE” if the artifact is considered compliant from you build process. |
MERKELY_ARTIFACT_GIT_COMMIT |
yes |
The sha of the git commit that produced this build. |
MERKELY_ARTIFACT_GIT_URL |
yes |
The link to the source git commit this build was based on. |
MERKELY_CI_BUILD_NUMBER |
yes |
The ci build number. |
MERKELY_CI_BUILD_URL |
yes |
Link to the build in the ci system. |
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`. |
Open an example, similar to the fragment below, from a git repo.
- step: &log_docker_image_in_merkely
name: Log Docker image in Merkely
services: [ docker ]
script:
- *export_merkely_fingerprint_env_vars
- pipe: docker://merkely/change:latest
variables:
MERKELY_COMMAND: log_artifact
MERKELY_FINGERPRINT: ${MERKELY_FINGERPRINT}
MERKELY_IS_COMPLIANT: "TRUE"
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 log_artifact |
MERKELY_FINGERPRINT |
yes |
The artifact’s Fingerprint |
MERKELY_IS_COMPLIANT |
yes |
Set this to “TRUE” if the artifact is considered compliant from you build process. |
MERKELY_ARTIFACT_GIT_COMMIT |
no |
The sha of the git commit that produced this build. Defaults to ${BITBUCKET_COMMIT} |
MERKELY_ARTIFACT_GIT_URL |
no |
The link to the source git commit this build was based on. Defaults to https://bitbucket.org/${BITBUCKET_WORKSPACE}/${BITBUCKET_REPO_SLUG}/commits/${BITBUCKET_COMMIT} |
MERKELY_CI_BUILD_NUMBER |
no |
The ci build number. Defaults to ${BITBUCKET_BUILD_NUMBER} |
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_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`. |
Open an example, similar to the fragment below, from a git repo.
- name: Log Docker image in Merkely
uses: docker://merkely/change:latest
env:
MERKELY_COMMAND: log_artifact
MERKELY_FINGERPRINT: docker://${{ env.IMAGE_TAGGED }}
MERKELY_IS_COMPLIANT: "TRUE"
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 log_artifact |
MERKELY_FINGERPRINT |
yes |
The artifact’s Fingerprint |
MERKELY_IS_COMPLIANT |
yes |
Set this to “TRUE” if the artifact is considered compliant from you build process. |
MERKELY_ARTIFACT_GIT_COMMIT |
no |
The sha of the git commit that produced this build. Defaults to ${GITHUB_SHA} |
MERKELY_ARTIFACT_GIT_URL |
no |
The link to the source git commit this build was based on. Defaults to ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/commit/${GITHUB_SHA} |
MERKELY_CI_BUILD_NUMBER |
no |
The ci build number. Defaults to ${GITHUB_RUN_ID} |
MERKELY_CI_BUILD_URL |
no |
Link to the build in the ci system. Defaults to ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID} |
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`. |