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.
This commit is contained in:
GeckoEidechse 2023-11-02 11:51:52 +01:00 committed by GitHub
parent 4dccb376ec
commit 8fb1f315bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 0 deletions

View File

@ -20,6 +20,10 @@ jobs:
build-northstar:
runs-on: ubuntu-20.04
steps:
- name: Wait for launcher release build to be ready
timeout-minutes: 30 # Only wait for 30 minutes. If we take longer, something probably broke
run:
bash wait_dl.sh
- name: Download compiled launcher
run:
wget "https://github.com/R2Northstar/NorthstarLauncher/releases/download/${{ env.NORTHSTAR_VERSION }}/northstar-launcher.zip"

26
wait_for_launcher_dl.sh Executable file
View File

@ -0,0 +1,26 @@
#!/bin/bash
# Check if contains command line arg
if [ -z "$1" ]; then
echo "Missing command-line argument."
exit 1
fi
url="https://github.com/R2Northstar/NorthstarLauncher/releases/tag/$1"
wait_time_seconds=60
# Loop until the response code changes
while true; do
response=$(curl --silent --output /dev/null --write-out "%{http_code}" $url)
if [ $response -ne 200 ]; then
echo "Response is not 200. Retrying in $wait_time_seconds seconds."
sleep $wait_time_seconds
else
echo "Site is accessible with response code $response."
break
fi
done
# 10 second sleep just in case we hit some weird race condition
# where files are still being uploaded but release is done
sleep 10