This commit is contained in:
parent
3a93c99748
commit
8691ee354c
2 changed files with 14 additions and 4 deletions
|
@ -20,8 +20,8 @@ steps:
|
|||
pull: always
|
||||
commands:
|
||||
- set
|
||||
- echo "$${PLUGIN_USERNAME}" "$${USERNAME}"
|
||||
- echo -n "$${PLUGIN_PASSWORD}" | podman login --username $${PLUGIN_USERNAME} --password-stdin $${PLUGIN_REGISTRY}
|
||||
- nix run .#login
|
||||
# - echo -n "$${PLUGIN_PASSWORD}" | podman login --username $${PLUGIN_USERNAME} --password-stdin $${PLUGIN_REGISTRY}
|
||||
- nix build .#nixos-runner
|
||||
# - nix run .#push-container -- result
|
||||
- podman load --input result | sed -n -e "s/Loaded image:.\\(.*\\)/\\1/p" > loaded-image
|
||||
|
@ -30,8 +30,8 @@ steps:
|
|||
- podman tag "$$(<loaded-image)" "$${PLUGIN_REGISTRY}/${PLUGIN_REPOSITORY}:$${DRONE_BUILD_NUMBER}-$${DRONE_COMMIT_SHA:0:8}"
|
||||
- podman tag "$$(<loaded-image)" "$${PLUGIN_REGISTRY}/${PLUGIN_REPOSITORY}:latest"
|
||||
- podman images
|
||||
- podman push "$${PLUGIN_REGISTRY}/${PLUGIN_REPOSITORY}:${DRONE_BUILD_NUMBER}-${DRONE_COMMIT_SHA:0:8}"
|
||||
- podman push "$${PLUGIN_REGISTRY}/${PLUGIN_REPOSITORY}:latest"
|
||||
- podman push "$${PLUGIN_REGISTRY}/$${PLUGIN_REPOSITORY}:${DRONE_BUILD_NUMBER}-${DRONE_COMMIT_SHA:0:8}"
|
||||
- podman push "$${PLUGIN_REGISTRY}/$${PLUGIN_REPOSITORY}:latest"
|
||||
- podman logout "$${PLUGIN_REGISTRY}"
|
||||
env:
|
||||
REGISTRY: docker.io
|
||||
|
|
10
flake.nix
10
flake.nix
|
@ -389,6 +389,16 @@
|
|||
type = "app";
|
||||
program = "${self.packages.${system}.push-container}/bin/push-container";
|
||||
};
|
||||
login =
|
||||
let
|
||||
program = pkgs.writeScript "program" ''
|
||||
echo -n "''${PLUGIN_PASSWORD}" | ${pkgs.podman}/bin/podman login --username "''${PLUGIN_USERNAME}" --password-stdin "''${PLUGIN_REGISTRY}"
|
||||
'';
|
||||
in
|
||||
{
|
||||
type = "app";
|
||||
program = "${program}";
|
||||
};
|
||||
};
|
||||
}
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue