test
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Jeffrey C. Ollie 2023-04-15 15:00:08 -05:00
parent d733df4484
commit b9d1389444
Signed by: jeff
GPG key ID: 6F86035A6D97044E
2 changed files with 22 additions and 7 deletions

View file

@ -20,13 +20,7 @@ steps:
pull: always pull: always
commands: commands:
- nix build .#nixos-runner - nix build .#nixos-runner
- echo -n "${plugin_password}" | podman login --username "${plugin_username}" --password-stdin "${plugin_registry}" - nix run .#push-container -- result
- image=$(podman load --input result | sed -n -e "s/Loaded image:.\\(.*\\)/\\1/p")
- podman images
- podman tag "${image}" "${plugin_registry}/${plugin_repository}:${DRONE_BUILD_NUMBER}-${DRONE_COMMIT_SHA:0:8}"
- podman tag "${image}" "${plugin_registry}/${plugin_repository}:latest"
- podman images
- podman logout "${plugin_registry}"
settings: settings:
registry: docker.io registry: docker.io
repository: jcollie/nixos-runner repository: jcollie/nixos-runner

View file

@ -362,6 +362,27 @@
}; };
}; };
}; };
apps = {
push-container =
let
script = pkgs.writeScript "push-container" ''
set | grep -i plugin
set | grep -i DRONE
ls -l "''${1}"
echo -n "''${PLUGIN_PASSWORD}" | podman login --username "''${PLUGIN_USERNAME}" --password-stdin "''${PLUGIN_REGISTRY}"
image=''$(podman load --input "''${1}" | sed -n -e "s/Loaded image:.\\(.*\\)/\\1/p")
podman images
podman tag "''${image}" "''${PLUGIN_REGISTRY}/''${PLUGIN_REPOSITORY}:''${DRONE_BUILD_NUMBER}-''${DRONE_COMMIT_SHA:0:8}"
podman tag "''${image}" "''${PLUGIN_REGISTRY}/''${PLUGIN_REPOSITORY}:latest"
podman images
podman logout "''${PLUGIN_REGISTRY}"
'';
in
{
type = "app";
program = "${script}";
};
};
} }
) )
); );