mirror of https://github.com/R2Northstar/Northstar
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:
parent
4dccb376ec
commit
8fb1f315bb
|
@ -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"
|
||||
|
|
|
@ -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
|
Loading…
Reference in New Issue