-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.disabled.yml
197 lines (187 loc) · 4.3 KB
/
.gitlab-ci.disabled.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
image: docker:latest
services:
- docker:dind
stages:
- build
variables:
DOCKER_DRIVER: overlay2
IMAGE_NAME: "ansible"
REPOSITORY: "${CI_PROJECT_NAMESPACE}/${IMAGE_NAME}"
.build_template: &build_definition
stage: build
before_script:
- echo $REGISTRY_PASSWORD | docker login -u $REGISTRY_USER --password-stdin
script:
- if [ ! "${CI_COMMIT_REF_NAME}" = 'debug' ]; then
VARIANT="${ANSIBLE_VERSION}-${OS}-${OS_VARIANT}";
else
VARIANT="debug-${OS}-${OS_VARIANT}";
fi
- if [ ! "${PPA}" = 'true' ]; then
BUILD_DIR="${OS}";
else
VARIANT="${VARIANT}-ppa"
BUILD_DIR="${OS}-ppa";
fi
- docker pull "${REPOSITORY}:${VARIANT}" || true;
- docker build
--cache-from "${REPOSITORY}:${VARIANT}"
-t "${REPOSITORY}:${VARIANT}"
--build-arg BASE_IMAGE="${BASE_IMAGE}"
"${BUILD_DIR}/"
- if [ "${ANSIBLE_VERSION_OS_DEFAULT}" = 'true' ]; then
docker tag "${REPOSITORY}:${VARIANT}" "${REPOSITORY}:"${ANSIBLE_VERSION}-${OS};
fi
- if [ "${OS_DEFAULT}" = 'true' ]; then
docker tag "${REPOSITORY}:${VARIANT}" "${REPOSITORY}:${OS}";
fi
- if [ "${LATEST}" = 'true' ]; then
docker tag "${REPOSITORY}:${VARIANT}" "${REPOSITORY}:latest";
fi
- docker images
- docker run -t --rm ${REPOSITORY}:${VARIANT} /bin/sh -c "ansible --version"
- if [ -n "${CI_COMMIT_TAG}" ] && [ ! "${DEBUG}" = 'true' ]; then
docker push "${REPOSITORY}";
fi
after_script:
- docker logout
# OS templates
.ubuntu_16.04_template:
variables:
OS: "ubuntu"
OS_VARIANT: "16.04"
BASE_IMAGE: "ubuntu:xenial-20190222"
.ubuntu_18.04_template:
variables:
OS: "ubuntu"
OS_VARIANT: "18.04"
BASE_IMAGE: "ubuntu:bionic-20190204"
.alpine_3.8_template:
variables:
OS: "alpine"
OS_VARIANT: "3.8"
BASE_IMAGE: "alpine:3.8"
.alpine_3.9_template:
variables:
OS: "alpine"
OS_VARIANT: "3.9"
BASE_IMAGE: "alpine:3.9"
.alpine_3.10_template:
variables:
OS: "alpine"
OS_VARIANT: "3.10"
BASE_IMAGE: "alpine:3.10"
.alpine_edge_template:
variables:
OS: "alpine"
OS_VARIANT: "edge"
BASE_IMAGE: "alpine:edge"
# Debug jobs
debug-ubuntu-16.04:
extends: .ubuntu_16.04_template
<<: *build_definition
only:
- debug
debug-ubuntu-18.04:
extends: .ubuntu_18.04_template
<<: *build_definition
only:
- debug
debug-ubuntu-16.04-ppa:
extends: .ubuntu_16.04_template
variables:
PPA: "true"
<<: *build_definition
only:
- debug
debug-ubuntu-18.04-ppa:
extends: .ubuntu_18.04_template
variables:
PPA: "true"
<<: *build_definition
only:
- debug
debug-alpine-3.8:
extends: .alpine_3.8_template
<<: *build_definition
only:
- debug
debug-alpine-3.9:
extends: .alpine_3.9_template
<<: *build_definition
only:
- debug
debug-alpine-3.10:
extends: .alpine_3.10_template
<<: *build_definition
only:
- debug
debug-alpine-edge:
extends: .alpine_edge_template
<<: *build_definition
only:
- debug
# Jobs
2.0.0.2-ubuntu-16.04:
extends: .ubuntu_16.04_template
variables:
ANSIBLE_VERSION: "2.0.0.2"
ANSIBLE_VERSION_OS_DEFAULT: "true"
OS_DEFAULT: "true"
LATEST: "true"
<<: *build_definition
except:
- debug
2.5.1-ubuntu-18.04:
extends: .ubuntu_18.04_template
variables:
ANSIBLE_VERSION: "2.5.1"
<<: *build_definition
except:
- debug
2.8.4-ubuntu-16.04-ppa:
extends: .ubuntu_16.04_template
variables:
PPA: "true"
ANSIBLE_VERSION: "2.8.4"
<<: *build_definition
except:
- debug
2.8.4-ubuntu-18.04-ppa:
extends: .ubuntu_18.04_template
variables:
PPA: "true"
ANSIBLE_VERSION: "2.8.4"
<<: *build_definition
except:
- debug
2.6.19-alpine-3.8:
extends: .alpine_3.8_template
variables:
ANSIBLE_VERSION: "2.6.19"
ANSIBLE_VERSION_OS_DEFAULT: "true"
OS_DEFAULT: "true"
<<: *build_definition
except:
- debug
2.7.13-alpine-3.9:
extends: .alpine_3.9_template
variables:
ANSIBLE_VERSION: "2.7.13"
<<: *build_definition
except:
- debug
2.8.4-alpine-3.10:
extends: .alpine_3.10_template
variables:
ANSIBLE_VERSION: "2.8.4"
<<: *build_definition
except:
- debug
2.8.4-alpine-edge:
extends: .alpine_edge_template
variables:
ANSIBLE_VERSION: "2.8.4"
<<: *build_definition
except:
- debug