-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_docker6.sh
executable file
·63 lines (54 loc) · 2.94 KB
/
build_docker6.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
#!/bin/sh
AMPACHEDIR=$PWD
BRANCH="all"
if [ ! $# -eq 0 ]; then
BRANCH=$1
fi
if [ $BRANCH = "master" ] || [ $BRANCH = "nosql" ] || [ $BRANCH = "all" ]; then
RELEASEVERSION=`grep -oP '[0-9]+\.[0-9]+\.[0-9]+' ./ampache-patch6/src/Config/Init/InitializationHandlerConfig.php`
status=$(curl --head --silent https://github.com/ampache/ampache/releases/download/${RELEASEVERSION}/ampache-${RELEASEVERSION}_all_php8.2.zip | head -n 1)
if echo "$status" | grep -q 404; then
read -p "Failed to find $RELEASEVERSION... Enter Ampache Version: " RELEASEVERSION
fi
fi
echo $RELEASEVERSION
if [ ! -d $AMPACHEDIR/docker ]; then
mkdir $AMPACHEDIR/docker
fi
# MASTER
if [ $BRANCH = "master" ] || [ $BRANCH = "all" ]; then
if [ ! -d $AMPACHEDIR/docker/ampache-docker/ ]; then
cd $AMPACHEDIR/docker && git clone -b master https://github.com/ampache/ampache-docker.git ampache-docker
fi
if [ ! -f $AMPACHEDIR/docker/ampache-docker/Dockerfile ]; then
rm -rf $AMPACHEDIR/docker/ampache-docker
cd $AMPACHEDIR/docker && git clone -b master https://github.com/ampache/ampache-docker.git ampache-docker
fi
cd $AMPACHEDIR/docker/ampache-docker/ && git checkout master && git reset --hard origin/master && git pull && docker buildx build --no-cache --platform linux/amd64,linux/arm64,linux/arm/v7 --build-arg VERSION=${RELEASEVERSION} -t ampache/ampache:6 -t ampache/ampache:${RELEASEVERSION} --push . &
fi
# NOSQL
if [ $BRANCH = "nosql" ] || [ $BRANCH = "all" ]; then
if [ ! -d $AMPACHEDIR/docker/ampache-docker-nosql/ ]; then
cd $AMPACHEDIR/docker && git clone -b nosql https://github.com/ampache/ampache-docker.git ampache-docker-nosql
fi
if [ ! -f $AMPACHEDIR/docker/ampache-docker-nosql/Dockerfile ]; then
rm -rf $AMPACHEDIR/docker/ampache-docker-nosql
cd $AMPACHEDIR/docker && git clone -b nosql https://github.com/ampache/ampache-docker.git ampache-docker-nosql
fi
cd $AMPACHEDIR/docker/ampache-docker-nosql/ && git checkout nosql && git reset --hard origin/nosql && git pull && docker buildx build --no-cache --platform linux/amd64,linux/arm64,linux/arm/v7 --build-arg VERSION=${RELEASEVERSION} -t ampache/ampache:nosql6 -t ampache/ampache:nosql${RELEASEVERSION} --push . &
fi
# DEVELOP
if [ $BRANCH = "develop" ]; then
if [ ! -d $AMPACHEDIR/docker/ampache-docker-develop/ ]; then
cd $AMPACHEDIR/docker && git clone -b develop https://github.com/ampache/ampache-docker.git ampache-docker-develop
fi
if [ ! -f $AMPACHEDIR/docker/ampache-docker-develop/Dockerfile ]; then
rm -rf $AMPACHEDIR/docker/ampache-docker-develop
cd $AMPACHEDIR/docker && git clone -b develop https://github.com/ampache/ampache-docker.git ampache-docker-develop
fi
cd $AMPACHEDIR/docker/ampache-docker-develop/ && git checkout develop && git reset --hard origin/develop && git pull && docker buildx build --no-cache --platform linux/amd64,linux/arm64,linux/arm/v7 -t ampache/ampache:develop --push . &
fi
# PREVIEW
# @see build_docker7.sh
# go home
cd $AMPACHEDIR