mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2025-06-27 16:35:58 +00:00
examples/docker-compose: fix false positive
because of the -x the success string was always in the output and the workflow .forgejo/workflows/example-docker-compose.yml would always report success, even if it fails
This commit is contained in:
parent
bf11dac848
commit
9cb0716425
3 changed files with 10 additions and 8 deletions
|
@ -13,7 +13,7 @@ services:
|
|||
runner-register:
|
||||
condition: service_completed_successfully
|
||||
command: >-
|
||||
sh -xc '
|
||||
sh -ec '
|
||||
apk add --quiet git curl jq ;
|
||||
mkdir -p /srv/demo ;
|
||||
cd /srv/demo ;
|
||||
|
@ -29,10 +29,10 @@ services:
|
|||
sleep 5 ;
|
||||
done ;
|
||||
sha=`git rev-parse HEAD` ;
|
||||
while : ; do
|
||||
for delay in 1 1 1 1 2 5 5 10 10 10 15 ; do
|
||||
curl -sS -f http://forgejo:3000/api/v1/repos/root/test/commits/$$sha/status | jq --raw-output .state | tee status ;
|
||||
grep success status && break ;
|
||||
sleep 5 ;
|
||||
done ;
|
||||
echo DEMO WORKFLOW SUCCESS
|
||||
if grep success status ; then echo DEMO WORKFLOW SUCCESS && break ; fi ;
|
||||
if grep failure status ; then echo DEMO WORKFLOW FAILURE && break ; fi ;
|
||||
sleep $$delay ;
|
||||
done
|
||||
'
|
||||
|
|
|
@ -56,7 +56,7 @@ services:
|
|||
- /srv/runner-data:/data
|
||||
user: 0:0
|
||||
command: >-
|
||||
bash -c '
|
||||
bash -ec '
|
||||
while : ; do
|
||||
forgejo-runner create-runner-file --instance http://forgejo:3000 --name runner --secret {SHARED_SECRET} && break ;
|
||||
sleep 1 ;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue