forked from tarantool/cartridge-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
200 lines (182 loc) · 4.4 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
192
193
194
195
196
197
198
199
200
stages:
- prebuild
- test
- publish
- pack
- deploy
default:
image: centos:8
variables:
BUNDLE_VERSION: 1.10.3-68-g618f48d
PACKAGE_TARGETS: |
OS=el DIST=6
OS=el DIST=7
OS=el DIST=8
OS=fedora DIST=29
OS=fedora DIST=30
OS=ubuntu DIST=trusty
OS=ubuntu DIST=xenial
OS=ubuntu DIST=bionic
OS=debian DIST=jessie
OS=debian DIST=stretch
OS=debian DIST=buster
PACKAGECLOUD_REPOS: |
1_10
2x
2_2
.dind:
tags:
- molecule-dind
services:
- name: docker:dind
alias: localhost
image: docker
variables:
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ''
DOCKER_HOST: tcp://docker:2375/
prebuild:
extends: .dind
stage: prebuild
only:
changes:
- Dockerfile
- wrapdocker
- .gitlab-ci.yml
before_script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com
script:
- docker pull $CI_REGISTRY_IMAGE || true
- docker build
--cache-from $CI_REGISTRY_IMAGE
--tag $CI_REGISTRY_IMAGE
.
- docker push $CI_REGISTRY_IMAGE
after_script:
- docker logout registry.gitlab.com
include:
remote: https://tarantool.github.io/rocks.tarantool.org/helpers/gitlab-publish-rockspec.yml
.publish-rockspec: &publish-rockspec
tags:
- docker
- mcs
publish-scm-1-rockspec:
<<: *publish-rockspec
publish-tagged-rockspec:
<<: *publish-rockspec
.test_template:
stage: test
extends: .dind
image: $CI_REGISTRY_IMAGE
variables:
TARANTOOL_DOCKER_BUILD_ARGS: --cache-from cache-image
script:
- make lint test
test_enterprise-1.10:
extends: .test_template
cache:
key: $BUNDLE_VERSION
paths:
- tmp/sdk-1.10
- tmp/cache-image.tar
variables:
TARANTOOL_DOWNLOAD_TOKEN: $DOWNLOAD_TOKEN
CACHE_IMAGE_TARGET: cache-base
before_script:
- docker info
- make tmp/sdk-1.10
- source tmp/sdk-1.10/env.sh
- tarantool -V
- make ci_prepare
- make tmp/cache-image.tar
- docker load -i tmp/cache-image.tar
.test_opensource:
extends: .test_template
cache:
key: ${TARANTOOL_VERSION}
paths:
- tmp/cache-image.tar
before_script:
- docker info
- curl -s https://packagecloud.io/install/repositories/tarantool/$TARANTOOL_VERSION/script.rpm.sh | bash
- yum -y install tarantool tarantool-devel
- tarantool -V
- make ci_prepare
- make tmp/cache-image.tar
- docker load -i tmp/cache-image.tar
test_opensource-1.10:
extends: .test_opensource
variables:
TARANTOOL_VERSION: '1_10'
CACHE_IMAGE_TARGET: cache-opensource-1.10
test_opensource-2.2:
extends: .test_opensource
variables:
TARANTOOL_VERSION: '2_2'
CACHE_IMAGE_TARGET: cache-opensource-2.2
.e2e-opensource-1.10:
stage: test
tags:
- shell
- vagrant
before_script:
- vagrant up
script:
- vagrant ssh centos < test/e2e/start-rpm.sh
- vagrant ssh centos < test/e2e/test-cluster.sh
- vagrant reload centos
- sleep 1
- vagrant ssh centos < test/e2e/test-cluster.sh
- vagrant ssh centos < test/e2e/cleanup.sh
- vagrant ssh ubuntu < test/e2e/start-deb.sh
- vagrant ssh ubuntu < test/e2e/test-cluster.sh
- vagrant reload ubuntu
- sleep 1
- vagrant ssh ubuntu < test/e2e/test-cluster.sh
- vagrant ssh ubuntu < test/e2e/cleanup.sh
after_script:
- vagrant halt
- vagrant destroy
pack:
stage: pack
when: manual
extends: .dind
image: docker:git
variables:
PRODUCT: cartridge-cli
before_script:
- git describe --long
- git clone https://github.com/packpack/packpack.git packpack
script:
- (set -ex;
echo "$PACKAGE_TARGETS" | while read -r vars; do (
[ -z "$vars" ] && exit;
export $vars;
BUILDDIR=`pwd`/build/$OS/$DIST packpack/packpack;
) done)
- ls -l build/**/*
artifacts:
expire_in: 12h
paths:
- build/
deploy:
stage: deploy
when: manual
tags:
- docker
image:
name: digitalocean/packagecloud
entrypoint: ['']
script:
- (set -ex;
echo "$PACKAGE_TARGETS" | while read -r vars; do (
[ -z "$vars" ] && exit;
export $vars;
for ext in deb rpm; do (
[ -z "$(ls build/$OS/$DIST/*.$ext 2> /dev/null)" ] && exit;
echo "$PACKAGECLOUD_REPOS" | while read -r repo; do (
[ -z "$repo" ] && exit;
package_cloud push $PACKAGECLOUD_USER/$repo/$OS/$DIST build/$OS/$DIST/*.$ext;
) done;
) done;
) done)