-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-and-upload.sh
executable file
·63 lines (55 loc) · 1.71 KB
/
build-and-upload.sh
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
#!/usr/bin/env bash
set -ex
export DOCKER_BUILDKIT=1
function buildAndPush {
local version=$1
local imagename="alexswilliams/arm32v6-prometheus"
local fromline=$(grep -e '^FROM ' Dockerfile | tail -n -1 | sed 's/^FROM[ \t]*//' | sed 's#.*/##' | sed 's/:/-/' | sed 's/#.*//' | sed -E 's/ +.*//')
local latest="last-build"
if [ "$2" == "latest" ]; then latest="latest"; fi
docker build \
--platform=linux/arm/v6 \
--build-arg VERSION=${version} \
--build-arg BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
--build-arg VCS_REF=$(git rev-parse --short HEAD) \
--tag ${imagename}:${version} \
--tag ${imagename}:${version}-${fromline} \
--tag ${imagename}:${latest} \
--file Dockerfile \
.
docker push ${imagename}:${version}
docker push ${imagename}:${version}-${fromline}
docker push ${imagename}:${latest}
}
#buildAndPush "2.7.0"
#buildAndPush "2.7.1"
#buildAndPush "2.7.2"
#buildAndPush "2.8.0"
#buildAndPush "2.8.1"
#buildAndPush "2.9.0"
#buildAndPush "2.9.1"
#buildAndPush "2.9.2"
#buildAndPush "2.10.0"
#buildAndPush "2.11.0"
#buildAndPush "2.11.1"
#buildAndPush "2.11.2"
#buildAndPush "2.12.0"
#buildAndPush "2.13.0"
#buildAndPush "2.13.1"
#buildAndPush "2.14.0"
#buildAndPush "2.15.0"
#buildAndPush "2.15.1"
#buildAndPush "2.15.2"
#buildAndPush "2.16.0"
#buildAndPush "2.17.0"
#buildAndPush "2.17.1"
#buildAndPush "2.17.2"
#buildAndPush "2.18.0"
#buildAndPush "2.18.1"
#buildAndPush "2.18.2"
#buildAndPush "2.19.0"
#buildAndPush "2.19.1"
#buildAndPush "2.19.2"
buildAndPush "2.20.0"
buildAndPush "2.20.1" latest
curl -X POST "https://hooks.microbadger.com/images/alexswilliams/arm32v6-prometheus/H8lh7yTJah4vJT69Kjz-00QLM44="