From 05a42822ac69282f00d98bf1be6e903d7e66bd4d Mon Sep 17 00:00:00 2001 From: rasswanth-s <43314053+rasswanth-s@users.noreply.github.com> Date: Fri, 20 Sep 2024 10:02:08 +0530 Subject: [PATCH] add hotreload mode in devspace to just clusters --- justfiles/cluster.just | 12 ++++++++++++ justfiles/devspace.just | 26 ++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/justfiles/cluster.just b/justfiles/cluster.just index 21e616f2602..0a2ea8e4dfe 100644 --- a/justfiles/cluster.just +++ b/justfiles/cluster.just @@ -12,6 +12,10 @@ delete-high: (delete-cluster cluster_high) [group('highside')] deploy-high: (deploy-devspace cluster_high ns_default) +# Deploy Syft to the high-side cluster in Hot Reload Mode +[group('highside')] +hotreload-high: (hotreload-devspace cluster_high ns_default) + # Reset Syft DB state in the high-side cluster [group('highside')] reset-high: (reset-syft cluster_high ns_default) @@ -34,6 +38,10 @@ delete-low: (delete-cluster cluster_low) [group('lowside')] deploy-low: (deploy-devspace cluster_low ns_default "-p datasite-low") +# Deploy Syft to the low-side cluster in Hot Reload Mode +[group('lowside')] +hotreload-low: (hotreload-devspace cluster_low ns_default "-p datasite-low") + # Reset Syft DB state in the low-side cluster [group('lowside')] reset-low: (reset-syft cluster_low ns_default) @@ -56,6 +64,10 @@ delete-gw: (delete-cluster cluster_gw) [group('gateway')] deploy-gw: (deploy-devspace cluster_gw ns_default "-p gateway") +# Deploy Syft to the gateway cluster in Hot Reload Mode +[group('gateway')] +hotreload-gw: (hotreload-devspace cluster_gw ns_default "-p gateway") + # Reset Syft DB state in the gateway cluster [group('gateway')] reset-gw: (reset-syft cluster_gw ns_default) diff --git a/justfiles/devspace.just b/justfiles/devspace.just index 113d727c5ea..ad82cfb3a40 100644 --- a/justfiles/devspace.just +++ b/justfiles/devspace.just @@ -24,6 +24,32 @@ deploy-devspace cluster namespace *args='': {{ args }} \ --var CONTAINER_REGISTRY={{ registry_url }} + +[group('devspace')] +[private] +hotreload-devspace cluster namespace *args='': + #!/bin/bash + set -euo pipefail + + cd packages/grid + + PROFILE="{{ _g_profiles }}" + PROFILE=$(echo "$PROFILE" | sed -E 's/^,*|,*$//g') + if [ -n "$PROFILE" ]; then + PROFILE="-p $PROFILE" + fi + + echo "Deploying to {{ cluster }}" + + devspace dev \ + --no-warn \ + --kube-context {{ cluster }} \ + --namespace {{ namespace }} \ + $PROFILE \ + {{ args }} \ + --var CONTAINER_REGISTRY={{ registry_url }} + + [group('devspace')] [private] purge-devspace cluster namespace: