forked from kerberos-io/kios
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mkrelease.sh
executable file
·45 lines (31 loc) · 1.96 KB
/
mkrelease.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
#!/bin/bash -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)";
echo "Compiling Kerberos.io for each board"
rm -rf $DIR/kios-*
rm -rf $DIR/.download/kerberosio-*
rm -rf $DIR/output/raspberrypi/build/kerberosio-*
rm -rf $DIR/output/raspberrypi2/build/kerberosio-*
rm -rf $DIR/output/raspberrypi3/build/kerberosio-*
$DIR/build.sh all # should be all..
$DIR/build.sh all mkrelease
echo "Creating Kerberos.io releases per board"
mkdir -p $DIR/releases
DATE=$(date +%Y%m%d)
echo "Preparing release for Raspberry Pi board"
mkdir -p $DIR/releases/rpi/$DATE
cp $DIR/kios-raspberrypi-* $DIR/releases/rpi/$DATE
for file in $DIR/output/raspberrypi/build/kerberosio-machinery*/kerberosio*; do cp -v -- "$file" "$DIR/releases/rpi/$DATE/rpi1-machinery-${file##*/}"; done
cd $DIR/output/raspberrypi/target/var/www/web && sed -i 's/\/data\/machinery\/config/\/\etc\/opt\/kerberosio\/config/g' config/app.php && tar czf $DIR/releases/rpi/$DATE/web.tar.gz .
echo "Preparing release for Raspberry Pi2 board"
mkdir -p $DIR/releases/rpi2/$DATE
cp $DIR/kios-raspberrypi2-* $DIR/releases/rpi2/$DATE
for file in $DIR/output/raspberrypi2/build/kerberosio-machinery*/kerberosio*; do cp -v -- "$file" "$DIR/releases/rpi2/$DATE/rpi2-machinery-${file##*/}"; done
cd $DIR/output/raspberrypi2/target/var/www/web && sed -i 's/\/data\/machinery\/config/\/\etc\/opt\/kerberosio\/config/g' config/app.php && tar czf $DIR/releases/rpi2/$DATE/web.tar.gz .
echo "Preparing release for Raspberry Pi3 board"
mkdir -p $DIR/releases/rpi3/$DATE
cp $DIR/kios-raspberrypi3-* $DIR/releases/rpi3/$DATE
for file in $DIR/output/raspberrypi3/build/kerberosio-machinery*/kerberosio*; do cp -v -- "$file" "$DIR/releases/rpi3/$DATE/rpi3-machinery-${file##*/}"; done
cd $DIR/output/raspberrypi3/target/var/www/web && sed -i 's/\/data\/machinery\/config/\/\etc\/opt\/kerberosio\/config/g' config/app.php && tar czf $DIR/releases/rpi3/$DATE/web.tar.gz .
echo "Uploading last release to Github (cedricve/kios)"
cd $DIR
python uploadrelease.py