-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
237 lines (221 loc) · 6.47 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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
stages:
- build
- clean
.build:vagrant:ubunt-18.04-lts:
stage: build
script:
- packer version
- pushd vb-ubuntu-18.04-lts
- VBOX_VERSION=$(VBoxHeadless --version | head -n 1 | awk '{print $NF}' | cut -f1 -d'_')
- echo $VBOX_VERSION
- packer build -parallel-builds=1 --var disk_size=102400 --var virtualbox_version=$VBOX_VERSION --var headless=true box.json
tags:
- packer
only:
changes:
- "vb-ubuntu-18.04-lts/*"
except:
- triggers
.build:vagrant:nominatim:
stage: build
when: manual
#resource_group: packer
variables:
PACKER_LOG: 0
REGION: "TO_OVERWRITE_IN_CHILD_JOB"
REGION_DATA_URL: "TO_OVERWRITE_IN_CHILD_JOB"
script:
- packer version
- pushd vagrant-nominatim
- echo "REGION ${REGION}"
- echo "REGION_DATA_URL ${REGION_DATA_URL}"
- packer build -var "region=${REGION}" -var "region_data_url=${REGION_DATA_URL}" -var "skip_add=true" box.json
tags:
- packer
build:vagrant:nominatim-monaco:
extends: .build:vagrant:nominatim
variables:
REGION: monaco
REGION_DATA_URL: https://download.geofabrik.de/europe/monaco-latest.osm.pbf
build:vagrant:nominatim-poland:
extends: .build:vagrant:nominatim
variables:
REGION: poland
REGION_DATA_URL: https://download.geofabrik.de/europe/poland-latest.osm.pbf
build:vagrant:nominatim-britain-and-ireland:
extends: .build:vagrant:nominatim
variables:
REGION: britain-and-ireland
REGION_DATA_URL: https://download.geofabrik.de/europe/britain-and-ireland-latest.osm.pbf
build:docker:node20-google-chrome:
stage: build
script:
- packer version
- pushd node20-google-chrome
- DOCKER_TOKEN=$DOCKER_HUB_TOKEN packer build box.json
- GOOGLE_CHROME_VERSION=$(docker run --rm morawskim/node20-google-chrome google-chrome --version)
- echo 'google chrome version - ' $GOOGLE_CHROME_VERSION
- TAG=$(echo $GOOGLE_CHROME_VERSION | awk '{print $NF}' | cut -d'.' -f 1-2)
- echo 'TAG - ' $TAG
- DOCKER_TOKEN=$DOCKER_HUB_TOKEN packer build --var docker_tag=$TAG box-tag.json
- docker image rm morawskim/node20-google-chrome morawskim/node20-google-chrome:$TAG
tags:
- packer
only:
changes:
- "node20-google-chrome/*"
except:
- triggers
.build:docker:htrace.sh:
stage: build
script:
- cd htrace.sh
- VERSION=$(curl -sL https://api.github.com/repos/trimstray/htrace.sh/git/matching-refs/tags | jq '.[].ref' | cut -c13- | rev | cut -c2- | rev | sed -n '/^[[:digit:]]\.[[:digit:]]\.[[:digit:]]$/p' | sort -r --version-sort | head -1)
- git clone https://github.com/trimstray/htrace.sh.git
- cd htrace.sh
- echo 'Overwrite VERSION from tag, due to build error (https://github.com/trimstray/htrace.sh/pull/101) and lack of the new version'
- VERSION=$(git describe | cut -c2-)
- docker build --no-cache -t $NAME -f build/Dockerfile .
- cd ..
- rm -rf ./htrace.sh
- echo "VERSION '$VERSION'"
- DOCKER_TOKEN=$DOCKER_HUB_TOKEN packer build --var docker_tag=$VERSION box.json
variables:
NAME: htrace.sh
tags:
- packer
only:
changes:
- "htrace.sh/*"
except:
- triggers
build:docker:webgrind:
stage: build
script:
- packer version
- pushd webgrind
- VERSION=$(curl -sL https://api.github.com/repos/jokkedk/webgrind/releases/latest | jq -r '.tarball_url')
- TAG=$(basename $VERSION | cut -c2-)
- echo 'TAG - ' $TAG
- DOCKER_TOKEN=$DOCKER_HUB_TOKEN packer build --var docker_tag=$TAG box.json
tags:
- packer
only:
changes:
- "webgrind/*"
except:
- triggers
build:docker:swaks:
stage: build
script:
- packer version
- pushd swaks
- TAG=$(curl -sL https://api.github.com/repos/jetmore/swaks/releases/latest | jq -r .tag_name | cut -c 2-)
- echo 'TAG - ' $TAG
- DOCKER_TOKEN=$DOCKER_HUB_TOKEN packer build --var docker_tag=$TAG box.json
tags:
- packer
only:
changes:
- "swaks/*"
except:
- triggers
build:docker:csvsql-mysql:
stage: build
script:
- packer version
- pushd csvsql-mysql
- VERSION=$(curl -sL https://api.github.com/repos/wireservice/csvkit/git/matching-refs/tags | jq '.[].ref' | cut -c12- | rev | cut -c2- | rev | sed -n '/^[[:digit:]]\.[[:digit:]]\.[[:digit:]]$/p' | sort -r --version-sort | head -1)
- echo 'TAG - ' $VERSION
- >
if curl --silent -f --head -lL https://hub.docker.com/v2/repositories/morawskim/csvsql-mysql/tags/$VERSION/ > /dev/null; then
echo "Image already exists, so skip build and push"
else
DOCKER_TOKEN=$DOCKER_HUB_TOKEN packer build --var docker_tag=$VERSION box.json
fi
tags:
- packer
only:
changes:
- "csvsql-mysql/*"
except:
- triggers
build:docker:opensuse-tumbleweed-debug:
stage: build
script:
- packer version
- pushd opensuse-tumbleweed-debug
- DOCKER_TOKEN=$DOCKER_HUB_TOKEN packer build box.json
tags:
- packer
only:
changes:
- "opensuse-tumbleweed-debug/*"
except:
- triggers
build:docker:newrelic-fluent-bit-output:
stage: build
script:
- pushd newrelic-fluent-bit-output
- VERSION=$(curl -sL https://api.github.com/repos/newrelic/newrelic-fluent-bit-output/releases/latest | jq -r '.tag_name')
- TAG=$(basename $VERSION | cut -c2-)
- echo 'TAG - ' $TAG
- make build NEWRELIC_PLUGIN_VERSION=$TAG
- DOCKER_TOKEN=$DOCKER_HUB_TOKEN packer build --var docker_tag=$TAG box.json
tags:
- packer
only:
changes:
- "newrelic-fluent-bit-output/*"
except:
- triggers
build:docker:jsonplaceholder:
stage: build
script:
- pushd jsonplaceholder
- packer version
- git clone https://github.com/typicode/jsonplaceholder.git
- DOCKER_TOKEN=$DOCKER_HUB_TOKEN packer build box.json
tags:
- packer
only:
changes:
- "jsonplaceholder/*"
except:
- triggers
build:docker:lorem-space-backend:
stage: build
script:
- pushd lorem-space-backend
- packer version
- bash ./fetch-images.sh
- DOCKER_TOKEN=$DOCKER_HUB_TOKEN packer build box.json
tags:
- packer
only:
changes:
- "lorem-space-backend/*"
except:
- triggers
build:docker:restic:
stage: build
script:
- pushd restic-aws-backup
- make build
- TAG=$(date '+%Y%m%d')
- echo 'TAG - ' $TAG
- DOCKER_TOKEN=$DOCKER_HUB_TOKEN packer build --var docker_tag=$TAG box.json
tags:
- packer
only:
changes:
- "restic-aws-backup/*"
except:
- triggers
clean:
stage: clean
when: always
script:
- docker image prune --force
tags:
- packer