Skip to content

feat(codefresh-run): add YAML argument #552

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
1 commit merged into from
Feb 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions graduated/codefresh-run/step.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: step-type
metadata:
name: codefresh-run
title: Run a Codefresh pipeline
version: 1.4.0
version: 1.5.0
isPublic: true
description: Run a Codefresh pipeline by ID or name and attach the created build logs.
sources:
Expand Down Expand Up @@ -171,7 +171,12 @@ spec:
"description": "Skip the specifc steps defined.",
"examples": ["step1", "step2"],
"default": []
}
},
"YAML": {
"type": "string",
"description": "Path to pipeline's yaml to be used as override for this execution.",
"default": ""
}
}
}
delimiters:
Expand Down Expand Up @@ -224,11 +229,15 @@ spec:
[[ range .Arguments.SKIP ]]
[[- $cmd = (printf "%s --skip %s" $cmd .) -]]
[[- end ]]
[[ if .Arguments.YAML ]]
[[- $cmd = (printf "%s --yaml %s" $cmd .Arguments.YAML) -]]
[[- end -]]

[[/* Multiline string is required to support usage of 'colon' (:) character in the string. For example in the pipeline name. */]]
[[/* Otherwise after template render there is a chance to have an object instead of a string. */]]
- >-
export BUILD_ID=$([[ $cmd ]]); if [ -z "$BUILD_ID" ]; then exit 1; fi
CLI_OUTPUT=$([[ $cmd ]]) &&
export BUILD_ID=$(echo "$CLI_OUTPUT" | tail -n 1); if [ -z "$BUILD_ID" ]; then exit 1; fi
- cf_export first_CF_OUTPUT_URL="${{CF_URL}}/build/$BUILD_ID"
- cf_export BUILD_ID
[[- if eq .Arguments.DETACH false ]]
Expand Down