Skip to content

Commit

Permalink
cicd: fix check result
Browse files Browse the repository at this point in the history
  • Loading branch information
omri2001 committed Nov 10, 2024
1 parent 44f7b15 commit a9fd0c0
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,20 @@ jobs:
comment: Auto-closing pull request
delete-branch: true
- name: Check Result
run: |
kubectl logs deployment/piper
kubectl get workflows.argoproj.io -n workflows
BRANCH_VALID_STRING=$(echo ${{ github.ref_name }}-test | tr '[:upper:]' '[:lower:]' | tr '_' '-' | tr -cd 'a-z0-9.\-')
## check if created
RESULT=$(kubectl get workflows.argoproj.io -n workflows --selector=branch=$BRANCH_VALID_STRING --no-headers | grep piper-e2e-test)
[ ! -z "$RESULT" ] && echo "CRD created $RESULT" || { echo "Workflow not exists, existing..."; exit 1; }
## check if status phase not Failed, if yes, show message
RESULT=$(kubectl get workflows.argoproj.io -n workflows --selector=branch=$BRANCH_VALID_STRING --no-headers -o custom-columns="Status:status.phase")
MESSAGE=$(kubectl get workflows.argoproj.io -n workflows --selector=branch=$BRANCH_VALID_STRING --no-headers -o custom-columns="Status:status.message")
[ ! "$RESULT" == "Failed" ] && echo "CRD created $MESSAGE" || { echo "Workflow Failed $MESSAGE, existing..."; exit 1; }
github-e2e-env:
name: E2E Tests (on development)
runs-on: ubuntu-latest
Expand Down

0 comments on commit a9fd0c0

Please sign in to comment.