Skip to content

Commit

Permalink
just: add wait-for-workload target
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Meyer <[email protected]>
  • Loading branch information
katexochen committed Jan 19, 2024
1 parent dfc6059 commit 250cd5d
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion justfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Undeploy, rebuild, deploy.
default target=default_deploy_target: undeploy coordinator initializer openssl (deploy target) set verify
default target=default_deploy_target: undeploy coordinator initializer openssl (deploy target) set verify (wait-for-workload target)

# Build the coordinator, containerize and push it.
coordinator:
Expand Down Expand Up @@ -102,6 +102,32 @@ verify:
echo "Verified in $duration seconds."
echo "verify $duration" >> ./{{workspace_dir}}/just.perf
# Wait for workloads to become ready.
wait-for-workload target=default_deploy_target:
#!/usr/bin/env bash
set -euo pipefail
ns=$(cat ./{{workspace_dir}}/just.namespace)
case {{target}} in
"simple")
nix run .#kubectl-wait-ready -- $ns workload
;;
"openssl")
nix run .#kubectl-wait-ready -- $ns openssl-backend
nix run .#kubectl-wait-ready -- $ns openssl-client
nix run .#kubectl-wait-ready -- $ns openssl-frontend
;;
"emojivoto")
nix run .#kubectl-wait-ready -- $ns emoji-svc
nix run .#kubectl-wait-ready -- $ns vote-bot
nix run .#kubectl-wait-ready -- $ns voting-svc
nix run .#kubectl-wait-ready -- $ns web-svc
;;
*)
echo "Please register workloads of new targets in wait-for-workload"
exit 1
;;
esac
# Load the kubeconfig from the running AKS cluster.
get-credentials:
nix run .#azure-cli -- aks get-credentials \
Expand Down

0 comments on commit 250cd5d

Please sign in to comment.