-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
helm-fan-out script to prepare a release. #46
Conversation
Each file need to be on its own file to be released (and taken into account but `catalog-cd release`. This adds a script to do that, in preparation of a "make release" target. Signed-off-by: Vincent Demeester <[email protected]>
#!/usr/bin/env bash | ||
# Based on https://github.com/helm/helm/issues/4680#issuecomment-1152289297 | ||
# helm-fan-out | ||
|
||
if [ -z "$1" ]; then | ||
echo "Please provide an output directory" | ||
exit 1 | ||
fi | ||
|
||
awk -vout="$1" -F": " ' | ||
$0~/^# Source: / { | ||
file=out"/"$2; | ||
if (!(file in filemap)) { | ||
filemap[file] = 1 | ||
print "Creating "file; | ||
system ("mkdir -p $(dirname "file")"); | ||
} | ||
print "---" >> file; | ||
} | ||
$0!~/^# Source: / { | ||
if ($0!~/^---$/) { | ||
if (file) { | ||
print $0 >> file; | ||
} | ||
} | ||
}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can use helm template
to render the individual files by adopting the --show-only
flag. As in the following example:
for t in $(ls -1 templates/task-*.yaml); do
task_file="$(basename ${t})"
echo "# Rendering template ${t} into ${task_file}"
make helm-template ARGS="--show-only=${t}" >/tmp/${task_file}
done
A better place for this is the Makefile
, adding a new helm-template-tasks
target, i.e.:
helm-template-tasks:
for t in $(ls -1 templates/task-*.yaml); do
helm template --show-only=${t} >/tmp/`basename ${t}``
done
With a configurable directory instead of /tmp
like on the example above. So the task repository can prepare it's own files for later release.
WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting, I didn't know that, it would definitely be better then.
Each file need to be on its own file to be released (and taken into
account but
catalog-cd release
. This adds a script to do that, inpreparation of a "make release" target.
Signed-off-by: Vincent Demeester [email protected]