-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
38 lines (36 loc) · 1.13 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
stages:
- build
- deploy-prod
build:
stage: build
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
variables:
CONTAINER_PATH: $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA
script:
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"${CI_REGISTRY}\":{\"auth\":\"$(printf "%s:%s" "${CI_REGISTRY_USER}" "${CI_REGISTRY_PASSWORD}" | base64 | tr -d '\n')\"}}}" > /kaniko/.docker/config.json
- >-
/kaniko/executor
--context "${CI_PROJECT_DIR}"
--dockerfile "${CI_PROJECT_DIR}/Dockerfile"
--cache=true
--destination "${CONTAINER_PATH}"
only:
- main
deploy-prod:
stage: deploy-prod
image: lwolf/helm-kubectl-docker
variables:
KUBENS: apps
environment:
name: production
script:
- kubectl config use-context stakefish/infra:production-platform-1
- helm repo add bitnami https://charts.bitnami.com/bitnami
- helm upgrade governance-watch-db bitnami/postgresql --install --namespace ${KUBENS} --version 10.16.2
- helm upgrade --install ${CI_PROJECT_NAME} server/chart/ --set image.tag=${CI_COMMIT_SHORT_SHA} -n ${KUBENS}
# when: manual
only:
- main