Skip to content

Commit 98a4841

Browse files
committed
πŸ”§ Fix deployment scripts to follow working pattern without CI monitoring
- Remove CI monitoring step from both deploy scripts (no CI runs on main push) - Restore proper workflow: push β†’ determine version β†’ create tag β†’ monitor release - Based on original working script pattern adapted for stdio2sse and sidekick - Renumber steps after removing CI monitoring (Step 2) - Keep release workflow monitoring for deployment validation
1 parent 1bf8a54 commit 98a4841

File tree

2 files changed

+24
-118
lines changed

2 files changed

+24
-118
lines changed

β€Žscripts/deploy-sidekick.shβ€Ž

Lines changed: 14 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,12 @@ if [ $# -eq 1 ]; then
1616
echo "πŸ“Œ Manual version specified: $NEW_TAG"
1717
fi
1818

19-
# Step 1: Determine version tag first (before pushing)
19+
# Step 1: Push to main branch
20+
echo "πŸš€ Pushing to main branch..."
21+
git push origin main
22+
23+
# Step 2: Determine version tag (if not manually specified)
2024
if [ -z "$NEW_TAG" ]; then
21-
# No manual version provided, auto-increment
2225
echo "🏷️ Finding latest sidekick version tag..."
2326
LATEST_TAG=$(git tag -l "sidekick-v*" | sort -V | tail -n1)
2427
if [ -z "$LATEST_TAG" ]; then
@@ -36,7 +39,7 @@ if [ -z "$NEW_TAG" ]; then
3639
NEW_PATCH=$((PATCH + 1))
3740
NEW_TAG="sidekick-v${MAJOR}.${MINOR}.${NEW_PATCH}"
3841

39-
echo "πŸ“ˆ Will auto-increment to version: $NEW_TAG"
42+
echo "πŸ“ˆ New version: $NEW_TAG"
4043
else
4144
# Manual version provided, check if it already exists
4245
if git tag -l "$NEW_TAG" | grep -q "$NEW_TAG"; then
@@ -45,62 +48,12 @@ else
4548
fi
4649
fi
4750

48-
# Step 2: Check if there are any changes to push
49-
echo "πŸ” Checking for changes to push..."
50-
git fetch origin main
51-
if [ -z "$(git log origin/main..HEAD)" ]; then
52-
echo "⚠️ No new commits to push. Skipping to tag creation."
53-
SKIP_CI=true
54-
else
55-
# Step 3: Push to main branch
56-
echo "πŸš€ Pushing to main branch..."
57-
git push origin main
58-
SKIP_CI=false
59-
fi
60-
61-
# Step 4: Monitor CI workflow with optimized polling (if we pushed)
62-
if [ "$SKIP_CI" != "true" ]; then
63-
echo "⏳ Waiting for CI to start..."
64-
sleep 10
65-
66-
# Get the latest workflow run
67-
RUN_ID=$(gh run list --limit 1 --json databaseId --jq '.[0].databaseId')
68-
echo "πŸ“Š Monitoring CI run $RUN_ID..."
69-
70-
# Poll CI status every 15 seconds (optimized for ~2m20s runtime)
71-
MAX_WAIT=160 # seconds
72-
ELAPSED=0
73-
while [ $ELAPSED -lt $MAX_WAIT ]; do
74-
STATUS=$(gh run view $RUN_ID --json status --jq '.status')
75-
CONCLUSION=$(gh run view $RUN_ID --json conclusion --jq '.conclusion // "pending"')
76-
77-
if [ "$STATUS" = "completed" ]; then
78-
if [ "$CONCLUSION" = "success" ]; then
79-
echo "βœ… CI passed successfully!"
80-
break
81-
else
82-
echo "❌ CI failed with conclusion: $CONCLUSION"
83-
exit 1
84-
fi
85-
fi
86-
87-
echo "⏳ CI status: $STATUS (${ELAPSED}s elapsed)..."
88-
sleep 15
89-
ELAPSED=$((ELAPSED + 15))
90-
done
91-
92-
if [ $ELAPSED -ge $MAX_WAIT ]; then
93-
echo "⚠️ CI is taking longer than expected. Check manually: gh run view $RUN_ID"
94-
exit 1
95-
fi
96-
fi
97-
98-
# Step 5: Create and push new tag
51+
# Step 3: Create and push new tag
9952
echo "🏷️ Creating tag $NEW_TAG..."
10053
git tag $NEW_TAG -m "Release $NEW_TAG"
10154
git push origin $NEW_TAG
10255

103-
# Step 6: Monitor release workflow with optimized polling
56+
# Step 4: Monitor release workflow with optimized polling
10457
echo "⏳ Waiting for sidekick release workflow to start..."
10558
sleep 10
10659

@@ -114,25 +67,25 @@ ELAPSED=0
11467
while [ $ELAPSED -lt $MAX_RELEASE_WAIT ]; do
11568
STATUS=$(gh run view $RELEASE_RUN_ID --json status --jq '.status')
11669
CONCLUSION=$(gh run view $RELEASE_RUN_ID --json conclusion --jq '.conclusion // "pending"')
117-
70+
11871
if [ "$STATUS" = "completed" ]; then
11972
if [ "$CONCLUSION" = "success" ]; then
120-
echo "βœ… Sidekick release completed successfully!"
73+
echo "βœ… sidekick release completed successfully!"
12174
echo "πŸŽ‰ Version $NEW_TAG has been deployed!"
12275
echo "πŸ“¦ View release: https://github.com/eliezedeck/AIDevTools/releases/tag/$NEW_TAG"
12376
exit 0
12477
else
125-
echo "❌ Sidekick release failed with conclusion: $CONCLUSION"
78+
echo "❌ sidekick release failed with conclusion: $CONCLUSION"
12679
exit 1
12780
fi
12881
fi
129-
130-
echo "⏳ Sidekick release status: $STATUS (${ELAPSED}s elapsed)..."
82+
83+
echo "⏳ sidekick release status: $STATUS (${ELAPSED}s elapsed)..."
13184
sleep 10
13285
ELAPSED=$((ELAPSED + 10))
13386
done
13487

13588
if [ $ELAPSED -ge $MAX_RELEASE_WAIT ]; then
136-
echo "⚠️ Sidekick release is taking longer than expected. Check manually: gh run view $RELEASE_RUN_ID"
89+
echo "⚠️ sidekick release is taking longer than expected. Check manually: gh run view $RELEASE_RUN_ID"
13790
exit 1
13891
fi

β€Žscripts/deploy-stdio2sse.shβ€Ž

Lines changed: 10 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,12 @@ if [ $# -eq 1 ]; then
1616
echo "πŸ“Œ Manual version specified: $NEW_TAG"
1717
fi
1818

19-
# Step 1: Determine version tag first (before pushing)
19+
# Step 1: Push to main branch
20+
echo "πŸš€ Pushing to main branch..."
21+
git push origin main
22+
23+
# Step 2: Determine version tag (if not manually specified)
2024
if [ -z "$NEW_TAG" ]; then
21-
# No manual version provided, auto-increment
2225
echo "🏷️ Finding latest stdio2sse version tag..."
2326
LATEST_TAG=$(git tag -l "stdio2sse-v*" | sort -V | tail -n1)
2427
if [ -z "$LATEST_TAG" ]; then
@@ -36,7 +39,7 @@ if [ -z "$NEW_TAG" ]; then
3639
NEW_PATCH=$((PATCH + 1))
3740
NEW_TAG="stdio2sse-v${MAJOR}.${MINOR}.${NEW_PATCH}"
3841

39-
echo "πŸ“ˆ Will auto-increment to version: $NEW_TAG"
42+
echo "πŸ“ˆ New version: $NEW_TAG"
4043
else
4144
# Manual version provided, check if it already exists
4245
if git tag -l "$NEW_TAG" | grep -q "$NEW_TAG"; then
@@ -45,62 +48,12 @@ else
4548
fi
4649
fi
4750

48-
# Step 2: Check if there are any changes to push
49-
echo "πŸ” Checking for changes to push..."
50-
git fetch origin main
51-
if [ -z "$(git log origin/main..HEAD)" ]; then
52-
echo "⚠️ No new commits to push. Skipping to tag creation."
53-
SKIP_CI=true
54-
else
55-
# Step 3: Push to main branch
56-
echo "πŸš€ Pushing to main branch..."
57-
git push origin main
58-
SKIP_CI=false
59-
fi
60-
61-
# Step 4: Monitor CI workflow with optimized polling (if we pushed)
62-
if [ "$SKIP_CI" != "true" ]; then
63-
echo "⏳ Waiting for CI to start..."
64-
sleep 10
65-
66-
# Get the latest workflow run
67-
RUN_ID=$(gh run list --limit 1 --json databaseId --jq '.[0].databaseId')
68-
echo "πŸ“Š Monitoring CI run $RUN_ID..."
69-
70-
# Poll CI status every 15 seconds (optimized for ~2m20s runtime)
71-
MAX_WAIT=160 # seconds
72-
ELAPSED=0
73-
while [ $ELAPSED -lt $MAX_WAIT ]; do
74-
STATUS=$(gh run view $RUN_ID --json status --jq '.status')
75-
CONCLUSION=$(gh run view $RUN_ID --json conclusion --jq '.conclusion // "pending"')
76-
77-
if [ "$STATUS" = "completed" ]; then
78-
if [ "$CONCLUSION" = "success" ]; then
79-
echo "βœ… CI passed successfully!"
80-
break
81-
else
82-
echo "❌ CI failed with conclusion: $CONCLUSION"
83-
exit 1
84-
fi
85-
fi
86-
87-
echo "⏳ CI status: $STATUS (${ELAPSED}s elapsed)..."
88-
sleep 15
89-
ELAPSED=$((ELAPSED + 15))
90-
done
91-
92-
if [ $ELAPSED -ge $MAX_WAIT ]; then
93-
echo "⚠️ CI is taking longer than expected. Check manually: gh run view $RUN_ID"
94-
exit 1
95-
fi
96-
fi
97-
98-
# Step 5: Create and push new tag
51+
# Step 3: Create and push new tag
9952
echo "🏷️ Creating tag $NEW_TAG..."
10053
git tag $NEW_TAG -m "Release $NEW_TAG"
10154
git push origin $NEW_TAG
10255

103-
# Step 6: Monitor release workflow with optimized polling
56+
# Step 4: Monitor release workflow with optimized polling
10457
echo "⏳ Waiting for stdio2sse release workflow to start..."
10558
sleep 10
10659

@@ -114,7 +67,7 @@ ELAPSED=0
11467
while [ $ELAPSED -lt $MAX_RELEASE_WAIT ]; do
11568
STATUS=$(gh run view $RELEASE_RUN_ID --json status --jq '.status')
11669
CONCLUSION=$(gh run view $RELEASE_RUN_ID --json conclusion --jq '.conclusion // "pending"')
117-
70+
11871
if [ "$STATUS" = "completed" ]; then
11972
if [ "$CONCLUSION" = "success" ]; then
12073
echo "βœ… stdio2sse release completed successfully!"
@@ -126,7 +79,7 @@ while [ $ELAPSED -lt $MAX_RELEASE_WAIT ]; do
12679
exit 1
12780
fi
12881
fi
129-
82+
13083
echo "⏳ stdio2sse release status: $STATUS (${ELAPSED}s elapsed)..."
13184
sleep 10
13285
ELAPSED=$((ELAPSED + 10))

0 commit comments

Comments
Β (0)