Skip to content
This repository was archived by the owner on Dec 2, 2020. It is now read-only.

Commit 7533174

Browse files
author
Rafal Witczak
committed
add target_url_path (similar to description_path)
1 parent e70eed3 commit 7533174

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

bin/out

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ eval $( jq -r '{
1010
"params_state": .params.state,
1111
"params_description": ( .params.description // "" ),
1212
"params_description_path": ( .params.description_path // "" ),
13-
"params_target_url": ( .params.target_url // "$ATC_EXTERNAL_URL/builds/$BUILD_ID" )
13+
"params_target_url": ( .params.target_url // ""),
14+
"params_target_url_path": ( .params.target_url_path // "" )
1415
} | to_entries[] | .key + "=" + @sh "\(.value)"' < /tmp/stdin )
1516

1617

@@ -46,10 +47,14 @@ fi
4647
# target_url
4748
#
4849

49-
target_url=""
50+
target_url_path="/tmp/target_url"
5051

51-
if [ -n "$params_target_url" ] ; then
52-
target_url=$( echo "$params_target_url" | buildtpl )
52+
if [[ -n "$params_target_url" ]] ; then
53+
echo "$params_target_url" > "$target_url_path"
54+
elif [[ -n "$params_target_url_path" ]] ; then
55+
cp "$params_target_url_path" "$target_url_path"
56+
else
57+
echo "$ATC_EXTERNAL_URL/builds/$BUILD_ID" > "$target_url_path"
5358
fi
5459

5560

@@ -59,7 +64,7 @@ fi
5964

6065
jq -c -n \
6166
--arg state "$params_state" \
62-
--arg target_url "$target_url" \
67+
--arg target_url "$( cat $target_url_path | buildtpl )" \
6368
--arg description "$( cat $description_path )" \
6469
--arg context "$source_context" \
6570
'{

0 commit comments

Comments
 (0)