forked from mozilla-services/server-syncstorage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
53 lines (49 loc) · 1.33 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
---
stages:
- prepare
- build
- deploy
get-image-tag:
stage: prepare
image:
name: bitnami/git
entrypoint: ["bash"]
script:
- set -e
- 'echo "CI triggered by: $CI_PIPELINE_SOURCE"'
- echo "APP_VERSION_TAG=$(git describe --tags --always HEAD | sed -n -E 's/^([0-9\.]+)(-([0-9]+.*))?/\1-enote-\3/p')" > docker-variables.env
- cat docker-variables.env
artifacts:
reports:
dotenv: docker-variables.env
build-and-push-image:
stage: build
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
- |
set -e
mkdir -p /kaniko/.docker
echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
/kaniko/executor --context $CI_PROJECT_DIR --dockerfile Dockerfile --destination $CI_REGISTRY_IMAGE:$TAG
variables:
TAG: $APP_VERSION_TAG
.update-helm-charts-template:
stage: deploy
trigger:
project: 'sre/helm-charts'
strategy: depend
forward:
pipeline_variables: true
update-helm-charts-dev:
extends: .update-helm-charts-template
variables:
ENV: dev
APP: sync-storage
TAG: $APP_VERSION_TAG
rules:
- if: >-
$CI_PIPELINE_SOURCE != "schedule"
&& $CI_COMMIT_REF_NAME != $CI_COMMIT_TAG
&& $CI_COMMIT_REF_NAME == "enote"