-
-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy path.gitlab-ci.yml
56 lines (46 loc) · 1.92 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
image: alpine:3
stages:
- setup
- trigger
setup:
stage: setup
script:
- |
set -o errexit
apk add --update git
if [ ! -f blocklist.txt ]; then
wget -O blocklist.txt https://gitlab.com/tozd/docker/meteor/-/raw/master/blocklist.txt
fi
# Get all Meteor versions from GitHub.
versions="$(git ls-remote --tags https://github.com/meteor/meteor.git 'tags/release/METEOR@*' | cut -d '@' -f 2 | grep -v -)"
for version in ${versions} ; do
# Check if version is not on the blocklist and that it really exists
# and is downloadable by checking one architecture directly.
# See: https://github.com/meteor/meteor/issues/11856
# See: https://github.com/meteor/meteor/issues/11111
if ! grep -F -x -q "${version}" blocklist.txt && wget -q --spider "https://static.meteor.com/packages-bootstrap/${version}/meteor-bootstrap-os.linux.x86_64.tar.gz" ; then
echo "${version}" >> versions.txt
fi
done
wget -O .gitlab-ci-template-header.yml https://gitlab.com/tozd/docker/base/-/raw/master/.gitlab-ci-template-header.yml
wget -O .gitlab-ci-template-entry.yml https://gitlab.com/tozd/docker/base/-/raw/master/.gitlab-ci-template-entry.yml
cat .gitlab-ci-template-header.yml > generated-gitlab-ci.yml
for FILE in *.dockerfile ; do
while IFS= read -r VERSION ; do
TAG="$(basename "${FILE}" .dockerfile)-${VERSION}"
sed -e "s/__TAG__/${TAG}/g" -e "s/__FILE__/${FILE}/g" -e "s/__BUILD_ARGS__/--build-arg METEOR_VERSION=${VERSION}/g" .gitlab-ci-template-entry.yml >> generated-gitlab-ci.yml
done < versions.txt
done
artifacts:
paths:
- .gitlab-ci-template-header.yml
- .gitlab-ci-template-entry.yml
- generated-gitlab-ci.yml
- versions.txt
trigger:
stage: trigger
trigger:
strategy: depend
include:
- artifact: generated-gitlab-ci.yml
job: setup