-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Script for Downloading and Installing the Latest KSOPS Exec Plugin (#84)
* Add script for download exec plugin remotely * Also install under ksops-exec * Add remote install opt to README
- Loading branch information
Showing
3 changed files
with
64 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# Require $XDG_CONFIG_HOME to be set | ||
if [[ -z "$XDG_CONFIG_HOME" ]]; then | ||
echo "You must define XDG_CONFIG_HOME to use a kustomize plugin" | ||
echo "Add 'export XDG_CONFIG_HOME=\$HOME/.config' to your .bashrc or .zshrc" | ||
exit 1 | ||
fi | ||
|
||
|
||
PLUGIN_PATH="$XDG_CONFIG_HOME/kustomize/plugin/viaduct.ai/v1/ksops/" | ||
EXEC_PLUGIN_PATH="$XDG_CONFIG_HOME/kustomize/plugin/viaduct.ai/v1/ksops-exec/" | ||
|
||
|
||
echo "Verify ksops plugin directory exists and is empty" | ||
rm -rf $PLUGIN_PATH || true | ||
rm -rf $EXEC_PLUGIN_PATH || true | ||
mkdir -p $PLUGIN_PATH | ||
mkdir -p $EXEC_PLUGIN_PATH | ||
|
||
ARCH=$(uname -m) | ||
OS="" | ||
case $(uname | tr '[:upper:]' '[:lower:]') in | ||
linux*) | ||
OS="Linux" | ||
;; | ||
darwin*) | ||
OS="Darwin" | ||
;; | ||
msys*) | ||
OS="Windows" | ||
;; | ||
windowsnt*) | ||
OS="Windows" | ||
;; | ||
*) | ||
echo "Unknown OS type: $(uname)" | ||
echo "Please consider contributing to this script to support your OS." | ||
exit 1 | ||
;; | ||
esac | ||
|
||
|
||
echo "Downloading latest release to ksops plugin path" | ||
wget -c https://github.com/viaduct-ai/kustomize-sops/releases/latest/download/ksops_latest_${OS}_${ARCH}.tar.gz -O - | tar -xz -C $PLUGIN_PATH | ||
cp $PLUGIN_PATH* $EXEC_PLUGIN_PATH | ||
echo "Successfully installed ksops" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters