mirror of
https://git.sr.ht/~magic_rb/cluster
synced 2024-11-25 09:36:14 +01:00
Minor edits and copy-containers script
Signed-off-by: Magic_RB <magic_rb@redalder.org>
This commit is contained in:
parent
b24d5a7c7d
commit
a70e37c9c3
40
flake.nix
40
flake.nix
|
@ -99,10 +99,50 @@
|
|||
devShell = forAllSystems (system:
|
||||
let
|
||||
pkgs = import nixpkgs { system = "x86_64-linux"; };
|
||||
copy-containers = pkgs.writeShellScriptBin "copy-containers"
|
||||
''
|
||||
_profile="$1"
|
||||
_address="$2"
|
||||
_selector="$3"
|
||||
|
||||
function profile_blowhole()
|
||||
{
|
||||
_images=("camptules" "gitea" "home-assistant" "hydra" \
|
||||
"minecraft" "mosquitto" "website" "zigbee2mqtt")
|
||||
|
||||
for _image in ''${_images[@]}
|
||||
do
|
||||
deploy $_address $_image
|
||||
done
|
||||
}
|
||||
|
||||
function profile_toothpick()
|
||||
{
|
||||
images=("ingress")
|
||||
|
||||
for _image in ''${_images[@]}
|
||||
do
|
||||
deploy $_address $_image
|
||||
done
|
||||
}
|
||||
|
||||
function deploy()
|
||||
{
|
||||
_address="$1"
|
||||
_image="$2"
|
||||
|
||||
nix build ".#ociImages.$_image.stream" -o result-script && \
|
||||
./result-script | ssh "$_address" docker load && \
|
||||
ssh "$_address" docker tag "nixng-$_image:latest" "nixng-$_image:local"
|
||||
}
|
||||
|
||||
"profile_$_profile"
|
||||
'';
|
||||
in
|
||||
pkgs.mkShell {
|
||||
nativeBuildInputs = with pkgs;
|
||||
[ nomad_1_1 consul vault jq
|
||||
copy-containers
|
||||
];
|
||||
}
|
||||
);
|
||||
|
|
|
@ -8,7 +8,6 @@ job "gateway-mesh" {
|
|||
mode = "bridge"
|
||||
|
||||
port "mesh_wan" {
|
||||
host_network = "vpn"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -50,16 +50,8 @@ job "website" {
|
|||
task "apache" {
|
||||
driver = "docker"
|
||||
|
||||
artifact {
|
||||
source = "http://hydra.redalder.org/build/101/download/1/image.tar.gz"
|
||||
options {
|
||||
archive = false
|
||||
}
|
||||
}
|
||||
|
||||
config {
|
||||
load = "image.tar.gz"
|
||||
image = "nixng-website"
|
||||
image = "nixng-website:local"
|
||||
memory_hard_limit = 64
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue