-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
95 lines (86 loc) · 1.76 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
stages:
- test
- build_image
- system_test
- upload
- upload_tag
- clean
.gitlab_template: &gitlab_registry
before_script:
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
after_script:
- docker logout $CI_REGISTRY
test:install:
stage: test
image: centos:7
script:
- echo "unit_test:install"
tags:
- docker
test:unit_test:
stage: test
image: centos:7
script:
- echo "unit test"
tags:
- docker
test:functional_test:
stage: test
image: centos:7
script:
- echo "functional/integration test"
tags:
- docker
build_image:
stage: build_image
script:
- git clone [email protected]:Cepave/DockerCompose-Gcoin.git
- bash ./DockerCompose-Gcoin/build.sh -p smart-contract
tags:
- shell
only:
- master
- tags
system_test:
stage: system_test
script:
- echo "system test with image"
tags:
- shell
only:
- master
- tags
upload_image:
<<: *gitlab_registry
stage: upload
script:
- docker tag vchain-smart-contract $CI_REGISTRY_IMAGE:${CI_BUILD_REF:0:7}
- docker push $CI_REGISTRY_IMAGE:${CI_BUILD_REF:0:7}
- docker rmi $CI_REGISTRY_IMAGE:${CI_BUILD_REF:0:7}
tags:
- shell
only:
- master
upload_tag_image:
<<: *gitlab_registry
stage: upload_tag
script:
- docker tag vchain-smart-contract $CI_REGISTRY_IMAGE
- docker push $CI_REGISTRY_IMAGE
- docker rmi $CI_REGISTRY_IMAGE
- docker tag vchain-smart-contract $CI_REGISTRY_IMAGE:$CI_BUILD_TAG
- docker push $CI_REGISTRY_IMAGE:$CI_BUILD_TAG
- docker rmi $CI_REGISTRY_IMAGE:$CI_BUILD_TAG
tags:
- shell
only:
- tags
clean_image:
stage: clean
script:
- docker rmi vchain-smart-contract ; exit 0
tags:
- shell
only:
- master
- tags