Files
homer/.gitlab-ci.yml
2020-05-16 09:54:45 -04:00

38 lines
1.0 KiB
YAML

variables:
CI_PROJECT_NAME: "homer"
CI_PROJECT_DIR: "."
CI_REGISTRY_IMAGE: hub.ducoterra.net/ducoterra/homer
stages:
- build
- test
- deploy
build:
only:
variables:
- $CI_COMMIT_TAG
stage: build
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
- echo $DEPLOY
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG
deploy_to_prod:
variables:
DEPLOY: prod
stage: deploy
only:
variables:
- $CI_COMMIT_TAG
image:
name: debian:10
entrypoint: [""]
script:
- apt -qq update >> /dev/null && apt -qq install -y curl >> /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
- curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
- chmod +x ./kubectl
- helm install --set tag=$CI_COMMIT_TAG $CI_PROJECT_NAME ./helm