From 7b0142dcee6eb0a7a3926707c7e8c92295503ddf Mon Sep 17 00:00:00 2001 From: xeruf <27jf@pm.me> Date: Wed, 6 Jul 2022 08:01:38 +0100 Subject: [PATCH] config/shell/server/stack: fix pod detection --- .config/shell/server | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.config/shell/server b/.config/shell/server index bc40043..9a8ddd9 100644 --- a/.config/shell/server +++ b/.config/shell/server @@ -1,12 +1,13 @@ export STACKSPIN="${STACKSPIN:-$HOME/projects/stackspin}" _stackspin_cluster_cache=/var/tmp/stackspin-cluster -# Stackspin CLI Wrapper +# Stackspin CLI Wrapper: # Initialize once with "stack select example.org", # then it loads the last selected cluster on startup. # Presumes a mapping like the following in your ssh config: # Host example.org # Hostname [IP] +# This is a function so it can change directory stack() { test $# -lt 1 && builtin cd "$STACKSPIN" && @@ -42,7 +43,7 @@ stack() { # app clis via kubectl (occ) "$0" exec nc-nextcloud -it -- su www-data -s /bin/bash -c "php $command $*";; (exec) - if ! pod=$("$0" pod "$1-[0-9]") + if ! pod=$("$0" pod "$1-\(0\|[0-f]\+\)") then echo "No pod found for $1" >&2 return 1 fi @@ -53,6 +54,7 @@ stack() { shift kubectl get pods --all-namespaces --field-selector="status.phase=Running" -o=custom-columns=S:.metadata.namespace,N:.metadata.name --no-headers "$@" | grep --color=never "$podname";; (push) + git commit -a git push flux reconcile source git -n flux-system "$(basename $(git rev-parse --show-toplevel))";; # stackspin bare