diff --git a/flake.nix b/flake.nix index 2a46b90..0d83770 100644 --- a/flake.nix +++ b/flake.nix @@ -369,9 +369,10 @@ script = pkgs.writeTextFile { name = "push-container"; - text = '' - #!${pkgs.nushell}/bin/nu - '' + (builtins.readFile ./push-container.nu); + text = lib.concatStringsSep "\n" [ + "#!${pkgs.nushell}/bin/nu" + (builtins.readFile ./push-container.nu) + ]; executable = true; }; in diff --git a/push-container.nu b/push-container.nu index edb9c28..4de68fe 100644 --- a/push-container.nu +++ b/push-container.nu @@ -72,16 +72,20 @@ def main [ exit 1 } + print "XXX" $env.PLUGIN_PASSWORD | podman login --username $env.PLUGIN_USERNAME --password-stdin $env.PLUGIN_REGISTRY + print "YYY" let old_image = (podman load --input $input | parse "Loaded image: {image}" | get 0.image) + print "ZZZ" print $old_image podman images $tags | each { |tag| let new_image = $"($env.PLUGIN_REGISTRY)/($env.PLUGIN_REPOSITORY):($tag)" + print $new_image podman tag $old_image $new_image podman push $new_image } podman images - podman logout "''${PLUGIN_REGISTRY}" + podman logout $env.PLUGIN_REGISTRY }