mirror of
https://git.sr.ht/~goorzhel/turboprop
synced 2024-12-14 11:37:37 +00:00
Add Kustomizations for each release in output
This commit is contained in:
parent
e6ee6049bf
commit
7d912d6ba4
2 changed files with 12 additions and 3 deletions
|
@ -49,6 +49,7 @@
|
|||
version = "0.0.1";
|
||||
releases = with pkgs.lib; attrsets.collect isDerivation releases;
|
||||
src = ./.;
|
||||
buildInputs = [ pkgs.kustomize ];
|
||||
phases = ["installPhase"];
|
||||
installPhase = builtins.readFile ./lib/output.sh;
|
||||
};
|
||||
|
|
|
@ -18,15 +18,23 @@ do
|
|||
target=$(tr / - <<< "$path")
|
||||
|
||||
for drv in $releases; do
|
||||
if grep -Eq "$target" <<< "$drv"; then
|
||||
ln -s "$drv" "$dir"
|
||||
if grep -qE "$target" <<< "$drv"; then
|
||||
pushd "$dir" > /dev/null || exit 1
|
||||
cp "$drv" ./RELEASE.yaml
|
||||
|
||||
for file in \
|
||||
$(find "$src/releases/$path" -type f -name "*.yaml" \
|
||||
| grep -v "values.yaml$")
|
||||
do
|
||||
ln -s "$file" "$dir"
|
||||
cp "$file" .
|
||||
done
|
||||
|
||||
kustomize create
|
||||
# shellcheck disable=SC2035
|
||||
# Can't use "./", otherwise the kustomization is added to itself.
|
||||
kustomize edit add resource *.yaml
|
||||
|
||||
popd > /dev/null || exit 1
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue