-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.gitlab-ci.yml
52 lines (47 loc) · 1.38 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
image: docker:20.10.16-dind
include:
- template: Security/Secret-Detection.gitlab-ci.yml
- template: Security/SAST.gitlab-ci.yml
- template: Security/Dependency-Scanning.gitlab-ci.yml
workflow:
rules:
- if: $CI_COMMIT_BRANCH
variables:
DOCKER_HOST: tcp://docker:2376
DOCKER_TLS_CERTDIR: "/certs"
DOCKER_TLS_VERIFY: 1
DOCKER_CERT_PATH: "$DOCKER_TLS_CERTDIR/client"
TAG: $CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA
IMAGE_NAME: "$IMAGE:$TAG"
DOCKER_IMAGE: "$IMAGE_NAME"
KANIKO_CACHE_ARGS: ""
stages:
- build
- deploy
- test
image:build:release:
stage: build
rules:
- if: $CI_COMMIT_BRANCH == "dev"
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
before_script:
- echo APOLLO_URL=$APOLLO_URL >> .env.production
- echo REACT_APP_APOLLO_URL=$REACT_APP_APOLLO_URL >> .env.production
- echo IMAGE_DOMAIN=$IMAGE_DOMAIN >> .env.production
script:
- mkdir -p /kaniko/.docker
- cat $DOCKER_AUTH_CONFIG > /kaniko/.docker/config.json
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile Dockerfile $KANIKO_CACHE_ARGS --destination $IMAGE:$TAG
update:deploy:branch:
rules:
- if: '$CI_COMMIT_BRANCH == "dev"'
variables:
WEBTAG: $CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA
AUTHOR: $CI_COMMIT_AUTHOR
MESSAGE: $CI_COMMIT_MESSAGE
stage: deploy
trigger:
project: digg/deploy-dataportal
branch: main