-
Notifications
You must be signed in to change notification settings - Fork 20
/
.gitlab-ci.yml
35 lines (33 loc) · 1.25 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
image: gcr.io/kaniko-project/executor:debug
stages:
- build
- deploy
build:
stage: build
script:
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
- |
/kaniko/executor \
--cache=true \
--context $CI_PROJECT_DIR \
--dockerfile $CI_PROJECT_DIR/Dockerfile \
--destination $CI_REGISTRY_IMAGE:$CI_COMMIT_BRANCH-$CI_COMMIT_SHORT_SHA \
--build-arg NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL}
deploy:
stage: deploy
needs: [ "build" ]
image:
name: bitnami/kubectl:latest
environment:
name: production
url: https://qplay.cz
rules:
- if: '$CI_COMMIT_BRANCH == "master"'
when: on_success
- if: "$CI_COMMIT_BRANCH == null"
when: never
- when: manual
script:
- kubectl --token=${KUBE_TOKEN} --server=${KUBE_SERVER} set image deployment/qplay-frontpage qplay-frontpage=$CI_REGISTRY_IMAGE:$CI_COMMIT_BRANCH-$CI_COMMIT_SHORT_SHA --namespace=$KUBE_NAMESPACE --record --insecure-skip-tls-verify=true
- kubectl --token=${KUBE_TOKEN} --server=${KUBE_SERVER} --namespace=$KUBE_NAMESPACE --insecure-skip-tls-verify=true rollout status deployment qplay-frontpage