Skip to content

Commit

Permalink
create seperate file for install_KinD_create_KinD_cluster_install_kus…
Browse files Browse the repository at this point in the history
…tomize.sh to avoid code repitition

Signed-off-by: hansinikarunarathne <107214435+hansinikarunarathne@users.noreply.github.com>
  • Loading branch information
hansinikarunarathne committed Jul 30, 2024
1 parent f226d30 commit ca7dda4
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 11 deletions.
14 changes: 3 additions & 11 deletions .github/workflows/admission_webhook_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ on:
paths:
- .github/workflows/admission_webhook_test.yaml
- apps/admission-webhook/upstream/**
- tests/gh-actions/kind-cluster.yaml
- tests/gh-actions/install_kind.sh
- tests/gh-actions/install_kustomize.sh
- tests/gh-actions/install_KinD_create_KinD_cluster_install_kustomize.sh
- tests/gh-actions/install_istio.sh
- tests/gh-actions/install_cert_manager.sh
- common/cert-manager/**
Expand All @@ -18,14 +16,8 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Install KinD
run: ./tests/gh-actions/install_kind.sh

- name: Create KinD Cluster
run: kind create cluster --config tests/gh-actions/kind-cluster.yaml

- name: Install kustomize
run: ./tests/gh-actions/install_kustomize.sh
- name: Install KinD, Create KinD cluster and Install kustomize
run: ./tests/gh-actions/install_KinD_create_KinD_cluster_install_kustomize.sh

- name: Install Istio
run: ./tests/gh-actions/install_istio.sh
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash

set -e

# Function to handle errors
handle_error() {
echo "Error: $1"
exit 1
}

# Install KinD
echo "Installing KinD..."
if ! ./tests/gh-actions/install_kind.sh; then
handle_error "Failed to install KinD"
fi

# Create KinD Cluster
echo "Creating KinD Cluster..."
if ! kind create cluster --config tests/gh-actions/kind-cluster.yaml; then
handle_error "Failed to create KinD cluster"
fi

# Install kustomize
echo "Installing kustomize..."
if ! ./tests/gh-actions/install_kustomize.sh; then
handle_error "Failed to install kustomize"
fi

echo "All steps completed successfully."

0 comments on commit ca7dda4

Please sign in to comment.