-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildscript.sh
executable file
·55 lines (54 loc) · 1.54 KB
/
buildscript.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
#!/bin/bash
while getopts ":i:d:m:p:r:t:" opt; do
case $opt in
i)
INC="$OPTARG"
;;
d)
EPOCH="$OPTARG"
;;
m)
MOUNT="$OPTARG"
;;
p)
BRANCH="$OPTARG"
;;
r)
TAG="$OPTARG"
;;
t)
TEST="$OPTARG"
;;
\?)
echo "Invalid option: -$opt" >&2
;;
:)
echo "Option -$opt requires an argument." >&2
;;
esac
done
if [ "$MOUNT" = "" ]; then
MOUNT="no"
fi
if [ "$BRANCH" = "" ]; then
BRANCH="debug"
fi
if [ "$TEST" = "" ]; then
TEST="no"
fi
echo "Increment: $INC"
echo "Override Source Epoch: $EPOCH"
echo "Mount /dev/mmcblk1: $MOUNT"
echo "Push to Branch: $BRANCH"
echo "Tag Release: $TAG"
echo "Run Tests: $TEST"
sleep 5
sudo apt install bc git-lfs screen snapd systemd-cryptsetup -y
git remote remove origin && git remote add origin git@Signal:0mniteck/Signal-Desktop-Mobian.git && git-lfs install
./increment.sh $INC
sudo screen -L -Logfile builder.log bash -c './re-run.sh public '$(($EPOCH))' '$MOUNT' '$TEST && mv builder.log builds/release/builder.log
echo "# Base Build System: $(uname -o) $(uname -r) $(uname -p) $(lsb_release -ds) $(lsb_release -cs) $(uname -v)" >> builds/release/release.sha512sum
awk '{a[i++]=$0}END{for(j=0;j<i-2;j++)print a[j];print a[i-1];print a[i-2]}' builds/release/release.sha512sum > tmp && mv tmp builds/release/release.sha512sum
ls -la builds/release/
./git.sh $BRANCH $TAG
cd ..