-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
63 lines (58 loc) · 1.46 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
54
55
56
57
58
59
60
61
62
63
stages:
- kaniko
- deploy
variables:
APPNAME: "tosync"
DOMAIN: "avapps.fr"
ROOT_URL: "https://${APPNAME}.${DOMAIN}"
IMAGE_TAG: "${CI_COMMIT_REF_SLUG}-${CI_COMMIT_SHORT_SHA}"
INFO: "[meteor-docker]"
before_script:
- if [[ $CI_COMMIT_REF_NAME = "master" && $CI_COMMIT_TAG ]];
then IMAGE_TAG=$(echo stable-"$CI_COMMIT_TAG");
else IMAGE_TAG=$(echo "$CI_COMMIT_REF_SLUG"-"$CI_COMMIT_SHORT_SHA");
fi
- echo "${INFO}" Building image for "$CI_COMMIT_REF_NAME" with tag "$IMAGE_TAG"
kaniko-build:
stage: kaniko
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
- echo ${INFO} Starting docker image build with Kaniko for ${CI_COMMIT_REF_NAME} and pushing to ${IMAGE_TAG}
- /kaniko/executor
--context "${CI_PROJECT_DIR}"
--dockerfile "${CI_PROJECT_DIR}/Dockerfile"
--destination "${CI_REGISTRY_IMAGE}:${IMAGE_TAG}"
only:
- master
- dev
- dev-end
tags:
- docker
deploy-prod:
stage: deploy
variables:
CHART_IMAGE_TAG: $IMAGE_TAG
trigger:
project: kubernetes/avapps/tosync-meteor-chart
strategy: depend
environment:
name: production
url: https://tosync.avapps.fr
when: manual
only:
- master
deploy-dev:
stage: deploy
variables:
CHART_IMAGE_TAG: $IMAGE_TAG
trigger:
project: kubernetes/avapps/tosync-meteor-chart
strategy: depend
environment:
name: staging
url: https://tosync.dev.avapps.fr
only:
- dev
- dev-end