From 9817e35967ab308e5b6d8e7b2d2c6008cca9d775 Mon Sep 17 00:00:00 2001 From: "Jeffrey C. Ollie" Date: Sat, 15 Apr 2023 17:40:37 -0500 Subject: [PATCH] update --- flake.nix | 7 ++++--- push-container.nu | 6 +++++- 2 files changed, 9 insertions(+), 4 deletions(-) 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 }