shell/package/helm-cmd

33 lines
1002 B
Bash
Executable File

#!/bin/sh
set -e
sleep 1
for i in $(seq 1 20); do
if kubectl version >/dev/null 2>&1; then
break
fi
echo Waiting for Kubernetes API to be available
if [ $i = 20 ]; then
echo Timeout waiting for kubernetes
exit 1
fi
sleep 1
done
for i in operation*; do
# If a kustomize yaml has been passed along with the operation
# it will have the same numerical suffix.
kustomization=$(echo $i.yaml | sed "s/operation/kustomization/g")
if [[ -f $kustomization ]]; then
# Renaming file because kustomize only supports the following filenames:
# kustomization.yaml, kustomization.yml, and Kustomization.
cp $kustomization kustomization.yaml
fi
cat $i | xargs -0 -- echo helm
cat $i | xargs -0 -- helm
echo
echo '---------------------------------------------------------------------'
cat $i | xargs -0 -- echo SUCCESS: helm
echo '---------------------------------------------------------------------'
done