-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy path.gitlab-ci.yml
103 lines (93 loc) · 2.22 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
stages:
- check
- build_image
- deploy
variables:
IMAGE_NAME: openaios
static_check:
stage: check
image: '${BUILD_IMAGE}'
script:
- make lint
- make vet
.build_image:
stage: build_image
image: '${DIND_IMAGE}'
script:
- IMAGE_FULL_NAME=${IMAGE_REGISTRY}/${IMAGE_NAME}:${IMAGE_TAG}
- >
docker build -t ${IMAGE_FULL_NAME}
--build-arg BUILDBASE=${BUILD_IMAGE}
--build-arg KUBECTLBASE=${KUBECTL_IMAGE}
--build-arg TARGETBASE=${TARGET_IMAGE}
--build-arg VERSION=${VERSION}
--build-arg GOPROXY=${GOPROXY} -f ./dockerfile/Dockerfile .
- docker push ${IMAGE_FULL_NAME}
build_dev_image:
extends: .build_image
variables:
IMAGE_TAG: ${CI_COMMIT_SHA}
VERSION: ${CI_COMMIT_RREF_NAME}-${CI_COMMIT_SHA}
only:
- master
build_release_image:
extends: .build_image
variables:
IMAGE_TAG: ${CI_COMMIT_TAG}
VERSION: ${CI_COMMIT_TAG}-${CI_COMMIT_SHA}
only:
- tags
.deploy:
stage: deploy
image: '${HELM_IMAGE}'
variables:
RELEASE_NAME: pineapple
RELEASE_NAMESPACE: pineapple
EXTRA_ARGS: ''
script:
- IMAGE_REPO=${IMAGE_REGISTRY}/${IMAGE_NAME}
- >
helm upgrade --install ${RELEASE_NAME} ./charts/pineapple
-n ${RELEASE_NAMESPACE}
-f /secrets/openaios-values.yaml
--set core.image.repository=${IMAGE_REPO}
--set core.image.tag=${IMAGE_TAG}
--set webterminal.image.repository=${IMAGE_REPO}
--set webterminal.image.tag=${IMAGE_TAG}
--set billing.image.repository=${IMAGE_REPO}
--set billing.image.tag=${IMAGE_TAG}
--set webhook.image.repository=${IMAGE_REPO}
--set webhook.image.tag=${IMAGE_TAG}
${EXTRA_ARGS}
deploy_develop:
extends: .deploy
variables:
IMAGE_TAG: ${CI_COMMIT_SHA}
environment:
name: pineapple-develop
only:
- master
tags:
- deploy-test
deploy_pre_product:
extends: .deploy
variables:
IMAGE_TAG: ${CI_COMMIT_TAG}
EXTRA_ARGS: "--wait --timeout=30m"
environment:
name: pineapple-develop
only:
- tags
tags:
- deploy-test
deploy_product:
extends: .deploy
variables:
IMAGE_TAG: ${CI_COMMIT_TAG}
environment:
name: pineapple-product
only:
- tags
tags:
- deploy-product
when: manual