Skip to content

Commit 8fb1f31

Browse files
Add step to wait for launcher files to be ready (#576)
Adds a small bash script and calls it in CI to block the CI from progressing until the launcher release files are uploaded.
1 parent 4dccb37 commit 8fb1f31

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

.github/workflows/build.yml

+4
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ jobs:
2020
build-northstar:
2121
runs-on: ubuntu-20.04
2222
steps:
23+
- name: Wait for launcher release build to be ready
24+
timeout-minutes: 30 # Only wait for 30 minutes. If we take longer, something probably broke
25+
run:
26+
bash wait_dl.sh
2327
- name: Download compiled launcher
2428
run:
2529
wget "https://github.com/R2Northstar/NorthstarLauncher/releases/download/${{ env.NORTHSTAR_VERSION }}/northstar-launcher.zip"

wait_for_launcher_dl.sh

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
3+
# Check if contains command line arg
4+
if [ -z "$1" ]; then
5+
echo "Missing command-line argument."
6+
exit 1
7+
fi
8+
9+
url="https://github.com/R2Northstar/NorthstarLauncher/releases/tag/$1"
10+
wait_time_seconds=60
11+
12+
# Loop until the response code changes
13+
while true; do
14+
response=$(curl --silent --output /dev/null --write-out "%{http_code}" $url)
15+
if [ $response -ne 200 ]; then
16+
echo "Response is not 200. Retrying in $wait_time_seconds seconds."
17+
sleep $wait_time_seconds
18+
else
19+
echo "Site is accessible with response code $response."
20+
break
21+
fi
22+
done
23+
24+
# 10 second sleep just in case we hit some weird race condition
25+
# where files are still being uploaded but release is done
26+
sleep 10

0 commit comments

Comments
 (0)