-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_python.sh
executable file
·79 lines (66 loc) · 2.66 KB
/
build_python.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/sh
AMPACHEDIR=$PWD
BRANCH="0"
if [ ! $# -eq 0 ]; then
BRANCH=$1
fi
COMPOSERPATH="/usr/local/bin/composer"
if [ ! -f $COMPOSERPATH ]; then
COMPOSERPATH="$AMPACHEDIR/docker/composer"
wget -q -O $COMPOSERPATH https://getcomposer.org/download/latest-stable/composer.phar
chmod +x $COMPOSERPATH
fi
sh ./setup-python.sh
cd $AMPACHEDIR/ampache-test/ampache && git reset --hard origin/patch6 && git pull && $COMPOSERPATH install
docker container stop ampache-test-ampachetest-1
cd $AMPACHEDIR/ampache-test && docker-compose up -d --build
# recreate the DB
#mysql -uroot -e "CREATE DATABASE ampachetest;"
echo "wake up ampache-test!"
sleep 7
mysql -uroot ampachetest < $AMPACHEDIR/ampache-test/docker/data/sql/ampache-test.sql
cd $AMPACHEDIR/python/
if [ ! $BRANCH -eq 0 ]; then
echo "RESET THE DATABASE"
mysql -uroot ampachetest < $AMPACHEDIR/ampache-test/docker/data/sql/ampache-test.sql
docker exec ampache-test-ampachetest-1 sh -c "php /var/www/html/bin/cli admin:updateDatabase -e"
echo "START $BRANCH"
python3 ./build_all6.py $BRANCH
echo "DONE $BRANCH"
else
echo "RESET THE DATABASE"
mysql -uroot ampachetest < $AMPACHEDIR/ampache-test/docker/data/sql/ampache-test.sql
docker exec ampache-test-ampachetest-1 sh -c "php /var/www/html/bin/cli admin:updateDatabase -e"
echo "START 6"
python3 ./build_all6.py 6
echo "DONE 6"
echo "RESET THE DATABASE"
mysql -uroot ampachetest < $AMPACHEDIR/ampache-test/docker/data/sql/ampache-test.sql
docker exec ampache-test-ampachetest-1 sh -c "php /var/www/html/bin/cli admin:updateDatabase -e"
echo "START 5"
python3 ./build_all6.py 5
echo "DONE 5"
echo "RESET THE DATABASE"
mysql -uroot ampachetest < $AMPACHEDIR/ampache-test/docker/data/sql/ampache-test.sql
docker exec ampache-test-ampachetest-1 sh -c "php /var/www/html/bin/cli admin:updateDatabase -e"
echo "START 4"
python3 ./build_all6.py 4
echo "DONE 4"
echo "RESET THE DATABASE"
mysql -uroot ampachetest < $AMPACHEDIR/ampache-test/docker/data/sql/ampache-test.sql
docker exec ampache-test-ampachetest-1 sh -c "php /var/www/html/bin/cli admin:updateDatabase -e"
echo "START 3"
python3 ./build_all6.py 3
echo "DONE 3"
echo "RESET THE DATABASE"
mysql -uroot ampachetest < $AMPACHEDIR/ampache-test/docker/data/sql/ampache-test.sql
docker exec ampache-test-ampachetest-1 sh -c "php /var/www/html/bin/cli admin:updateDatabase -e"
echo "START Subsonic"
python3 ./build_all6.py 16
echo "DONE Subsonic"
fi
echo "RESET THE DATABASE"
mysql -uroot ampachetest < $AMPACHEDIR/ampache-test/docker/data/sql/ampache-test.sql
docker exec ampache-test-ampachetest-1 sh -c "php /var/www/html/bin/cli admin:updateDatabase -e"
# go home
cd $AMPACHEDIR