Skip to content

Commit

Permalink
repository-clean.sh pipeline id for deployments (#3612)
Browse files Browse the repository at this point in the history
  • Loading branch information
KennyDaren authored Jan 14, 2025
1 parent dc4f9fb commit 82bc73e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gitlab/scripts/repository-clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ for REGISTRY_REPOSITORY in $(echo "${REGISTRY_REPOSITORIES}" | jq -rc '.[]'); do

if [ ! -z "${REPOSITORY_NAME_MAP_TO_ENVIRONMENT[${REPOSITORY_NAME%%-*}]}" ]; then
ENVIRONMENT=${REPOSITORY_NAME_MAP_TO_ENVIRONMENT[${REPOSITORY_NAME%%-*}]}
DEPLOYED_TAG=$(curl -L --silent --header "PRIVATE-TOKEN: ${API_TOKEN}" "${API_URL}/deployments?environment=${ENVIRONMENT}&status=success&sort=desc" | jq -r '.[0].sha')
DEPLOYED_TAG=$(curl -L --silent --header "PRIVATE-TOKEN: ${API_TOKEN}" "${API_URL}/deployments?environment=${ENVIRONMENT}&status=success&sort=desc" | jq -r '.[0] | "\(.sha)-\(.deployable.pipeline.id)"')
DEPLOYED_TAG_CREATED_DATE=$(curl -L --silent --header "PRIVATE-TOKEN: ${API_TOKEN}" "${API_URL}/registry/repositories/${REPOSITORY_ID}/tags/${DEPLOYED_TAG}" | jq -r '.created_at')

if [ ! -z "${DEPLOYED_TAG}" ] && [ "${DEPLOYED_TAG_CREATED_DATE}" != "null" ]; then
Expand Down

0 comments on commit 82bc73e

Please sign in to comment.