Skip to content
Snippets Groups Projects
Commit 771b46cd authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

added registry gc

parent 3191638a
No related tags found
No related merge requests found
Pipeline #4016 passed
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment