-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_ampache-squashed.sh
executable file
·47 lines (39 loc) · 1.88 KB
/
build_ampache-squashed.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
#!/bin/sh
RELEASEBRANCH="patch5"
AMPACHEDIR=$PWD
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
if [ ! -d $AMPACHEDIR/ampache-master ]; then
git clone -b $RELEASEBRANCH https://github.com/ampache/ampache.git ampache-master
fi
if [ ! -f $AMPACHEDIR/ampache-master/index.php ]; then
rm -rf $AMPACHEDIR/ampache-master
git clone -b $RELEASEBRANCH https://github.com/ampache/ampache.git ampache-master
fi
if [ ! -d $AMPACHEDIR/ampache-squashed ]; then
git clone -b squashed https://github.com/ampache/ampache.git ampache-squashed
fi
if [ ! -f $AMPACHEDIR/ampache-squashed/index.php ]; then
rm -rf $AMPACHEDIR/ampache-squashed
git clone -b squashed https://github.com/ampache/ampache.git ampache-squashed
fi
# force reset everything
cd $AMPACHEDIR/ampache-master && git fetch origin $RELEASEBRANCH && git checkout $RELEASEBRANCH && git reset --hard origin/$RELEASEBRANCH && git pull
rm -rf $AMPACHEDIR/ampache-squashed/public
# existing base folders
cp -rfv $AMPACHEDIR/ampache-master/bin/* $AMPACHEDIR/ampache-squashed/bin/
cp -rfv $AMPACHEDIR/ampache-master/config/* $AMPACHEDIR/ampache-squashed/config/
cp -rfv $AMPACHEDIR/ampache-master/docs/* $AMPACHEDIR/ampache-squashed/docs/
cp -rfv $AMPACHEDIR/ampache-master/locale/* $AMPACHEDIR/ampache-squashed/locale/
cp -rfv $AMPACHEDIR/ampache-master/resources/* $AMPACHEDIR/ampache-squashed/resources/
cp -rfv $AMPACHEDIR/ampache-master/src/* $AMPACHEDIR/ampache-squashed/src/
cp -rfv $AMPACHEDIR/ampache-master/tests/* $AMPACHEDIR/ampache-squashed/tests/
#copy public back over the top
cp -rfv $AMPACHEDIR/ampache-master/public/* $AMPACHEDIR/ampache-squashed/
cd $AMPACHEDIR
# regex the old strings from the public branch to the squashed branch
python3 ./squash-ampache.py