Compare commits
1 commit
main
...
deployment
Author | SHA1 | Date | |
---|---|---|---|
4ef3ad467d |
3 changed files with 39 additions and 18 deletions
|
@ -39,10 +39,9 @@ in
|
|||
];
|
||||
|
||||
nodes.deployer =
|
||||
{ pkgs, ... }:
|
||||
{ ... }:
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
jq
|
||||
environment.systemPackages = [
|
||||
deploy
|
||||
];
|
||||
|
||||
|
|
|
@ -31,11 +31,9 @@ in
|
|||
];
|
||||
|
||||
nodes.deployer =
|
||||
{ pkgs, ... }:
|
||||
{ ... }:
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
(pkgs.callPackage ../../run/tf-single-host/tf.nix { })
|
||||
jq
|
||||
environment.systemPackages = [
|
||||
deploy
|
||||
];
|
||||
|
||||
|
@ -50,10 +48,10 @@ in
|
|||
};
|
||||
|
||||
extraTestScript = ''
|
||||
with subtest("ssh: Check the status before deployment"):
|
||||
with subtest("Check the status before deployment"):
|
||||
target.fail("hello 1>&2")
|
||||
|
||||
with subtest("ssh: Run the deployment"):
|
||||
with subtest("Run the deployment"):
|
||||
deployer.succeed("""
|
||||
${lib.getExe deploy}
|
||||
""")
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
config,
|
||||
inputs,
|
||||
pkgs,
|
||||
sources ? import ../npins,
|
||||
...
|
||||
}:
|
||||
let
|
||||
|
@ -146,7 +147,18 @@ let
|
|||
deployment_type = "ssh-host";
|
||||
};
|
||||
in
|
||||
pkgs.writeShellScriptBin "deploy-ssh.sh" ''
|
||||
pkgs.writers.writeBashBin "deploy-sh.sh"
|
||||
{
|
||||
makeWrapperArgs = [
|
||||
"--prefix"
|
||||
"PATH"
|
||||
":"
|
||||
"${lib.makeBinPath [
|
||||
pkgs.jq
|
||||
]}"
|
||||
];
|
||||
}
|
||||
''
|
||||
env ${
|
||||
toString (lib.mapAttrsToList (k: v: "${k}=\"${toBash v}\"") environment)
|
||||
} bash ./deployment/run/ssh-single-host/run.sh
|
||||
|
@ -221,7 +233,19 @@ let
|
|||
};
|
||||
tf-env = pkgs.callPackage ./run/tf-single-host/tf-env.nix { };
|
||||
in
|
||||
pkgs.writeShellScriptBin "deploy-ssh.sh" ''
|
||||
pkgs.writers.writeBashBin "deploy-tf.sh"
|
||||
{
|
||||
makeWrapperArgs = [
|
||||
"--prefix"
|
||||
"PATH"
|
||||
":"
|
||||
"${lib.makeBinPath [
|
||||
pkgs.jq
|
||||
(pkgs.callPackage ./run/tf-single-host/tf.nix { inherit sources; })
|
||||
]}"
|
||||
];
|
||||
}
|
||||
''
|
||||
env ${toString (lib.mapAttrsToList (k: v: "TF_VAR_${k}=\"${toBash v}\"") environment)} \
|
||||
tf_env=${tf-env} bash ./deployment/run/tf-single-host/run.sh
|
||||
'';
|
||||
|
|
Loading…
Add table
Reference in a new issue