This commit is contained in:
parent
d733df4484
commit
b9d1389444
2 changed files with 22 additions and 7 deletions
|
@ -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
|
||||||
|
|
21
flake.nix
21
flake.nix
|
@ -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}";
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue