forked from tarantool/cartridge-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
191 lines (166 loc) · 3.54 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
stages:
- test
- pack
- publish
default:
image: centos:8
variables:
BUNDLE_VERSION: 2.3.1-20-ga4330d8
.dind:
tags:
- dind
- openstack
services:
- name: docker:dind
alias: localhost
command: ["--mtu=1300"]
image: docker
variables:
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ''
DOCKER_HOST: tcp://docker:2375/
DOCKER_BUILDKIT: 1
.prebuild-template:
extends: .dind
stage: .pre
only:
changes:
- Dockerfile
- Dockerfile.releaser
- wrapdocker
- .gitlab-ci.yml
- test/requirements.txt
before_script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com
script:
- docker pull $IMAGE || true
- docker build
--cache-from $IMAGE
--tag $IMAGE
-f $DOCKERFILE
${BUILD_ARGS}
.
- docker push $IMAGE
after_script:
- docker logout registry.gitlab.com
prebuild-test:
extends: .prebuild-template
variables:
IMAGE: ${CI_REGISTRY_IMAGE}:go
DOCKERFILE: Dockerfile
prebuild-releaser:
extends: .prebuild-template
variables:
IMAGE: ${CI_REGISTRY_IMAGE}:releaser
DOCKERFILE: Dockerfile.releaser
BUILD_ARGS: --build-arg PACKAGECLOUD_TOKEN=$PACKAGECLOUD_TOKEN
.test_template:
stage: test
extends: .dind
image: ${CI_REGISTRY_IMAGE}:go
script:
- docker info
- rpm --version
- tarantool -V
- export CARTRIDGE_TEMPDIR=`pwd`
- mage lint
- mage unit
- mage integration
- mage testExamples
- mage e2e
test_enterprise-2.3:
extends: .test_template
cache:
key: $BUNDLE_VERSION
paths:
- tmp/tarantool-enterprise
variables:
TARANTOOL_SDK_PATH: tmp/tarantool-enterprise
before_script:
- mage sdk
- source tmp/tarantool-enterprise/env.sh
- export TARANTOOL_SDK_PATH=`realpath $TARANTOOL_SDK_PATH`
.test_opensource:
extends: .test_template
before_script:
- curl -L https://tarantool.io/installer.sh | VER=${TARANTOOL_VERSION} bash
- yum install -y tarantool-devel
test_opensource-1.10:
extends: .test_opensource
variables:
TARANTOOL_VERSION: '1.10'
test_opensource-2.3:
extends: .test_opensource
variables:
TARANTOOL_VERSION: '2.3'
.pack:
stage: pack
extends: .dind
image: ${CI_REGISTRY_IMAGE}:releaser
script:
- goreleaser release --rm-dist ${GORELEASER_FLAGS}
artifacts:
expire_in: 12h
paths:
- dist/
pack-tags:
extends: .pack
only:
- tags
pack-master:
extends: .pack
variables:
GORELEASER_FLAGS: --skip-validate --skip-publish
only:
- master
pack-manual:
extends: .pack
variables:
GORELEASER_FLAGS: --skip-validate --skip-publish
when: manual
.publish-s3:
stage: publish
extends: .dind
image: ${CI_REGISTRY_IMAGE}:releaser
before_script:
- gpg --import <(echo "$GPG_KEY")
script:
- mage publishS3
artifacts:
expire_in: 12h
paths:
- dist/
publish-s3-tags:
extends: .publish-s3
variables:
S3_FOLDER: release/modules
only:
- tags
publish-s3-manual:
extends: .publish-s3
variables:
S3_FOLDER: check/modules
when: manual
.publish-pkgcloud:
stage: publish
extends: .dind
image: ${CI_REGISTRY_IMAGE}:releaser
script:
- mage publishPkgcloud
artifacts:
expire_in: 12h
paths:
- dist/
publish-pkgcloud-tags:
extends: .publish-pkgcloud
variables:
PACKAGECLOUD_USER: tarantool
only:
- tags
publish-pkgcloud-manual:
extends: .publish-pkgcloud
variables:
PACKAGECLOUD_USER: tarantool-test
when: manual
before_script:
- export PACKAGECLOUD_TOKEN=$PACKAGECLOUD_TEST_TOKEN