Skip to content

Commit

Permalink
Refactor startup script
Browse files Browse the repository at this point in the history
  • Loading branch information
pankajastro committed Aug 12, 2024
1 parent 8d59061 commit 89ffdaf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test_kubernetes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Kubernetes Integration Tests


on:
push: # Run on pushes to the default branch
branches: [kube_mode_ci]
# push: # Run on pushes to the default branch
# branches: [kube_mode_ci]
pull_request_target: # Also run on pull requests originated from forks
branches: [kube_mode_ci]

Expand Down
21 changes: 9 additions & 12 deletions scripts/test/kubernetes-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,16 @@ wait_for_nodes_ready() {

kubectl config set-context default

# Create a docker image containing the dbt project files and dbt profile
cd dev && docker build -t dbt-jaffle-shop:1.0.0 -f Dockerfile.postgres_profile_docker_k8s .
# Make the build image available in the Kind K8s cluster
kind load docker-image dbt-jaffle-shop:1.0.0

# Deploy a Postgres pod to Kind
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update
helm install postgres bitnami/postgresql -f scripts/test/values.yaml

sleep 60

# Retrieve the Postgres password and set it as an environment variable
POSTGRES_PASSWORD=$(kubectl get secret --namespace default postgres-postgresql -o jsonpath="{.data.postgres-password}" | base64 -d)
export POSTGRES_PASSWORD
Expand All @@ -55,16 +58,10 @@ export POSTGRES_PASSWORD
kubectl port-forward --namespace default svc/postgres-postgresql 5432:5432 &
kubectl create secret generic postgres-secrets --from-literal=host=postgres-postgresql.default.svc.cluster.local --from-literal=password=$POSTGRES_PASSWORD

# Create a docker image containing the dbt project files and dbt profile
cd dev && docker build -t dbt-jaffle-shop:1.0.0 -f Dockerfile.postgres_profile_docker_k8s .

wait_for_nodes_ready

# Make the build image available in the Kind K8s cluster
kind load docker-image dbt-jaffle-shop:1.0.0

# Wait for the kind cluster to be in 'Ready' state
wait_for_nodes_ready
#wait_for_nodes_ready
#
## Wait for the kind cluster to be in 'Ready' state
#wait_for_nodes_ready

# For Debugging
echo "nodes"
Expand Down

0 comments on commit 89ffdaf

Please sign in to comment.