new standard deploy templates

This commit is contained in:
ducoterra
2020-04-25 11:15:23 -04:00
parent 8404d43222
commit 7868867908
7 changed files with 31 additions and 24 deletions

View File

@@ -36,15 +36,14 @@ deploy:
- $CI_COMMIT_TAG
stage: deploy
image:
name: debian:latest
name: debian:10
entrypoint: [""]
script:
- echo $CI_REGISTRY_IMAGE
- apt -qq update >> /dev/null && apt -qq install -y curl gettext >> /dev/null
- curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl
- chmod +x ./kubectl
- envsubst < k8s/deploy.yaml > out.yaml
- mv out.yaml k8s/deploy.yaml
- ./kubectl apply -f k8s
- mkdir /deploy
- for f in $(find k8s -regex '.*\\.ya*ml); do envsubst < $f > "/deploy/$(basename $f)"; done'
- ./kubectl apply -f /deploy
- ./kubectl rollout status deploy $DEPLOY
- ./kubectl exec $(./kubectl get pods --selector=app=$DEPLOY --output=jsonpath='{.items[*].metadata.name}') -- python manage.py migrate