Skip to content

Commit

Permalink
add kustomize
Browse files Browse the repository at this point in the history
  • Loading branch information
mtaron committed Apr 20, 2024
1 parent 409cbb4 commit 2dbcaa1
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
1 change: 1 addition & 0 deletions home/private_dot_config/private_zsh/private_dot_zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ if ! zgenom saved; then
has op && op completion zsh > "$ZSH_COMPLETIONS/_op"
has flyctl && flyctl completion zsh > "$ZSH_COMPLETIONS/_flyctl"
has rye && rye self completion --shell zsh > "$ZSH_COMPLETIONS/_rye"
has kustomize && kustomize completion zsh > "$ZSH_COMPLETIONS/_kustomize"
[[ -d "$ZSH_COMPLETIONS" ]] && zgenom load "$ZSH_COMPLETIONS"

zgenom save
Expand Down
26 changes: 23 additions & 3 deletions home/private_dot_config/private_zsh/zsh.d/install.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,18 @@ install-helm()
helm version
}

# https://github.com/GitCredentialManager/git-credential-manager#download-and-install
# https://github.com/git-ecosystem/git-credential-manager/blob/release/docs/install.md#linux
install-git-credential-manager()
{
local tmp_dir=$(mktemp --directory)
gh release download \
--repo GitCredentialManager/git-credential-manager \
--repo git-ecosystem/git-credential-manager \
--pattern 'gcm-linux_amd64.*.deb' \
--dir "$tmp_dir"
sudo dpkg --install "$tmp_dir"/gcm-linux_amd64.*.deb
rm -rf "$tmp_dir"

git-credential-manager configure
}

# https://github.com/protocolbuffers/protobuf
Expand All @@ -90,6 +92,23 @@ install-protobuf-compiler()
rm -rf "$tmp_dir"
}

# https://github.com/protocolbuffers/protobuf
install-kustomize()
{
rm --force "$XDG_BIN_DIR"/kustomize

local tmp_dir=$(mktemp --directory)
gh release download \
--repo kubernetes-sigs/kustomize \
--pattern 'kustomize_v*_linux_amd64.tar.gz' \
--dir "$tmp_dir"
tar --extract --ungzip --file "$tmp_dir"/kustomize_v*_linux_amd64.tar.gz --directory "$XDG_BIN_DIR"

rm -rf "$tmp_dir"

kustomize version
}

# https://github.com/microsoft/artifacts-credprovider#installation-on-linux-and-mac
install-nuget-credential-provider()
{
Expand Down Expand Up @@ -181,7 +200,7 @@ install-go()
{
rm -rf "$XDG_DATA_HOME/go"

local go_version=1.20
local go_version=1.22

local latest=$(curl --show-error --silent --fail "https://go.dev/dl/?mode=json" \
| jq --arg version "go$go_version" -r '.[] | select(.stable == true) | .version | select(startswith($version))')
Expand Down Expand Up @@ -265,6 +284,7 @@ update-tools()
has func && install-azure-function-tools
has protoc && install-protobuf-compiler
has rye && rye self update
has kustomize && install-install-kustomize
[[ -d "$XDG_DATA_HOME/NuGet/plugins" ]] && install-nuget-credential-provider
}

Expand Down

0 comments on commit 2dbcaa1

Please sign in to comment.