-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild_rpi.sh
executable file
·27 lines (18 loc) · 1.05 KB
/
build_rpi.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
#!/bin/bash
set -e
if [ $# -ne 1 ]; then
echo "Usage: $0 [raspberrypi ip]"
exit
fi
RPI="$1"
./sync_pi.sh "$RPI"
ssh -i ~/.ssh/raspi/"${git_github_identity:-id_rsa}" "pi@$RPI" bash << "EOF"
eval '. ~/.keychain/$HOSTNAME-sh'
cd SuperGreenLive2/server
/usr/local/go/bin/go build -ldflags "-X services.CommitDate=$(git --no-pager log -1 --format=%ct)" -o liveserver -v cmd/liveserver/main.go
GOARCH=arm64 /usr/local/go/bin/go build -ldflags "-X services.commitDate=$(git --no-pager log -1 --format=%ct)" -o liveserver_arm64 -v cmd/liveserver/main.go
GOARCH=arm GOOS=linux GOARM=7 /usr/local/go/bin/go build -ldflags "-X services.commitDate=$(git --no-pager log -1 --format=%ct)" -o liveserver_arm32 -v cmd/liveserver/main.go
EOF
scp -i ~/.ssh/raspi/"${git_github_identity:-id_rsa}" pi@"$RPI":SuperGreenLive2/server/liveserver_arm64 liveserver/
scp -i ~/.ssh/raspi/"${git_github_identity:-id_rsa}" pi@"$RPI":SuperGreenLive2/server/liveserver_arm32 liveserver/
scp -i ~/.ssh/raspi/"${git_github_identity:-id_rsa}" pi@"$RPI":SuperGreenLive2/server/liveserver liveserver/