forked from PhotonVision/photonvision
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·25 lines (19 loc) · 834 Bytes
/
deploy.sh
File metadata and controls
executable file
·25 lines (19 loc) · 834 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
# # Configuration
REMOTE_USER="nvidia"
REMOTE_HOST="10.9.71.101"
REMOTE_REPO_PATH="/home/nvidia/Documents/photonvision"
REMOTE_NAME="orin"
BRANCH="main"
# Add the remote (if it doesn't exist)
if ! git remote get-url "$REMOTE_NAME" &> /dev/null; then
echo "Adding remote '$REMOTE_NAME'..."
git remote add "$REMOTE_NAME" "ssh://${REMOTE_USER}@${REMOTE_HOST}/${REMOTE_REPO_PATH}"
else
echo "Remote '$REMOTE_NAME' already exists."
fi
# Push the branch to the remote
echo "Pushing branch '$BRANCH' to '$REMOTE_NAME'..."
git push "$REMOTE_NAME" "$BRANCH" "-f"
ssh "$REMOTE_USER@$REMOTE_HOST" -f "export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-arm64 && cd $REMOTE_REPO_PATH && ./gradlew shadowJar && echo "nvidia" | sudo -S systemctl restart photonvision.service"
echo "✅ Deployment to $REMOTE_HOST complete."