forked from realies/soulseek-docker
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sh
executable file
·50 lines (39 loc) · 1.23 KB
/
build.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
#!/bin/sh
usage() {
echo "Usage: $0 <target> [push-user]"
echo "<target> can be 'latest', 'testing', or a specific target version, e.g. '3.2.9'"
echo "[push-user] optionally, the user for the hub and try to perform a push"
exit 1
}
if [ -z "$1" ]
then
echo "No target supplied"
usage
fi
case "$1" in
'latest')
URL='https://github.com/nicotine-plus/nicotine-plus/releases/latest/download/debian-package.zip'
;;
'testing')
URL='https://nightly.link/nicotine-plus/nicotine-plus/workflows/packaging/master/debian-package.zip'
;;
*)
URL="https://github.com/nicotine-plus/nicotine-plus/releases/download/$1/debian-package.zip"
;;
esac
echo "Download package from: $URL"
rm debian-package.zip
curl -fL# "$URL" -o debian-package.zip
TAG=$1 docker-compose build --progress plain
if [ ! -z "$2" ]
then
IMAGE=nicotine-docker
IMAGE_W_TAG="${IMAGE}:$1"
IMAGE_W_USR_TAG="$2/${IMAGE_W_TAG}"
echo "#------------------------------"
echo "docker tag ${IMAGE_W_TAG} ${IMAGE_W_USR_TAG}"
docker tag ${IMAGE_W_TAG} ${IMAGE_W_USR_TAG}
echo "#------------------------------"
echo "docker push ${IMAGE_W_USR_TAG}"
docker push ${IMAGE_W_USR_TAG}
fi