This commit is contained in:
parent
8691ee354c
commit
9d3313d5c5
2 changed files with 10 additions and 13 deletions
|
@ -19,9 +19,9 @@ steps:
|
||||||
image: docker.io/jcollie/nixos-runner:latest
|
image: docker.io/jcollie/nixos-runner:latest
|
||||||
pull: always
|
pull: always
|
||||||
commands:
|
commands:
|
||||||
- set
|
# - set
|
||||||
- nix run .#login
|
- nix run .#login
|
||||||
# - echo -n "$${PLUGIN_PASSWORD}" | podman login --username $${PLUGIN_USERNAME} --password-stdin $${PLUGIN_REGISTRY}
|
- echo -n "$${PLUGIN_PASSWORD}" | podman login --username $${PLUGIN_USERNAME} --password-stdin $${PLUGIN_REGISTRY}
|
||||||
- nix build .#nixos-runner
|
- nix build .#nixos-runner
|
||||||
# - nix run .#push-container -- result
|
# - nix run .#push-container -- result
|
||||||
- podman load --input result | sed -n -e "s/Loaded image:.\\(.*\\)/\\1/p" > loaded-image
|
- podman load --input result | sed -n -e "s/Loaded image:.\\(.*\\)/\\1/p" > loaded-image
|
||||||
|
@ -30,7 +30,7 @@ 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}:$${DRONE_BUILD_NUMBER}-$${DRONE_COMMIT_SHA:0:8}"
|
||||||
- podman tag "$$(<loaded-image)" "$${PLUGIN_REGISTRY}/${PLUGIN_REPOSITORY}:latest"
|
- podman tag "$$(<loaded-image)" "$${PLUGIN_REGISTRY}/${PLUGIN_REPOSITORY}:latest"
|
||||||
- podman images
|
- podman images
|
||||||
- podman push "$${PLUGIN_REGISTRY}/$${PLUGIN_REPOSITORY}:${DRONE_BUILD_NUMBER}-${DRONE_COMMIT_SHA:0:8}"
|
- 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}:latest"
|
||||||
- podman logout "$${PLUGIN_REGISTRY}"
|
- podman logout "$${PLUGIN_REGISTRY}"
|
||||||
env:
|
env:
|
||||||
|
|
17
flake.nix
17
flake.nix
|
@ -383,22 +383,19 @@
|
||||||
];
|
];
|
||||||
executable = true;
|
executable = true;
|
||||||
};
|
};
|
||||||
|
login-script = pkgs.writeScriptBin "login-script" ''
|
||||||
|
echo -n "''${PLUGIN_PASSWORD}" | ${pkgs.podman}/bin/podman login --username "''${PLUGIN_USERNAME}" --password-stdin "''${PLUGIN_REGISTRY}"
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
apps = {
|
apps = {
|
||||||
push-container = {
|
push-container = {
|
||||||
type = "app";
|
type = "app";
|
||||||
program = "${self.packages.${system}.push-container}/bin/push-container";
|
program = "${self.packages.${system}.push-container}/bin/push-container";
|
||||||
};
|
};
|
||||||
login =
|
login = {
|
||||||
let
|
type = "app";
|
||||||
program = pkgs.writeScript "program" ''
|
program = "${self.packages.${system}.login-script}/bin/login-script";
|
||||||
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