mirror of
https://git.sr.ht/~magic_rb/cluster
synced 2024-11-22 08:04:20 +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:
|
devShell = forAllSystems (system:
|
||||||
let
|
let
|
||||||
pkgs = import nixpkgs { system = "x86_64-linux"; };
|
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
|
in
|
||||||
pkgs.mkShell {
|
pkgs.mkShell {
|
||||||
nativeBuildInputs = with pkgs;
|
nativeBuildInputs = with pkgs;
|
||||||
[ nomad_1_1 consul vault jq
|
[ nomad_1_1 consul vault jq
|
||||||
|
copy-containers
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
|
@ -8,7 +8,6 @@ job "gateway-mesh" {
|
||||||
mode = "bridge"
|
mode = "bridge"
|
||||||
|
|
||||||
port "mesh_wan" {
|
port "mesh_wan" {
|
||||||
host_network = "vpn"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -50,16 +50,8 @@ job "website" {
|
||||||
task "apache" {
|
task "apache" {
|
||||||
driver = "docker"
|
driver = "docker"
|
||||||
|
|
||||||
artifact {
|
|
||||||
source = "http://hydra.redalder.org/build/101/download/1/image.tar.gz"
|
|
||||||
options {
|
|
||||||
archive = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
config {
|
config {
|
||||||
load = "image.tar.gz"
|
image = "nixng-website:local"
|
||||||
image = "nixng-website"
|
|
||||||
memory_hard_limit = 64
|
memory_hard_limit = 64
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue