Commit 771b46cd authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

added registry gc

parent 3191638a
Pipeline #4016 passed with stage
in 1 minute and 10 seconds
......@@ -2,6 +2,7 @@ FROM dtzar/helm-kubectl
RUN apk add --update \
curl \
jq \
php7-cli \
php7-curl \
php7-json \
......@@ -11,4 +12,10 @@ RUN apk add --update \
COPY scripts /scripts
WORKDIR /scripts
CMD php deleteOldBranches.php
\ No newline at end of file
CMD php deleteOldBranches.php && \
export GITLAB_VERSION=$(helm ls -o json | jq -c -r '.[] | select(.name == "gitlab") | .chart' | cut -d"-" -f2) && \
helm get values gitlab > gitlab.yml && \
helm upgrade gitlab gitlab/gitlab -f gitlab.yml --version=$GITLAB_VERSION --set registry.maintenance.readOnly.enabled=true --wait && \
POD=$(kubectl -n gitlab-suma get pods -l app=registry -o jsonpath='{.items[0].metadata.name}') && \
kubectl exec $pod --/bin/registry garbage-collect && \
helm upgrade gitlab gitlab/gitlab -f gitlab.yml --version=$GITLAB_VERSION
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment