Skip to content

Commit 318c508

Browse files
committed
Add bootstrap script to release
1 parent 50c9961 commit 318c508

File tree

2 files changed

+21
-11
lines changed

2 files changed

+21
-11
lines changed

.circleci/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ jobs:
3535
GOOS=linux GOARCH=arm packr build -o ../../release/ssl-remote-control_linux_arm
3636
GOOS=darwin GOARCH=amd64 packr build -o ../../release/ssl-remote-control_darwin_amd64
3737
GOOS=windows GOARCH=amd64 packr build -o ../../release/ssl-remote-control_windows_amd64.exe
38+
- run:
39+
command: |
40+
mkdir -p release
41+
tar czf release/bootstrap.tar.gz rpi
3842
- persist_to_workspace:
3943
root: .
4044
paths:
@@ -54,6 +58,7 @@ jobs:
5458
mv ssl-remote-control_linux_arm ssl-remote-control_${CIRCLE_TAG}_linux_arm
5559
mv ssl-remote-control_darwin_amd64 ssl-remote-control_${CIRCLE_TAG}_darwin_amd64
5660
mv ssl-remote-control_windows_amd64.exe ssl-remote-control_${CIRCLE_TAG}_windows_amd64.exe
61+
mv bootstrap.tar.gz bootstrap_${CIRCLE_TAG}.tar.gz
5762
- run:
5863
name: "Publish Release on GitHub"
5964
command: |

rpi/bootstrap.sh

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,7 @@ set -eu
44

55
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
66

7-
SRC_VERSION=0.2.1
8-
9-
function installRemoteControl() {
10-
systemctl --user stop ssl-remote-control.service
11-
mkdir -p ~/.local/bin/
12-
wget "https://github.com/RoboCup-SSL/ssl-remote-control/releases/download/v${SRC_VERSION}/ssl-remote-control_v${SRC_VERSION}_linux_arm" -O ~/.local/bin/ssl-remote-control
13-
chmod +x ~/.local/bin/ssl-remote-control
14-
systemctl --user start ssl-remote-control.service
15-
}
7+
SRC_VERSION=${1-}
168

179
function installService() {
1810
if [[ ! -f ~/.local/share/systemd/user/ssl-remote-control.service ]]; then
@@ -22,9 +14,21 @@ function installService() {
2214
fi
2315
}
2416

25-
function installBrowser() {
26-
sudo apt-get update
17+
function installRemoteControl() {
18+
sudo apt-get install --no-install-recommends -y curl jq
2719

20+
systemctl --user stop ssl-remote-control.service
21+
mkdir -p ~/.local/bin/
22+
if [[ -z "${SRC_VERSION}" ]]; then
23+
SRC_VERSION="$(curl -s https://api.github.com/repos/RoboCup-SSL/ssl-remote-control/releases/latest | jq -r '.tag_name')"
24+
fi
25+
echo "Installing version: ${SRC_VERSION}"
26+
wget "https://github.com/RoboCup-SSL/ssl-remote-control/releases/download/v${SRC_VERSION}/ssl-remote-control_v${SRC_VERSION}_linux_arm" -O ~/.local/bin/ssl-remote-control
27+
chmod +x ~/.local/bin/ssl-remote-control
28+
systemctl --user start ssl-remote-control.service
29+
}
30+
31+
function installBrowser() {
2832
# https://blog.r0b.io/post/minimal-rpi-kiosk/
2933
sudo apt-get install --no-install-recommends -y \
3034
xserver-xorg-video-all xserver-xorg-input-all xserver-xorg-core xinit x11-xserver-utils \
@@ -42,6 +46,7 @@ function installBrowser() {
4246
cp "${SCRIPT_DIR}/.bash_profile" ~/.bash_profile
4347
}
4448

49+
sudo apt-get update
4550
installService
4651
installRemoteControl
4752
installBrowser

0 commit comments

Comments
 (0)