@@ -42,25 +42,32 @@ release() {
4242 [[ ! -d " ${RELEASE_DIR} " ]] &&
4343 panic " Release dir is not found '${RELEASE_DIR} '!"
4444
45- # releasing task-git (it's the only task)
46- # See task-containers if there is more than one task to support.
47- declare task_name=task-git
48- declare task_doc=README.md
49- declare task_dir=" ${RELEASE_DIR} /tasks/${task_name} "
50- [[ ! -d " ${task_dir} " ]] &&
51- mkdir -p " ${task_dir} "
45+ # releasing all task templates using the following glob expression
46+ for t in $( ls -1 templates/task-* .yaml) ; do
47+ declare task_name=$( extract_name ${t} )
48+ [[ -z " ${task_name} " ]] &&
49+ panic " Unable to extract Task name from '${t} '!"
5250
53- # rendering the helm template for the specific file, using the resource name for the
54- # filename respectively
55- echo " # Rendering '${task_name} ' at '${task_dir} '..."
56- helm template . > ${task_dir} /${task_name} .yaml ||
57- panic " Unable to render '${task_name} '!"
51+ declare task_doc=" $( find_doc ${task_name} ) "
52+ [[ -z " ${task_doc} " ]] &&
53+ panic " Unable to find documentation file for '${task_name} '!"
5854
59- # finds the respective documentation file copying as "README.md", on the same
60- # directory where the respective task is located
61- echo " # Copying '${task_name} ' documentation file '${task_doc} '..."
62- cp -v -f ${task_doc} " ${task_dir} /README.md" ||
63- panic " Unable to copy '${task_doc} ' into '${task_dir} '"
55+ declare task_dir=" ${RELEASE_DIR} /tasks/${task_name} "
56+ [[ ! -d " ${task_dir} " ]] &&
57+ mkdir -p " ${task_dir} "
58+
59+ # rendering the helm template for the specific file, using the resource name for the
60+ # filename respectively
61+ echo " # Rendering '${task_name} ' at '${task_dir} '..."
62+ helm template --show-only=${t} . > ${task_dir} /${task_name} .yaml ||
63+ panic " Unable to render '${t} '!"
64+
65+ # finds the respective documentation file copying as "README.md", on the same
66+ # directory where the respective task is located
67+ echo " # Copying '${task_name} ' documentation file '${task_doc} '..."
68+ cp -v -f ${task_doc} " ${task_dir} /README.md" ||
69+ panic " Unable to copy '${task_doc} ' into '${task_dir} '"
70+ done
6471}
6572
6673release
0 commit comments