Skip to content

Commit 8ed1720

Browse files
Merge pull request #881 from tulibraries/tag-prod-helm-chart
Tag prod helm chart on prod deploys.
2 parents f948e85 + bf35298 commit 8ed1720

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

.gitlab-ci.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,28 @@ tag_release:
7575
only:
7676
- tags
7777

78+
tag_prod_chart:
79+
stage: tag
80+
extends: .tag_image
81+
# Helm charts live in Harbor as OCI artifacts; add/update a "prod" tag so we
82+
# can easily find the chart version that is currently deployed in production.
83+
variables:
84+
HARBOR_PROJECT: "tulibraries"
85+
HARBOR_CHART_REPOSITORY: "charts%2Fpadigital"
86+
only:
87+
- tags
88+
script:
89+
- |
90+
API_BASE="https://${HARBOR}/api/v2.0/projects/${HARBOR_PROJECT}/repositories/${HARBOR_CHART_REPOSITORY}"
91+
curl --silent --show-error -u "${HARBOR_USERNAME}:${HARBOR_TOKEN}" \
92+
-X DELETE "${API_BASE}/artifacts/prod/tags/prod" || echo "prod tag not present yet"
93+
- |
94+
curl --silent --show-error --fail \
95+
-u "${HARBOR_USERNAME}:${HARBOR_TOKEN}" \
96+
-H "Content-Type: application/json" \
97+
-d "{\"name\":\"prod\"}" \
98+
-X POST "${API_BASE}/artifacts/${HELM_VERSION_PROD}/tags"
99+
78100
prod_deploy:
79101
variables:
80102
IMAGE: harbor.k8s.temple.edu/tulibraries/padigital

0 commit comments

Comments
 (0)