mirror of
https://github.com/TECHNOFAB11/kubenix.git
synced 2025-12-13 08:30:05 +01:00
WIP: test refactoring
This commit is contained in:
parent
8ad3b90a52
commit
bbc5e3d477
17 changed files with 714 additions and 66 deletions
|
|
@ -4,12 +4,12 @@ with lib;
|
|||
|
||||
{
|
||||
copyDockerImages = { images, dest, args ? "" }:
|
||||
pkgs.writeScriptBin "copy-docker-images" (concatMapStrings (image: ''
|
||||
#!${pkgs.bash}/bin/bash
|
||||
pkgs.writeScript "copy-docker-images.sh" (concatMapStrings (image: ''
|
||||
#!${pkgs.runtimeShell}
|
||||
|
||||
set -e
|
||||
|
||||
echo "copying ${image.imageName}:${image.imageTag}"
|
||||
echo "copying '${image.imageName}:${image.imageTag}' to '${dest}/${image.imageName}:${image.imageTag}'"
|
||||
${pkgs.skopeo}/bin/skopeo copy ${args} $@ docker-archive:${image} ${dest}/${image.imageName}:${image.imageTag}
|
||||
'') images);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,6 +30,12 @@ rec {
|
|||
remarshal -i ${pkgs.writeText "to-json" (builtins.toJSON config)} -if json -of yaml > $out
|
||||
'');
|
||||
|
||||
toMultiDocumentYaml = name: documents: pkgs.runCommand name {
|
||||
buildInputs = [ pkgs.remarshal ];
|
||||
} (concatMapStringsSep "\necho --- >> $out\n" (d:
|
||||
"remarshal -i ${builtins.toFile "doc" (builtins.toJSON d)} -if json -of yaml >> $out"
|
||||
) documents);
|
||||
|
||||
toBase64 = value:
|
||||
builtins.readFile
|
||||
(pkgs.runCommand "value-to-b64" {} "echo -n '${value}' | ${pkgs.coreutils}/bin/base64 -w0 > $out");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue