Skip to content

Commit

Permalink
just: ensure peerpod vms are cleaned up on undeploy
Browse files Browse the repository at this point in the history
  • Loading branch information
davidweisse committed Nov 4, 2024
1 parent 3fb6a9d commit 8bd0b28
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions justfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Undeploy, rebuild, deploy.
default target=default_deploy_target platform=default_platform cli=default_cli: soft-clean coordinator initializer openssl cryptsetup port-forwarder service-mesh-proxy (node-installer platform) (deploy target cli platform) set verify (wait-for-workload target)
default target=default_deploy_target platform=default_platform cli=default_cli: (soft-clean platform) coordinator initializer openssl cryptsetup port-forwarder service-mesh-proxy (node-installer platform) (deploy target cli platform) set verify (wait-for-workload target)

# Build and push a container image.
push target:
Expand Down Expand Up @@ -62,7 +62,7 @@ node-installer platform=default_platform:
;;
esac
e2e target=default_deploy_target platform=default_platform: soft-clean coordinator initializer cryptsetup openssl port-forwarder service-mesh-proxy (node-installer platform)
e2e target=default_deploy_target platform=default_platform: (soft-clean platform) coordinator initializer cryptsetup openssl port-forwarder service-mesh-proxy (node-installer platform)
#!/usr/bin/env bash
set -euo pipefail
if [[ "{{ target }}" == "aks-runtime" ]]; then
Expand Down Expand Up @@ -153,7 +153,7 @@ apply target=default_deploy_target:
kubectl apply -f ./{{ workspace_dir }}/deployment
# Delete Kubernetes manifests.
undeploy:
undeploy platform=default_platform:
#!/usr/bin/env bash
set -euo pipefail
if [[ ! -d ./{{ workspace_dir }} ]]; then
Expand All @@ -169,6 +169,12 @@ undeploy:
echo "Namespace $ns does not exist, nothing to undeploy."
exit 0
fi
if [[ {{ platform }} == "AKS-PEER-SNP" ]]; then
kubectl delete \
-f ./{{ workspace_dir }}/deployment \
--cascade=foreground \
--ignore-not-found
fi
if [[ -f ./{{ workspace_dir }}/deployment/ns.yml ]]; then
kubectl delete \
-f ./{{ workspace_dir }}/deployment \
Expand Down Expand Up @@ -359,18 +365,18 @@ fmt:
lint:
nix run -L .#scripts.golangci-lint -- run
demodir version="latest": undeploy
demodir version="latest" platform=default_platform: (undeploy platform)
#!/usr/bin/env bash
set -euo pipefail
v="$(echo {{ version }} | sed 's/\./-/g')"
nix develop -u DIRENV_DIR -u DIRENV_FILE -u DIRENV_DIFF .#demo-$v
# Remove deployment specific files.
soft-clean: undeploy
soft-clean platform=default_platform: (undeploy platform)
rm -rf ./{{ workspace_dir }}
# Cleanup all auxiliary files, caches etc.
clean: soft-clean
clean platform=default_platform: (soft-clean platform)
rm -rf ./{{ workspace_dir }}.cache
rm -rf ./layers_cache
rm -f ./layers-cache.json
Expand Down

0 comments on commit 8bd0b28

Please sign in to comment.