diff options
Diffstat (limited to 'zsh')
-rw-r--r-- | zsh/.config/zsh/.zshrc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/zsh/.config/zsh/.zshrc b/zsh/.config/zsh/.zshrc index 0f7b014..ce28d65 100644 --- a/zsh/.config/zsh/.zshrc +++ b/zsh/.config/zsh/.zshrc @@ -218,8 +218,22 @@ else check_kubectl_context () { if [[ "$PWD" =~ /kubernetes ]] then + git_branch=$(git rev-parse --abbrev-ref HEAD) kubectl_context=$(kubectl config current-context) kubectl_namespace=$(kubectl config view -o jsonpath="{.contexts[?(@.name==\"${kubectl_context}\")].context.namespace}") + case $git_branch in + staging) + kubectl_release=satoshipay-${kubectl_namespace}-staging + ;; + production) + kubectl_release=satoshipay-${kubectl_namespace} + ;; + master) + kubectl_release= + ;; + *) + kubectl_release=story-${git_branch}-${kubectl_namespace} + esac if [[ $kubectl_context =~ production ]] then kubectl_colour=red |