Created
July 18, 2023 21:43
-
-
Save Noordsestern/b463b366f1e86eac32949aa318f20c94 to your computer and use it in GitHub Desktop.
Gitlab-Job for notifying Humanitec about new image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# IMAGE_NAME and IMAGE_TAG must be defined before - you had been using it in your docker-build step | |
# HUMANITEC_ORG is name of your org in Humanitec | |
# HUMANITEC_TOKEN that you defined under "Api Tokens" in Humanitec | |
Notify Humanitec About New Image: | |
image: curlimages/curl:latest | |
stage: .post | |
script: | |
- echo "Sending ${IMAGE_NAME}:${IMAGE_TAG} to Humanitec" | |
- > | |
curl -v | |
--request POST "https://api.humanitec.io/orgs/${MY_HUMANITEC_ORG}/artefact-versions" | |
--header "Authorization: Bearer ${HUMANITEC_TOKEN}" | |
--header "Content-Type: application/json" | |
--data-raw '{ | |
"name": "'${IMAGE_NAME}'", | |
"version": "'${IMAGE_TAG}'", | |
"type": "container", | |
"commit": "'${CI_COMMIT_SHA}'", | |
"ref": "'refs/heads/${CI_COMMIT_REF_NAME}'" | |
}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment