Skip to content
Draft
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
9 changes: 6 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.6.0
version: 1.6.1
isPublic: true
description: Run a Codefresh pipeline by ID or name and attach the created build logs.
sources:
Expand Down Expand Up @@ -248,8 +248,11 @@ spec:
[[/* 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. */]]
- >-
CLI_OUTPUT=$([[ $cmd ]]) &&
export BUILD_ID=$(echo "$CLI_OUTPUT" | tail -n 1); if [ -z "$BUILD_ID" ]; then exit 1; fi
CLI_OUTPUT=$([[ $cmd ]] 2>&1); CLI_EXIT_CODE=$?;
echo "$CLI_OUTPUT";
export BUILD_ID=$(echo "$CLI_OUTPUT" | tail -n 1);
if [ "$CLI_EXIT_CODE" -ne 0 ]; then echo "codefresh-run: the Codefresh CLI exited with code $CLI_EXIT_CODE, see the output above."; exit "$CLI_EXIT_CODE"; fi;
if [ -z "$BUILD_ID" ]; then echo "codefresh-run: the Codefresh CLI succeeded but returned no build id, so no child build was created. This is expected when the parent build is already terminating; run the CLI in a freestyle step if the step must survive termination."; 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
Loading