Commit ada666b 1 parent e62aa73 commit ada666b Copy full SHA for ada666b
File tree 4 files changed +20
-21
lines changed
4 files changed +20
-21
lines changed Original file line number Diff line number Diff line change @@ -7,33 +7,33 @@ rem `if ERRORLEVEL N` means: error level is N or MORE
7
7
8
8
if %ERRORLEVEL% EQU 0 (
9
9
echo " Runner listener exit with 0 return code, stop the service, no retry needed."
10
+ exit /b 0
10
11
)
11
12
12
13
if %ERRORLEVEL% EQU 1 (
13
14
echo " Runner listener exit with terminated error, stop the service, no retry needed."
15
+ exit /b 0
14
16
)
15
17
16
18
if %ERRORLEVEL% EQU 2 (
17
19
echo " Runner listener exit with retryable error, re-launch runner in 5 seconds."
18
20
timeout /t 5 /nobreak > NUL
19
- goto : launch_listener
21
+ exit /b 1
20
22
)
21
23
22
24
if %ERRORLEVEL% EQU 3 (
25
+ rem Sleep 5 seconds to wait for the runner update process finish
23
26
echo " Runner listener exit because of updating, re-launch runner in 5 seconds"
24
27
timeout /t 5 /nobreak > NUL
28
+ exit /b 1
25
29
)
26
30
27
31
if %ERRORLEVEL% EQU 4 (
32
+ rem Sleep 5 seconds to wait for the ephemeral runner update process finish
28
33
echo " Runner listener exit because of updating, re-launch ephemeral runner in 5 seconds"
29
34
timeout /t 5 /nobreak > NUL
35
+ exit /b 1
30
36
)
31
37
32
- if %ERRORLEVEL% GEQ 5 (
33
- echo " Exiting with unknown error code: ${returnCode}"
34
- )
35
- if [%ERRORLEVEL% ]== [] (
36
- echo " Exiting with empty error code: ${returnCode}"
37
- )
38
-
39
- exit /b %ERRORLEVEL%
38
+ echo " Exiting after unknown error code: %ERRORLEVEL% "
39
+ exit /b 0
Original file line number Diff line number Diff line change @@ -30,26 +30,25 @@ bin/Runner.Listener run $*
30
30
returnCode=$?
31
31
if [[ $returnCode == 0 ]]; then
32
32
echo " Runner listener exit with 0 return code, stop the service, no retry needed."
33
- echo " 0 ORIG "
33
+ exit 0
34
34
elif [[ $returnCode == 1 ]]; then
35
35
echo " Runner listener exit with terminated error, stop the service, no retry needed."
36
- echo " 1 ORIG "
36
+ exit 0
37
37
elif [[ $returnCode == 2 ]]; then
38
38
echo " Runner listener exit with retryable error, re-launch runner in 5 seconds."
39
- echo " 2 ORIG"
40
39
safe_sleep
40
+ exit 1
41
41
elif [[ $returnCode == 3 ]]; then
42
42
# Sleep 5 seconds to wait for the runner update process finish
43
43
echo " Runner listener exit because of updating, re-launch runner in 5 seconds"
44
- echo " 3 ORIG"
45
44
safe_sleep
45
+ exit 1
46
46
elif [[ $returnCode == 4 ]]; then
47
47
# Sleep 5 seconds to wait for the ephemeral runner update process finish
48
48
echo " Runner listener exit because of updating, re-launch ephemeral runner in 5 seconds"
49
- echo " 4 ORIG"
50
49
safe_sleep
50
+ exit 1
51
51
else
52
52
echo " Exiting with unknown error code: ${returnCode} "
53
+ exit 0
53
54
fi
54
-
55
- exit $returnCode
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ call "%~dp0bin\run-helper.cmd" %*
24
24
rem using `if %ERRORLEVEL% EQU N` insterad of `if ERRORLEVEL N`
25
25
rem `if ERRORLEVEL N` means: error level is N or MORE
26
26
27
- if %ERRORLEVEL% GEQ 2 (
27
+ if %ERRORLEVEL% EQU 1 (
28
28
echo " Restart runner after it exited with return code '%ERRORLEVEL% '"
29
29
goto :launch_helper
30
30
) else (
Original file line number Diff line number Diff line change @@ -15,10 +15,10 @@ while :;
15
15
do
16
16
" $DIR " /bin/run-helper.sh $*
17
17
returnCode=$?
18
- if [[ $returnCode -ge 2 ]]; then
19
- echo " Restart runner after it exited with return code ' ${returnCode} ' "
18
+ if [[ $returnCode -e 1 ]]; then
19
+ echo " Restart runner after it updated... "
20
20
else
21
- echo " Exit runner after it exited with return code ' ${returnCode} ' "
22
- exit $returnCode
21
+ echo " Exiting runner... "
22
+ exit 0
23
23
fi
24
24
done
You can’t perform that action at this time.
0 commit comments