Skip to content

Commit

Permalink
unify_scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Cortey committed Dec 7, 2023
1 parent 3627e80 commit ceb01eb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 26 deletions.
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
#!/usr/bin/env bash


sleep 10

echo "Checking status of POST Jobs for Keda-Manager"

REF_NAME="${1:-"main"}"
STATUS_URL="https://api.github.com/repos/kyma-project/keda-manager/commits/${REF_NAME}/status"

function get_keda_status () {
function verify_github_jobs_status () {
local number=1
while [[ $number -le 100 ]] ; do
echo ">--> checking keda release job status #$number"
local STATUS=`curl -L -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" ${STATUS_URL} | head -n 2 `
local STATUS=`curl -L -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" ${STATUS_URL} | jq -r .state `
echo "jobs status: ${STATUS:='UNKNOWN'}"
[[ "$STATUS" == *"Success"* ]] && return 0
[[ "$STATUS" == "success" ]] && return 0
[[ "$STATUS" == "failure" ]] && return 1
sleep 5
((number = number + 1))
done

exit 1
}

get_kyma_status
verify_github_jobs_status
19 changes: 0 additions & 19 deletions .github/scripts/verify-keda-status.sh

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/create-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
run: ./.github/scripts/check_image.sh ${{ github.event.inputs.name }}

- name: Verify
run: ./.github/scripts/verify-keda-status.sh ${{ github.ref_name }}
run: ./.github/scripts/verify-keda-jobs-status.sh ${{ github.ref_name }}

create-draft:
name: Create draft release
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
run: ./.github/scripts/release.sh

- name: Verify Assets
run: ./.github/scripts/verify-release-job-status.sh ${{ github.ref_name }}
run: ./.github/scripts/verify-keda-jobs-status.sh ${{ github.ref_name }}

outputs:
release_id: ${{ steps.create-draft.outputs.release_id }}
Expand Down

0 comments on commit ceb01eb

Please sign in to comment.