Skip to content

Commit c8acdfb

Browse files
author
Zhenya Tikhonov
authored
feat(codefresh-run): add TERMINATE_ON_TIMEOUT argument (#529)
* feat(codefresh-run): add `TERMINATE_ON_TIMEOUT` argument If `TERMINATE_ON_TIMEOUT` is set to `true` and timeout set in `TIMEOUT_MINS` is expired, terminate child build. Closes #CR-16035 * fix(codefresh-run): change `TERMINATE_ON_TIMEOUT` description
1 parent f2011af commit c8acdfb

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

graduated/codefresh-run/step.yaml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ kind: step-type
33
metadata:
44
name: codefresh-run
55
title: Run a Codefresh pipeline
6-
version: 1.2.6
6+
version: 1.3.0
77
isPublic: true
88
description: Run a Codefresh pipeline by ID or name and attach the created build logs.
99
sources:
@@ -144,6 +144,11 @@ spec:
144144
"examples": ["33.3", "45"],
145145
"default": "45"
146146
},
147+
"TERMINATE_ON_TIMEOUT": {
148+
"type": "boolean",
149+
"description": "Terminate build if timeout reached",
150+
"default": false
151+
},
147152
"ONLY": {
148153
"type": "array",
149154
"items": {
@@ -228,6 +233,11 @@ spec:
228233
- echo "Retrieving logs for build $BUILD_ID"
229234
- codefresh logs -f --no-timestamps $BUILD_ID
230235
[[- end ]]
231-
- codefresh wait --verbose $BUILD_ID --timeout [[(printf "%s" .Arguments.TIMEOUT_MINS)]]
236+
- >-
237+
codefresh wait --verbose $BUILD_ID --timeout [[(printf "%s" .Arguments.TIMEOUT_MINS)]]
238+
[[- if eq .Arguments.TERMINATE_ON_TIMEOUT true ]]
239+
|| (echo "TERMINATE_ON_TIMEOUT was set to true, sending termination request" &&
240+
codefresh terminate $BUILD_ID &&
241+
exit 1)
242+
[[- end ]]
232243
[[- end -]]
233-

0 commit comments

Comments
 (0)