Skip to content

Commit

Permalink
Until loops refined to not pollute CI logs
Browse files Browse the repository at this point in the history
  • Loading branch information
jonashackt committed Jan 11, 2024
1 parent f1486a2 commit 1dc6558
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 28 deletions.
20 changes: 8 additions & 12 deletions .github/workflows/provision-aws.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,8 @@ jobs:
- name: Checkout
uses: actions/checkout@master

- name: Install & spin up kind via brew
run: |
echo "--- Add homebrew to path as described in https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2004-Readme.md#notes"
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
echo "--- Install kind via brew"
brew install kind
- name: Spin up kind via brew
run: |
echo "--- Create kind cluster"
kind create cluster --image "kindest/node:$KIND_NODE_VERSION" --wait 5m
Expand Down Expand Up @@ -67,10 +61,12 @@ jobs:
- name: Check crossplane status
run: |
echo "--- Wait for crossplane to become ready (now wrapped in until to prevent error: no matching resources found)"
until kubectl wait --for=condition=ready pod -l app=crossplane --namespace crossplane-system --timeout=120s; do : ; done
echo "--- Wait for crossplane to become ready (now prefaced with until as described in https://stackoverflow.com/questions/68226288/kubectl-wait-not-working-for-creation-of-resources)"
until kubectl wait --for=condition=PodScheduled pod -l app=crossplane --namespace crossplane-system --timeout=120s > /dev/null 2>&1; do : ; done
kubectl wait --for=condition=ready pod -l app=crossplane --namespace crossplane-system --timeout=120s
echo "--- Wait until AWS Provider is up and running (now wrapped in until to prevent Error from server (NotFound): providers.pkg.crossplane.io 'provider-aws-s3' not found)"
until kubectl wait --for=condition=healthy --timeout=180s provider/provider-aws-s3; do : ; done
echo "--- Wait until AWS Provider is up and running (now prefaced with until to prevent Error from server (NotFound): providers.pkg.crossplane.io 'provider-aws-s3' not found)"
until kubectl get provider/provider-aws-s3 > /dev/null 2>&1; do : ; done
kubectl wait --for=condition=healthy --timeout=180s provider/provider-aws-s3
kubectl get all -n crossplane-system
24 changes: 8 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -580,14 +580,8 @@ jobs:
- name: Checkout
uses: actions/checkout@master
- name: Install & spin up kind via brew
run: |
echo "--- Add homebrew to path as described in https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2004-Readme.md#notes"
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
echo "--- Install kind via brew"
brew install kind
- name: Spin up kind via brew
run: |
echo "--- Create kind cluster"
kind create cluster --image "kindest/node:$KIND_NODE_VERSION" --wait 5m
Expand Down Expand Up @@ -631,17 +625,15 @@ jobs:
- name: Check crossplane status
run: |
echo "--- Wait for crossplane to become ready (now wrapped in until to prevent error: no matching resources found)"
until kubectl wait --for=condition=ready pod -l app=crossplane --namespace crossplane-system --timeout=120s; do : ; done
echo "--- Wait for crossplane to become ready (now prefaced with until as described in https://stackoverflow.com/questions/68226288/kubectl-wait-not-working-for-creation-of-resources)"
until kubectl wait --for=condition=PodScheduled pod -l app=crossplane --namespace crossplane-system --timeout=120s > /dev/null 2>&1; do : ; done
kubectl wait --for=condition=ready pod -l app=crossplane --namespace crossplane-system --timeout=120s
echo "--- Wait until AWS Provider is up and running (now wrapped in until to prevent Error from server (NotFound): providers.pkg.crossplane.io 'provider-aws-s3' not found)"
until kubectl wait --for=condition=healthy --timeout=180s provider/provider-aws-s3; do : ; done
echo "--- Wait until AWS Provider is up and running (now prefaced with until to prevent Error from server (NotFound): providers.pkg.crossplane.io 'provider-aws-s3' not found)"
until kubectl get provider/provider-aws-s3 > /dev/null 2>&1; do : ; done
kubectl wait --for=condition=healthy --timeout=180s provider/provider-aws-s3
kubectl get all -n crossplane-system
```

Be sure to create both `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` configured as GitHub Repository Secrets:
Expand Down

0 comments on commit 1dc6558

Please sign in to comment.