Skip to content

Commit 9b0ba55

Browse files
feat(codefresh-run): add YAML argument (#552)
`YAML` argument behavior is inherited from the `--yaml` option of the CLI. Please check [CLI docs](https://codefresh-io.github.io/cli/pipelines/run-pipeline/#options) for details. Closes #CR-14668 Co-authored-by: Zhenya Tikhonov <[email protected]>
1 parent a27cbce commit 9b0ba55

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

graduated/codefresh-run/step.yaml

Lines changed: 12 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.4.0
6+
version: 1.5.0
77
isPublic: true
88
description: Run a Codefresh pipeline by ID or name and attach the created build logs.
99
sources:
@@ -171,7 +171,12 @@ spec:
171171
"description": "Skip the specifc steps defined.",
172172
"examples": ["step1", "step2"],
173173
"default": []
174-
}
174+
},
175+
"YAML": {
176+
"type": "string",
177+
"description": "Path to pipeline's yaml to be used as override for this execution.",
178+
"default": ""
179+
}
175180
}
176181
}
177182
delimiters:
@@ -224,11 +229,15 @@ spec:
224229
[[ range .Arguments.SKIP ]]
225230
[[- $cmd = (printf "%s --skip %s" $cmd .) -]]
226231
[[- end ]]
232+
[[ if .Arguments.YAML ]]
233+
[[- $cmd = (printf "%s --yaml %s" $cmd .Arguments.YAML) -]]
234+
[[- end -]]
227235
228236
[[/* Multiline string is required to support usage of 'colon' (:) character in the string. For example in the pipeline name. */]]
229237
[[/* Otherwise after template render there is a chance to have an object instead of a string. */]]
230238
- >-
231-
export BUILD_ID=$([[ $cmd ]]); if [ -z "$BUILD_ID" ]; then exit 1; fi
239+
CLI_OUTPUT=$([[ $cmd ]]) &&
240+
export BUILD_ID=$(echo "$CLI_OUTPUT" | tail -n 1); if [ -z "$BUILD_ID" ]; then exit 1; fi
232241
- cf_export first_CF_OUTPUT_URL="${{CF_URL}}/build/$BUILD_ID"
233242
- cf_export BUILD_ID
234243
[[- if eq .Arguments.DETACH false ]]

0 commit comments

Comments
 (0)