-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·42 lines (32 loc) · 1.05 KB
/
build.sh
File metadata and controls
executable file
·42 lines (32 loc) · 1.05 KB
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
#!/usr/bin/env bash
set -x
version=$1
arch="386 amd64 arm arm64 ppc64 ppc64le"
repo="djtm/syncthing-scratch"
images=""
extraversion=":latest"
[ "$2" ] && extraversion=":$2"
if [ -z "$1" ]; then
echo "Detecting last release and tagging as :latest as no version was given: e.g. $0 0.12.24 beta"
version=$(curl --silent "https://api.github.com/repos/syncthing/syncthing/releases/latest" | jq -r .tag_name | tr -d 'v')
fi
# gpg: key 00654A3E: public key "Syncthing Release Management <release@syncthing.net>" imported
export SYNCTHING_GPG_KEY=37C84554E7E0A261E4F76E1ED26E6ED000654A3E
gpg --keyserver pool.sks-keyservers.net --recv-keys "${SYNCTHING_GPG_KEY}"
rm error.log
# prepare arch version
for i in $arch; do
sh prepare.sh $i $version
versioned="${repo}-${i}:${version}"
default="${repo}-${i}${extraversion}"
docker build -t "$versioned" .
docker build -t "$default" .
docker push "$versioned"
docker push "$default"
#collect images names
images="$images $versioned $default"
done
#cleanup
docker rmi -f ${images}
rm syncthing
[ -e error.log ] && cat error.log