From 250cd5daf48d3c777fe81cefe4d1f2ad441dd7a1 Mon Sep 17 00:00:00 2001 From: Paul Meyer <49727155+katexochen@users.noreply.github.com> Date: Fri, 19 Jan 2024 17:44:58 +0100 Subject: [PATCH] just: add wait-for-workload target Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com> --- justfile | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/justfile b/justfile index a89dc54a07..98f5a587ef 100644 --- a/justfile +++ b/justfile @@ -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: @@ -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 \