#!/usr/bin/env bash cmd=$1 chart=$2 env=$3 manifests=${4:-manifests} outdir=${5:-_manifests} build() { if [ ! -d "$manifests" ]; then echo "nothing to do here..." 1>&2 exit 0 fi mkdir -p $outdir/templates echo "generating $outdir/Chart.yaml" 1>&2 cat < $outdir/Chart.yaml apiVersion: v1 appVersion: "1.0" description: A Helm chart for Kubernetes name: $chart version: 0.1.0 EOF cp -r $manifests/* $outdir/templates } clean() { echo "cleaning $outdir" 1>&2 rm -rf $outdir } case "$cmd" in "build" ) build ;; "clean" ) clean ;; * ) echo "unsupported command: $cmd" 1>&2; exit 1 ;; esac