Skip to content

Commit

Permalink
fix ci actions
Browse files Browse the repository at this point in the history
  • Loading branch information
usrbinkat committed Jan 31, 2024
1 parent f39374f commit dd0bc6d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/kind.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
direnv allow
make kind-ready
env:
ACTIONS_STEP_DEBUG: true
ACTIONS_STEP_DEBUG: false
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -79,14 +79,13 @@ jobs:
direnv allow
make pulumi-up
env:
ACTIONS_STEP_DEBUG: true
ACTIONS_STEP_DEBUG: false
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Wait for All Pods to be Ready
id: wait-all-pods
run: |
set -ex
direnv allow
make wait-all-pods
env:
Expand Down
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ detect-arch:
pulumi-login:
@echo "Logging into Pulumi..."
@pulumi login | sed 's/${ESCAPED_PAT}/***PULUMI_ACCESS_TOKEN***/g' || true
@pulumi install || true
@pulumi install | grep -v already || true
@pulumi stack select --create ${PULUMI_STACK_IDENTIFIER} || true
@echo "Login successful."

Expand All @@ -93,7 +93,7 @@ pulumi-up:

pulumi-down:
@echo "Deploying Pulumi infrastructure..."
@set -ex; pulumi down --yes --skip-preview --refresh \
@pulumi down --yes --skip-preview --refresh \
| sed 's/${ESCAPED_PAT}/***PULUMI_ACCESS_TOKEN***/g' \
|| PULUMI_K8S_DELETE_UNREACHABLE=true \
pulumi down --yes --skip-preview --refresh \
Expand All @@ -112,8 +112,8 @@ down: pulumi-login pulumi-down
# --- Wait for All Pods Ready ---
wait-all-pods:
@echo "Waiting for all pods in the cluster to be ready..."
@set -ex; kubectl get pods --all-namespaces --show-labels --kubeconfig ${KUBECONFIG}
@set -ex; bash -c 'set -ex; until [ "$$(kubectl get pods --all-namespaces --no-headers --kubeconfig ${KUBECONFIG} | grep -v 'Running\|Completed\|Succeeded' | wc -l)" -eq 0 ]; do echo "Waiting for pods to be ready..."; sleep 5; done'
@kubectl get pods --all-namespaces --show-labels --kubeconfig ${KUBECONFIG}
@bash -c 'until [ "$$(kubectl get pods --all-namespaces --no-headers --kubeconfig ${KUBECONFIG} | grep -v 'Running\|Completed\|Succeeded' | wc -l)" -eq 0 ]; do echo "Waiting for pods to be ready..."; sleep 5; done'
@kubectl get pods --all-namespaces --show-labels --kubeconfig ${KUBECONFIG}
@echo "All pods in the cluster are ready."

Expand Down Expand Up @@ -182,9 +182,9 @@ kind-cluster:
kind-ready:
@echo "Waiting for Kind Kubernetes API to be ready..."
@kubectl get all --all-namespaces --kubeconfig ${KUBECONFIG} || sleep 5
@bash -c "set -ex; until kubectl --kubeconfig ${KUBECONFIG} wait --for=condition=Ready pod -l component=kube-apiserver --namespace=kube-system --timeout=180s; do echo 'Waiting for kube-apiserver to be ready...'; sleep 5; done"
@bash -c "set -ex; until kubectl --kubeconfig ${KUBECONFIG} wait --for=condition=Ready pod -l component=kube-scheduler --namespace=kube-system --timeout=180s; do echo 'Waiting for kube-scheduler to be ready...'; sleep 5; done"
@bash -c "set -ex; until kubectl --kubeconfig ${KUBECONFIG} wait --for=condition=Ready pod -l component=kube-controller-manager --namespace=kube-system --timeout=180s; do echo 'Waiting for kube-controller-manager to be ready...'; sleep 5; done"
@bash -c "until kubectl --kubeconfig ${KUBECONFIG} wait --for=condition=Ready pod -l component=kube-apiserver --namespace=kube-system --timeout=180s; do echo 'Waiting for kube-apiserver to be ready...'; sleep 5; done"
@bash -c "until kubectl --kubeconfig ${KUBECONFIG} wait --for=condition=Ready pod -l component=kube-scheduler --namespace=kube-system --timeout=180s; do echo 'Waiting for kube-scheduler to be ready...'; sleep 5; done"
@bash -c "until kubectl --kubeconfig ${KUBECONFIG} wait --for=condition=Ready pod -l component=kube-controller-manager --namespace=kube-system --timeout=180s; do echo 'Waiting for kube-controller-manager to be ready...'; sleep 5; done"
@kubectl get all --all-namespaces --kubeconfig ${KUBECONFIG} || true
@echo "Kind Cluster is ready."

Expand Down

0 comments on commit dd0bc6d

Please sign in to comment.