File tree Expand file tree Collapse file tree 1 file changed +57
-0
lines changed Expand file tree Collapse file tree 1 file changed +57
-0
lines changed Original file line number Diff line number Diff line change 1+ variables :
2+ # variables for docker service to build image during CI
3+ DOCKER_HOST : tcp://docker:2376
4+ DOCKER_TLS_CERTDIR : " /certs"
5+ DOCKER_TLS_VERIFY : 1
6+ DOCKER_CERT_PATH : " $DOCKER_TLS_CERTDIR/client"
7+
8+ # service of dind to build image during CI
9+ services :
10+ - docker:19.03.13-dind
11+
12+
13+ build static :
14+ stage : build:static
15+ image : node:16
16+ script :
17+ - npm i
18+ - npm run build
19+ only :
20+ refs :
21+ - dev
22+ - rc
23+ - master
24+ artifacts :
25+ paths :
26+ - build/
27+
28+ build image :
29+ stage : build:image
30+ image : docker:19.03.13
31+ dependencies :
32+ - build static
33+ script :
34+ - docker build -f ci/Dockerfile -t ssl1321ois/timelog_web:${CI_COMMIT_BRANCH}.${CI_COMMIT_SHORT_SHA} .
35+ - docker login -u=${DOCKER_USER} -p=${DOCKER_PASSWORD}
36+ - docker push ssl1321ois/timelog_web:${CI_COMMIT_BRANCH}.${CI_COMMIT_SHORT_SHA}
37+ only :
38+ refs :
39+ - dev
40+ - rc
41+ - master
42+
43+ deploy :
44+ stage : deploy
45+ image : nightlord851108/kustomize
46+ only :
47+ refs :
48+ - master
49+ script :
50+ - cd deployment/overlay/production
51+ - kustomize edit set image ssl1321ois/timelog_web:${CI_COMMIT_BRANCH}.${CI_COMMIT_SHORT_SHA}
52+ - kustomize build . | kubectl apply --server=${CLUSTER_URL} --token=${CLUSTER_TOKEN} --insecure-skip-tls-verify=true --namespace=production -f -
53+
54+ stages :
55+ - build:static
56+ - build:image
57+ - deploy
You can’t perform that action at this time.
0 commit comments