-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·60 lines (50 loc) · 1.44 KB
/
deploy.sh
File metadata and controls
executable file
·60 lines (50 loc) · 1.44 KB
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
56
57
58
59
60
#!/usr/bin/env bash
set -euo pipefail
# Deploy IBSR binary to remote machine via SSH
# Usage: ./deploy.sh --arch <arm64|x86_64> <user@host>
#
# Example: ./deploy.sh --arch arm64 root@192.168.64.2
ARCH=""
TARGET=""
while [[ $# -gt 0 ]]; do
case $1 in
--arch)
ARCH="$2"
shift 2
;;
-h|--help)
echo "Usage: ./deploy.sh --arch <arm64|x86_64> <user@host>"
echo ""
echo "Options:"
echo " --arch Target architecture: arm64 or x86_64"
echo ""
echo "Example: ./deploy.sh --arch arm64 root@192.168.64.2"
exit 0
;;
*)
TARGET="$1"
shift
;;
esac
done
if [[ -z "$ARCH" ]]; then
echo "Error: --arch is required"
echo "Usage: ./deploy.sh --arch <arm64|x86_64> <user@host>"
exit 1
fi
if [[ -z "$TARGET" ]]; then
echo "Error: target host is required"
echo "Usage: ./deploy.sh --arch <arm64|x86_64> <user@host>"
exit 1
fi
BINARY="./dist/ibsr-$ARCH"
if [[ ! -f "$BINARY" ]]; then
echo "Error: Binary not found at $BINARY"
echo "Run ./build.sh --arch $ARCH first"
exit 1
fi
echo "Deploying IBSR ($ARCH) to $TARGET..."
# Copy to temp location, then use sudo to install
scp "$BINARY" "$TARGET:/tmp/ibsr"
ssh -t "$TARGET" "sudo mv /tmp/ibsr /usr/local/bin/ibsr && sudo chmod +x /usr/local/bin/ibsr"
echo "Done. Binary installed at /usr/local/bin/ibsr"