diff --git a/.dockerignore b/.dockerignore index 81bb5d60c8b50a263c9e7fb121c863c6b5293590..0032128ef79b84ca84c792ddae93283219653294 100644 --- a/.dockerignore +++ b/.dockerignore @@ -8,3 +8,4 @@ docker-compose.yml Dockerfile README.md helm +.gitlab-ci/ diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a120bb8f18da504f07ebc8a1ed5db2b0c3e6800f..7708b2b1e9382acba08affbf7adc398497a6a67b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,18 +4,12 @@ include: # Helm is used for deploying everything to kubernetes # Afterwards we do a rolling restart of our deployment -deploy: - stage: deploy - image: dtzar/helm-kubectl - tags: - - kubernetes - script: - - envsubst < helm/values/develop.yaml > values.yaml - - kubectl create secret docker-registry gitlab-registry-credentials --docker-server=$CI_REGISTRY --docker-username=$GITLAB_DEPLOY_USER --docker-password=$GITLAB_DEPLOY_PASSWORD --dry-run=client -o yaml | kubectl apply -f - - - helm upgrade -i manifest-service helm/manifest-service -f values.yaml - - kubectl rollout restart deployment manifest-service +deploy helm chart: + extends: .auto-deploy-helm-chart environment: name: $CI_COMMIT_REF_SLUG + on_stop: tear down + auto_stop_in: 1 week url: https://manifest-$CI_COMMIT_REF_SLUG.k3s.os.oxui.de/ only: - main diff --git a/.gitlab-ci/values.yaml b/.gitlab-ci/values.yaml new file mode 100644 index 0000000000000000000000000000000000000000..ab176f0aae295a10e71d0e04208c00ebd5d67e1d --- /dev/null +++ b/.gitlab-ci/values.yaml @@ -0,0 +1,15 @@ +replicaCount: 1 +containerPort: 8080 +manifests: + - https://manifest-service-dummy.k3s.os.oxui.de/manifest.json +ingress: + enabled: true + hosts: + - host: manifest-${CI_COMMIT_REF_SLUG}.k3s.os.oxui.de + paths: + - path: / +image: + tag: main + pullPolicy: Always +imagePullSecrets: + - name: gitlab-registry-credentials