Minor edits and copy-containers script

Signed-off-by: Magic_RB <magic_rb@redalder.org>
This commit is contained in:
Magic_RB 2022-01-18 00:25:15 +01:00
parent b24d5a7c7d
commit a70e37c9c3
No known key found for this signature in database
GPG key ID: 08D5287CC5DDCA0E
3 changed files with 41 additions and 10 deletions

View file

@ -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
]; ];
} }
); );

View file

@ -8,7 +8,6 @@ job "gateway-mesh" {
mode = "bridge" mode = "bridge"
port "mesh_wan" { port "mesh_wan" {
host_network = "vpn"
} }
} }

View file

@ -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
} }