From 5a8811ec328daa8db31a7cba34fdc01ae39c1499 Mon Sep 17 00:00:00 2001 From: Venkata Mutyala Date: Tue, 26 Mar 2024 23:25:50 -0700 Subject: [PATCH] feat: migrate to zsh from bash --- .devcontainer/Dockerfile | 4 ++-- .devcontainer/tools/add-tools-to-shells.sh | 4 +--- .devcontainer/tools/cordon-drain-nodes-older-than-minutes.sh | 2 +- .devcontainer/tools/create-ghcr-regcred.sh | 3 ++- .devcontainer/tools/glueops-fetch-repos.sh | 2 ++ .devcontainer/tools/run-gha.sh | 2 ++ .devcontainer/tools/yolo.sh | 2 ++ 7 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index d253563..0e6436b 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -42,12 +42,12 @@ RUN curl -Lo /usr/local/bin/kubectl https://dl.k8s.io/release/v${VERSION_KUBECTL && tar -xvf helm.tar.gz \ && mv linux-amd64/helm /usr/local/bin \ && rm -rf linux-amd64 helm.tar.gz \ - && curl -s https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | TAG=v${VERSION_K3D} bash + && curl -s https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | TAG=v${VERSION_K3D} zsh ENV CLOUDSDK_COMPONENT_MANAGER_FIXED_SDK_VERSION=${VERSION_GCLOUD_SDK} # Below includes cleanup to save space after the gcloud install: https://stackoverflow.com/questions/60827959/how-to-stop-gcloud-component-update-from-keeping-a-backup -RUN curl -sSL https://sdk.cloud.google.com | bash \ +RUN curl -sSL https://sdk.cloud.google.com | zsh \ && export PATH=$PATH:/usr/local/gcloud/google-cloud-sdk/bin \ && gcloud components install gke-gcloud-auth-plugin --quiet \ && gcloud components install alpha --quiet \ diff --git a/.devcontainer/tools/add-tools-to-shells.sh b/.devcontainer/tools/add-tools-to-shells.sh index 7dc7778..9e3acdf 100644 --- a/.devcontainer/tools/add-tools-to-shells.sh +++ b/.devcontainer/tools/add-tools-to-shells.sh @@ -1,9 +1,7 @@ -#!/bin/bash +#!/bin/zsh add_tools_to_shells() { if [ -f "/home/vscode/.bashrc" ]; then - find /etc/tools/ -type f ! -name "add-tools-to-shells.sh" ! -name "helm-repositories.yaml" \ - -exec sh -c 'echo >> /home/vscode/.bashrc; cat "{}" >> /home/vscode/.bashrc' \; echo "zsh" >> /home/vscode/.bashrc fi diff --git a/.devcontainer/tools/cordon-drain-nodes-older-than-minutes.sh b/.devcontainer/tools/cordon-drain-nodes-older-than-minutes.sh index 476be20..9a5a4ea 100644 --- a/.devcontainer/tools/cordon-drain-nodes-older-than-minutes.sh +++ b/.devcontainer/tools/cordon-drain-nodes-older-than-minutes.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/zsh cordon-drain-nodes-older-than-minutes() { threshold_minutes="" diff --git a/.devcontainer/tools/create-ghcr-regcred.sh b/.devcontainer/tools/create-ghcr-regcred.sh index 5072730..a54babc 100644 --- a/.devcontainer/tools/create-ghcr-regcred.sh +++ b/.devcontainer/tools/create-ghcr-regcred.sh @@ -1,3 +1,5 @@ +#!/bin/zsh + create-ghcr-regcred() { gh_username="" gh_token="" @@ -40,7 +42,6 @@ create-ghcr-regcred() { return fi - set -e b64_enc_regcred=$(echo -n "$gh_username:$gh_token" | base64) echo "{\"auths\":{\"ghcr.io\":{\"auth\":\"$b64_enc_regcred\"}}}" diff --git a/.devcontainer/tools/glueops-fetch-repos.sh b/.devcontainer/tools/glueops-fetch-repos.sh index 7f4b9b8..25de77d 100644 --- a/.devcontainer/tools/glueops-fetch-repos.sh +++ b/.devcontainer/tools/glueops-fetch-repos.sh @@ -1,3 +1,5 @@ +#!/bin/zsh + glueops-fetch-repos() { #https://stackoverflow.com/a/68770988/4620962 diff --git a/.devcontainer/tools/run-gha.sh b/.devcontainer/tools/run-gha.sh index 2be815a..836235d 100644 --- a/.devcontainer/tools/run-gha.sh +++ b/.devcontainer/tools/run-gha.sh @@ -1,3 +1,5 @@ +#!/bin/zsh + run-gha() { #https://stackoverflow.com/questions/6245570/how-do-i-get-the-current-branch-name-in-git gh workflow run --ref=$(git rev-parse --abbrev-ref HEAD) diff --git a/.devcontainer/tools/yolo.sh b/.devcontainer/tools/yolo.sh index ca607f5..38f27ed 100644 --- a/.devcontainer/tools/yolo.sh +++ b/.devcontainer/tools/yolo.sh @@ -1,3 +1,5 @@ +#!/bin/zsh + yolo() { # Always unset GITHUB_TOKEN unset GITHUB_TOKEN