flora-6: init drone docker runner
This commit is contained in:
parent
90b182e499
commit
7a7ff7b1df
|
@ -1,10 +1,10 @@
|
||||||
{ config
|
|
||||||
, lib
|
|
||||||
, pkgs
|
|
||||||
, self
|
|
||||||
, ...
|
|
||||||
}:
|
|
||||||
{
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
self,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
age.secrets.drone-secrets = {
|
age.secrets.drone-secrets = {
|
||||||
file = "${self}/secrets/drone-secrets.age";
|
file = "${self}/secrets/drone-secrets.age";
|
||||||
mode = "600";
|
mode = "600";
|
||||||
|
@ -31,12 +31,10 @@
|
||||||
"d '/var/lib/drone-db' 0750 drone drone - -"
|
"d '/var/lib/drone-db' 0750 drone drone - -"
|
||||||
];
|
];
|
||||||
|
|
||||||
system.activationScripts.mkDroneNet =
|
system.activationScripts.mkDroneNet = let
|
||||||
let
|
|
||||||
docker = config.virtualisation.oci-containers.backend;
|
docker = config.virtualisation.oci-containers.backend;
|
||||||
dockerBin = "${pkgs.${docker}}/bin/${docker}";
|
dockerBin = "${pkgs.${docker}}/bin/${docker}";
|
||||||
in
|
in ''
|
||||||
''
|
|
||||||
${dockerBin} network inspect drone-net >/dev/null 2>&1 || ${dockerBin} network create drone-net --subnet 172.20.0.0/24
|
${dockerBin} network inspect drone-net >/dev/null 2>&1 || ${dockerBin} network create drone-net --subnet 172.20.0.0/24
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
@ -82,6 +80,28 @@
|
||||||
config.age.secrets.drone-secrets.path
|
config.age.secrets.drone-secrets.path
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
containers."drone-docker-runner" = {
|
||||||
|
image = "drone/drone-runner-docker:1";
|
||||||
|
autoStart = true;
|
||||||
|
# needs to run as root
|
||||||
|
#user = "994";
|
||||||
|
volumes = [
|
||||||
|
"/var/run/docker.sock:/var/run/docker.sock"
|
||||||
|
];
|
||||||
|
dependsOn = ["drone-db"];
|
||||||
|
extraOptions = [
|
||||||
|
"--network=drone-net"
|
||||||
|
];
|
||||||
|
environment = {
|
||||||
|
DRONE_SERVER_HOST = "ci.pub.solar";
|
||||||
|
DRONE_SERVER_PROTO = "https";
|
||||||
|
DRONE_RUNNER_CAPACITY = "2";
|
||||||
|
DRONE_RUNNER_NAME = "flora-6-docker-runner";
|
||||||
|
};
|
||||||
|
environmentFiles = [
|
||||||
|
config.age.secrets.drone-secrets.path
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue