mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-02-18 00:17:39 +01:00
ci: improve demo server update robustness with pipefail and version check
This commit is contained in:
11
.github/workflows/update-demo-server.yml
vendored
11
.github/workflows/update-demo-server.yml
vendored
@@ -118,8 +118,9 @@ jobs:
|
||||
if: steps.gate.outputs.skip != 'true' && steps.current.outputs.skip_current != 'true'
|
||||
run: |
|
||||
TAG="${{ steps.target.outputs.tag }}"
|
||||
# Use set -o pipefail to ensure curl errors aren't masked by bash
|
||||
ssh -i ~/.ssh/id_ed25519 ${{ secrets.DEMO_SERVER_USER }}@${{ secrets.DEMO_SERVER_HOST }} \
|
||||
"curl -fsSL https://raw.githubusercontent.com/rcourtman/Pulse/main/install.sh | sudo bash -s -- --version $TAG"
|
||||
"set -o pipefail && curl -fsSL https://raw.githubusercontent.com/rcourtman/Pulse/main/install.sh | sudo bash -s -- --version $TAG"
|
||||
|
||||
- name: Verify update
|
||||
if: steps.gate.outputs.skip != 'true' && steps.current.outputs.skip_current != 'true'
|
||||
@@ -133,6 +134,14 @@ jobs:
|
||||
|
||||
echo "Demo server is now running version: $VERSION"
|
||||
|
||||
# Verify version matches target
|
||||
TAG="${{ steps.target.outputs.tag }}"
|
||||
TAG_STRIPPED="${TAG#v}"
|
||||
if [ "$VERSION" != "$TAG" ] && [ "$VERSION" != "$TAG_STRIPPED" ]; then
|
||||
echo "::error::Version mismatch! Expected $TAG but got $VERSION"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Verify mock mode is active by authenticating and checking node count
|
||||
NODES=$(ssh -i ~/.ssh/id_ed25519 ${{ secrets.DEMO_SERVER_USER }}@${{ secrets.DEMO_SERVER_HOST }} \
|
||||
'curl -s -c /tmp/demo-cookies.txt http://localhost:7655/api/login -X POST -H "Content-Type: application/json" -d "{\"username\":\"demo\",\"password\":\"demo\"}" > /dev/null && curl -s -b /tmp/demo-cookies.txt http://localhost:7655/api/state | jq -r ".nodes | length" && rm -f /tmp/demo-cookies.txt')
|
||||
|
||||
Reference in New Issue
Block a user