Skip to content
Snippets Groups Projects
Verified Commit 1b8bc665 authored by Tom Teichler's avatar Tom Teichler :beers:
Browse files

Update ci config

parent 77c61756
No related branches found
No related tags found
1 merge request!50Add k8s deployment
Pipeline #179562 skipped
......@@ -35,14 +35,56 @@ docker build:
paths:
- DIGESTFILE
deploy docker image:
.deploy:
stage: deploy
image: line/kubectl-kustomize:latest
tags:
- teckids-trusted
image: line/kubectl-kustomize:latest
script:
before_script:
- echo $KUBECONFIG | base64 -d > /tmp/kubeconfig
deploy production:
extends: .deploy
environment:
name: production
url: https://teckids.org
script:
- cd deploy/overlays/production
- kustomize edit set image registry.edugit.org/teckids/team-pr/teckids.org:$(cat ../../../DIGESTFILE)
- kustomize build | envsubst >output.yaml
- kustomize edit set image registry.edugit.org/teckids/team-pr/teckids.org:$CI_COMMIT_REF_NAME@$(cat ../../../DIGESTFILE)
- kustomize build | envsubst > output.yaml
- kubectl --kubeconfig=/tmp/kubeconfig apply -f output.yaml
only:
- master
deploy review:
extends: .deploy
script: deploy_review
environment:
name: review/$CI_COMMIT_REF_SLUG
url: https://$CI_COMMIT_REF_SLUG.review.teckids.org
on_stop: delete review
auto_stop_in: 3 days
only:
- merge_requests
when: manual
script:
- cd deploy/overlays/review
- kustomize edit set image registry.edugit.org/teckids/team-pr/teckids.org:$CI_COMMIT_REF_NAME@$(cat ../../../DIGESTFILE)
- kustomize build | envsubst > output.yaml
- kubectl --kubeconfig=/tmp/kubeconfig apply -f output.yaml
delete review:
extends: .deploy
script: delete_review
environment:
name: review/$CI_COMMIT_REF_SLUG
action: stop
before_script:
- echo $KUBECONFIG | base64 -d > /tmp/kubeconfig
- cd deploy/overlays/review
- kustomize build | envsubst > output.yaml
script:
- kubectl --kubeconfig=/tmp/kubeconfig delete -f output.yaml
when: manual
only:
- merge_requests
......@@ -6,7 +6,7 @@ commonAnnotations:
source-repository: https://edugit.org/Teckids/team-pr/teckids.org
commonLabels:
app: teckids-website
environment: production
environment: ${CI_COMMIT_REF_SLUG}
namespace: teckids-website
patches:
- target:
......
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