File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,12 @@ function valid_ip {
4646 return 255
4747}
4848
49+ # https://docs.gitlab.com/runner/executors/custom/#build-failure
50+ function build_failure {
51+ exit " $BUILD_FAILURE_EXIT_CODE "
52+ }
53+
54+ # https://docs.gitlab.com/runner/executors/custom/#system-failure
4955function system_failure {
5056 if [ $? -eq 28 ]; then
5157 echo " Curl operation timed out. Exiting..."
Original file line number Diff line number Diff line change @@ -13,5 +13,8 @@ IFS=';' read -ra info <<< "$connection_info"
1313vm_ip=${info[0]}
1414vm_ssh_port=${info[1]}
1515
16+ # Treat failure of user script execution as build failure instead of system failure
17+ trap - ERR
18+
1619ssh -i " $ORKA_SSH_KEY_FILE " \
17- -o ServerAliveInterval=60 -o ServerAliveCountMax=60 " $ORKA_VM_USER @$vm_ip " -p " $vm_ssh_port " /bin/bash < " ${1} "
20+ -o ServerAliveInterval=60 -o ServerAliveCountMax=60 " $ORKA_VM_USER @$vm_ip " -p " $vm_ssh_port " /bin/bash < " ${1} " || build_failure
You can’t perform that action at this time.
0 commit comments