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";
|
version = "0.0.1";
|
||||||
releases = with pkgs.lib; attrsets.collect isDerivation releases;
|
releases = with pkgs.lib; attrsets.collect isDerivation releases;
|
||||||
src = ./.;
|
src = ./.;
|
||||||
|
buildInputs = [ pkgs.kustomize ];
|
||||||
phases = ["installPhase"];
|
phases = ["installPhase"];
|
||||||
installPhase = builtins.readFile ./lib/output.sh;
|
installPhase = builtins.readFile ./lib/output.sh;
|
||||||
};
|
};
|
||||||
|
|
|
@ -18,15 +18,23 @@ do
|
||||||
target=$(tr / - <<< "$path")
|
target=$(tr / - <<< "$path")
|
||||||
|
|
||||||
for drv in $releases; do
|
for drv in $releases; do
|
||||||
if grep -Eq "$target" <<< "$drv"; then
|
if grep -qE "$target" <<< "$drv"; then
|
||||||
ln -s "$drv" "$dir"
|
pushd "$dir" > /dev/null || exit 1
|
||||||
|
cp "$drv" ./RELEASE.yaml
|
||||||
|
|
||||||
for file in \
|
for file in \
|
||||||
$(find "$src/releases/$path" -type f -name "*.yaml" \
|
$(find "$src/releases/$path" -type f -name "*.yaml" \
|
||||||
| grep -v "values.yaml$")
|
| grep -v "values.yaml$")
|
||||||
do
|
do
|
||||||
ln -s "$file" "$dir"
|
cp "$file" .
|
||||||
done
|
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
|
fi
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue