fix: move stackit CLI setup up
This commit is contained in:
parent
8346b792ca
commit
c3dc64c747
1 changed files with 12 additions and 10 deletions
22
action.yml
22
action.yml
|
|
@ -89,6 +89,18 @@ runs:
|
|||
;;
|
||||
esac
|
||||
|
||||
echo "::group::Authenticating with service account and triggering operation"
|
||||
|
||||
STACKIT_ACCESS_TOKEN="$(stackit auth activate-service-account --only-print-access-token)"
|
||||
export STACKIT_ACCESS_TOKEN
|
||||
|
||||
STACKIT_PROJECT_ID="$INPUT_PROJECT_ID"
|
||||
export STACKIT_PROJECT_ID
|
||||
|
||||
stackit curl --fail -X POST "https://ske.api.stackit.cloud/v2/projects/$INPUT_PROJECT_ID/regions/$INPUT_REGION/clusters/$INPUT_CLUSTER_NAME/$ENDPOINT"
|
||||
|
||||
echo "::endgroup::"
|
||||
|
||||
CURRENT_STATUS="$(stackit ske cluster describe "$INPUT_CLUSTER_NAME" -ojson | jq -r '.status.aggregated')"
|
||||
|
||||
if [ "$CURRENT_STATUS" != "$INITIAL_STATUS" ]; then
|
||||
|
|
@ -101,16 +113,6 @@ runs:
|
|||
exit 1
|
||||
fi
|
||||
|
||||
echo "::group::Authenticating with service account and triggering operation"
|
||||
|
||||
STACKIT_ACCESS_TOKEN="$(stackit auth activate-service-account --only-print-access-token)"
|
||||
export STACKIT_ACCESS_TOKEN
|
||||
|
||||
stackit config set --project-id "$INPUT_PROJECT_ID"
|
||||
stackit curl --fail -X POST "https://ske.api.stackit.cloud/v2/projects/$INPUT_PROJECT_ID/regions/$INPUT_REGION/clusters/$INPUT_CLUSTER_NAME/$ENDPOINT"
|
||||
|
||||
echo "::endgroup::"
|
||||
|
||||
if [ "$WAIT" != "true" ]; then
|
||||
echo "Operation triggered. No wait requested, exiting."
|
||||
exit 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue