-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
72 lines (72 loc) · 1.83 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
#image: registry.xxx.cn/devops/runner-docker-dind:1.0.1
#
#variables:
# DOCKER_DRIVER: overlay2
# DOCKER_TLS_CERTDIR: ""
# GOPROXY: "http://nexus.xxx.cn:8090/repository/goproxy/"
#
#before_script:
# - export CI_COMMIT_SHORT_ID=$(git rev-parse --short HEAD)
# - echo "before ok"
#
#stages:
# - test
# - build
# - deploy-prod
# - deploy-test
#
## 测试
#test-master:
# stage: test
# tags:
# - chaos
# only:
# - master
# script:
# - echo "test ok"
# # - go test
#
## 编译
#build-master:
# stage: build
# tags:
# - chaos
# only:
# - tags
# services:
# - registry.xxx.cn/devops/runner-docker-dind:1.0.1
# script:
# # docker login
# - export DOCKER_HOST='tcp://localhost:2375'
# - docker login registry.xxx.cn -u chaos -p xxx.2019
# - make docker-all VERSION=$CI_COMMIT_REF_NAME
#
## 部署正式环境
#deploy-prod:
# stage: deploy-prod
# tags:
# - chaos
# only:
# - tags
# except:
# - branches
# services:
# - registry.xxx.cn/devops/runner-docker-dind:1.0.1
# script:
# - kubectl --kubeconfig=k8s/kubeconfig_prod patch statefulset eim-process --patch "{\"spec\":{\"template\":{\"spec\":{\"containers\":[{\"name\":\"eim-process\",\"image\":\"registry.xxx.cn/eim/eim-process:$CI_COMMIT_REF_NAME\"}]}}}}" -n eim
#
#
## 部署测试环境
#deploy-test:
# stage: deploy-test
# tags:
# - devops-test
# only:
# - dev
# services:
# - registry.xxx.cn/chaos/runner-docker-dind:1.0.1
# script:
# - export DOCKER_HOST='tcp://localhost:2375'
# - docker login registry.xxx.cn -u chaos -p xxx.2019
# - make docker-all VERSION="dev_$CI_COMMIT_SHORT_ID"
# - kubectl --kubeconfig=k8s/kubeconfig_test patch statefulset eim-process --patch "{\"spec\":{\"template\":{\"spec\":{\"containers\":[{\"name\":\"eim-process\",\"image\":\"registry.xxx.cn/eim/eim-process:dev_$CI_COMMIT_SHORT_ID\"}]}}}}" -n eim