treewide: Format with shellcheck, jsonlint and yamllint
This commit is contained in:
+13
-14
@@ -4,39 +4,38 @@ set -o pipefail
|
||||
|
||||
cmd=$1
|
||||
chart=$2
|
||||
env=$3
|
||||
manifests=${4:-manifests}
|
||||
outdir=${5:-_manifests}
|
||||
|
||||
build() {
|
||||
mkdir -p $outdir/templates
|
||||
echo "Creating $outdir/templates"
|
||||
mkdir -p "${outdir}"/templates
|
||||
echo "Creating ${outdir}/templates"
|
||||
|
||||
echo "generating $outdir/Chart.yaml" 1>&2
|
||||
echo "generating ${outdir}/Chart.yaml" 1>&2
|
||||
|
||||
cat <<EOF > $outdir/Chart.yaml
|
||||
cat <<EOF > "${outdir}"/Chart.yaml
|
||||
apiVersion: v1
|
||||
appVersion: "1.0"
|
||||
# description: A Helm chart for Kubernetes
|
||||
name: $chart
|
||||
name: ${chart}
|
||||
version: 0.1.0
|
||||
EOF
|
||||
|
||||
if [ -d $manifests ]; then
|
||||
cp -r $manifests/* $outdir/templates
|
||||
elif [ -f $manifests ]; then
|
||||
cp $manifests $outdir/templates
|
||||
if [[ -d "${manifests}" ]]; then
|
||||
cp -r "${manifests}"/* "${outdir}"/templates
|
||||
elif [[ -f "${manifests}" ]]; then
|
||||
cp "${manifests}" "${outdir}"/templates
|
||||
fi
|
||||
}
|
||||
|
||||
clean() {
|
||||
echo "cleaning $outdir" 1>&2
|
||||
rm -rf $outdir
|
||||
echo "cleaning ${outdir}" 1>&2
|
||||
rm -rf "${outdir}"
|
||||
}
|
||||
|
||||
case "$cmd" in
|
||||
case "${cmd}" in
|
||||
"build" ) build ;;
|
||||
"clean" ) clean ;;
|
||||
* ) echo "unsupported command: $cmd" 1>&2; exit 1 ;;
|
||||
* ) echo "unsupported command: ${cmd}" 1>&2; exit 1 ;;
|
||||
esac
|
||||
|
||||
|
||||
Reference in New Issue
Block a user