Refactor deploy-dashboard-to-lxc.sh to replace rsync with scp for file transfers and streamline template deployment: implement a loop for copying individual template files, enhancing deployment efficiency and reliability.
This commit is contained in:
@@ -18,14 +18,11 @@ fi
|
|||||||
echo "Deploying dashboard to $LXC ($REMOTE_DIR) ..."
|
echo "Deploying dashboard to $LXC ($REMOTE_DIR) ..."
|
||||||
ssh "$LXC" "mkdir -p $REMOTE_DIR/templates"
|
ssh "$LXC" "mkdir -p $REMOTE_DIR/templates"
|
||||||
|
|
||||||
rsync -avz \
|
scp -q "$DASHBOARD_DIR/app.py" "$DASHBOARD_DIR/cm4-dashboard.service" "$LXC:$REMOTE_DIR/"
|
||||||
"$DASHBOARD_DIR/app.py" \
|
|
||||||
"$DASHBOARD_DIR/cm4-dashboard.service" \
|
|
||||||
"$LXC:$REMOTE_DIR/"
|
|
||||||
|
|
||||||
rsync -avz \
|
for f in "$DASHBOARD_DIR"/templates/*; do
|
||||||
"$DASHBOARD_DIR/templates/" \
|
[[ -f "$f" ]] && scp -q "$f" "$LXC:$REMOTE_DIR/templates/"
|
||||||
"$LXC:$REMOTE_DIR/templates/"
|
done
|
||||||
|
|
||||||
echo "Restarting cm4-dashboard service ..."
|
echo "Restarting cm4-dashboard service ..."
|
||||||
ssh "$LXC" "systemctl restart cm4-dashboard && systemctl is-active --quiet cm4-dashboard && echo 'Dashboard restarted and running.'"
|
ssh "$LXC" "systemctl restart cm4-dashboard && systemctl is-active --quiet cm4-dashboard && echo 'Dashboard restarted and running.'"
|
||||||
|
|||||||
Reference in New Issue
Block a user