Add wrapper for YTT
This commit is contained in:
Родитель
aed7d8b616
Коммит
2095204b17
|
@ -6,3 +6,5 @@ obj/
|
|||
/.idea/
|
||||
/.vs/
|
||||
/.vscode/
|
||||
|
||||
/tools/
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
ytt_version=v0.36.0
|
||||
ytt_mirror=https://github.com/vmware-tanzu/carvel-ytt/releases/download
|
|
@ -0,0 +1,29 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
# =========================================================================== #
|
||||
# wrapper for ytt #
|
||||
# =========================================================================== #
|
||||
|
||||
base_dir=$(dirname $0)
|
||||
ytt=$base_dir/tools/ytt
|
||||
|
||||
if [ ! -x $ytt ]; then
|
||||
ytt_version=$(grep '^ytt_version=' $base_dir/tool.properties | cut -d= -f2)
|
||||
ytt_mirror=$(grep '^ytt_mirror=' $base_dir/tool.properties | cut -d= -f2)
|
||||
case $(uname -s) in
|
||||
Darwin) platform=darwin ;;
|
||||
Linux) platform=linux ;;
|
||||
*)
|
||||
echo "unsupported platform: $(uname -s)"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
ytt_url=$ytt_mirror/$ytt_version/ytt-$platform-amd64
|
||||
mkdir -p $(dirname $ytt)
|
||||
wget $ytt_url -O $ytt
|
||||
chmod +x $ytt
|
||||
fi
|
||||
|
||||
exec $ytt $*
|
Загрузка…
Ссылка в новой задаче