-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
63 lines (57 loc) · 1.29 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:
- build
- deploy
variables:
IMAGE_FULL_NAME: registry-intl.ap-southeast-5.aliyuncs.com/bilpay/backend:$CI_COMMIT_REF_NAME
build:
stage: build
image:
name: gcr.io/kaniko-project/executor:v1.14.0-debug
entrypoint: [""]
script:
- mkdir -p storage/framework/cache
- mkdir -p storage/framework/sessions
- mkdir -p storage/framework/views
- echo $PROD_ENV | base64 -d > .env
- ls -l storage/framework/
- echo $REGISTRY_AUTH > /kaniko/.docker/config.json
- /kaniko/executor
--context "${CI_PROJECT_DIR}"
--dockerfile "${CI_PROJECT_DIR}/Dockerfile"
--destination "$IMAGE_FULL_NAME"
only:
- tags
tags:
- bilpay-production
###
.init: &init
- cd deploy
- export KUSTOMIZE_PLUGIN_HOME=$(mktemp)
- export IMAGE_VERSION=$IMAGE_FULL_NAME
# - sed -i "s/CHANGE_ME/$IMAGE_FULL_NAME/g" backend/deployment.yaml
- helmfile repos
.diff:
stage: deploy
image: ghcr.io/helmfile/helmfile:v0.162.0
script:
- *init
- helmfile diff
.apply:
stage: deploy
image: ghcr.io/helmfile/helmfile:v0.162.0
script:
- *init
- helmfile apply
when: manual
diff:bilpay-production:
extends: .diff
only:
- tags
tags:
- bilpay-production
apply:bilpay-production:
extends: .apply
only:
- tags
tags:
- bilpay-production