This repository has been archived by the owner on Jul 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.gitlab-ci.yml
130 lines (122 loc) · 3.49 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
variables:
ARGO_SERVER: "argo.<AWS_HOSTED_ZONE_NAME>:443"
ARGO_HTTP1: 'true'
ARGO_SECURE: 'true'
ARGO_NAMESPACE: argo
DOCKER_TLS_CERTDIR: "/certs"
DOCKER_TLS_VERIFY: 1
DOCKER_CERT_PATH: "${DOCKER_TLS_CERTDIR}/client"
BUILDER_IMAGE: "kubefirst/chubbo:0.2"
stages:
- branch
- publish
- development
- staging
- release
#lint:
# image: "${BUILDER_IMAGE}"
# stage: branch
# only:
# - branches
# except:
# - main
# script:
# - |
# argo submit .argo/npm-run.yaml \
# --generate-name="${CI_PROJECT_NAME}-lint-${CI_COMMIT_SHORT_SHA}" \
# --serviceaccount=argo \
# -p appName="${CI_PROJECT_NAME}" \
# -p branch="${CI_COMMIT_REF_NAME}" \
# -p gitRepoUrl="${CI_PROJECT_URL}" \
# -p npmScriptName="lint" \
# --wait --log
build:
image: "${BUILDER_IMAGE}"
stage: branch
only:
- branches
except:
- main
script:
- |
argo submit .argo/npm-run.yaml \
--generate-name="${CI_PROJECT_NAME}-build-${CI_COMMIT_SHORT_SHA}" \
--serviceaccount=argo \
-p appName="${CI_PROJECT_NAME}" \
-p branch="${CI_COMMIT_REF_NAME}" \
-p gitRepoUrl="${CI_PROJECT_URL}" \
-p npmScriptName="build" \
--wait --log
publish:
image: "${BUILDER_IMAGE}"
stage: publish
only:
- main
script:
- echo "commit sha $CI_COMMIT_SHA"
- |
argo submit .argo/publish.yaml \
--generate-name="${CI_PROJECT_NAME}-publish-${CI_COMMIT_SHORT_SHA}" \
--serviceaccount=argo \
-p appName="${CI_PROJECT_NAME}" \
-p ciCommitSha="${CI_COMMIT_SHA}" \
-p branch="${CI_COMMIT_REF_NAME}" \
-p gitRepoUrl="${CI_PROJECT_URL}" \
-p shortSha="${CI_COMMIT_SHORT_SHA}" \
-p dockerFilePath="build/Dockerfile" \
--wait --log
development:
image: "${BUILDER_IMAGE}"
stage: development
only:
- main
script:
- echo "commit sha $CI_COMMIT_SHA"
- |
argo submit .argo/deploy.yaml \
--generate-name="${CI_PROJECT_NAME}-development-${CI_COMMIT_SHORT_SHA}" \
--serviceaccount=argo \
-p appName="${CI_PROJECT_NAME}" \
-p ciCommitSha="${CI_COMMIT_SHA}" \
-p branch="${CI_COMMIT_REF_NAME}" \
-p environment="development" \
-p gitRepoUrl="${CI_PROJECT_URL}" \
-p shortSha="${CI_COMMIT_SHORT_SHA}" \
--wait --log
staging:
image: "${BUILDER_IMAGE}"
stage: staging
only:
- main
script:
- echo "commit sha $CI_COMMIT_SHA"
- |
argo submit .argo/deploy.yaml \
--generate-name="${CI_PROJECT_NAME}-staging-${CI_COMMIT_SHORT_SHA}" \
--serviceaccount=argo \
-p appName="${CI_PROJECT_NAME}" \
-p ciCommitSha="${CI_COMMIT_SHA}" \
-p branch="${CI_COMMIT_REF_NAME}" \
-p environment="staging" \
-p gitRepoUrl="${CI_PROJECT_URL}" \
-p shortSha="${CI_COMMIT_SHORT_SHA}" \
--wait --log
release:
image: "${BUILDER_IMAGE}"
stage: release
only:
- main
script:
- echo "commit sha $CI_COMMIT_SHA"
- |
argo submit .argo/release.yaml \
--generate-name="${CI_PROJECT_NAME}-release-${CI_COMMIT_SHORT_SHA}" \
--serviceaccount=argo \
-p appName="${CI_PROJECT_NAME}" \
-p ciCommitSha="${CI_COMMIT_SHA}" \
-p branch="${CI_COMMIT_REF_NAME}" \
-p environment="production" \
-p gitRepoUrl="${CI_PROJECT_URL}" \
-p gitRepoPath="${CI_PROJECT_URL:8}" \
-p shortSha="${CI_COMMIT_SHORT_SHA}" \
--wait --log