Skip to content

Commit ab498f0

Browse files
feat: system runtimes in git
1 parent 3a2644b commit ab498f0

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

charts/cf-runtime/files/patch-runtime.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,19 @@ fi
1717
for runtime in /opt/codefresh/*.yaml; do
1818
if [[ -f $runtime ]]; then
1919
codefresh patch $patch_type -f $runtime
20+
ACCOUNTS=$(yq '.accounts' $runtime)
21+
RUNTIME_NAME_ENCODED=$(yq '.metadata.name' $runtime | jq -r @uri)
22+
if [[ -n $ACCOUNTS ]]; then
23+
PAYLOAD=$(echo $ACCOUNTS | jq '{accounts: .}')
24+
set +x
25+
curl -X PUT \
26+
-H "Content-Type: application/json" \
27+
-H "Authorization: $API_KEY" \
28+
-d "$PAYLOAD" \
29+
"$API_HOST/api/admin/runtime-environments/account/modify/$RUNTIME_NAME_ENCODED"
30+
else
31+
echo "No accounts to add"
32+
fi
2033
fi
2134
done
2235

0 commit comments

Comments
 (0)