Fix Prometheus and Woodpecker (#17)

This commit is contained in:
Patrick Stevens
2023-07-23 10:23:08 +01:00
committed by GitHub
parent e5254f4e1c
commit e8cf9916ee
6 changed files with 17 additions and 3 deletions

View File

@@ -33,6 +33,7 @@ in {
services.miniflux-config.domain = userConfig.domain;
services.woodpecker-config.domain = userConfig.domain;
services.grafana-config.domain = userConfig.domain;
services.prometheus-config.domain-exporter-domains = [userConfig.domain];
system.stateVersion = "23.05";

View File

@@ -16,13 +16,21 @@
description = lib.mdDoc "Localhost port for node exporter";
default = 9003;
};
domain-exporter-domains = lib.mkOption {
type = lib.types.listOf lib.types.str;
description = lib.mdDoc "Paths to be interpolated into the domain-exporter config.";
example = "example.com";
};
};
};
config = {
# For the domain exporter
environment.etc."domain-exporter/domains.yaml" = {
source = builtins.replaceStrings ["%%DOMAINS%%"] ["patrickstevens.co.uk"] ./domains.yaml;
text = let
interp = builtins.concatStringsSep "\", \"" config.services.prometheus-config.domain-exporter-domains;
in
builtins.replaceStrings ["%%DOMAINS%%"] [interp] (builtins.readFile ./domains.yaml);
};
services.prometheus = {

View File

@@ -3,7 +3,7 @@ version: '3'
services:
woodpecker-server:
image: woodpeckerci/woodpecker-server:latest
image: woodpeckerci/woodpecker-server:next
ports: ["%%WOODPECKER_PORT%%:8000"]
volumes:
- woodpecker-server-data:/var/lib/woodpecker
@@ -17,7 +17,7 @@ services:
- WOODPECKER_AGENT_SECRET=${WOODPECKER_AGENT_SECRET}
woodpecker-agent:
image: woodpeckerci/woodpecker-agent:latest
image: woodpeckerci/woodpecker-agent:next
command: agent
restart: always
depends_on: [woodpecker-server]

View File

@@ -0,0 +1,3 @@
#!/bin/sh
"$DOCKER" compose -f "/etc/woodpecker.yaml" down

View File

@@ -44,6 +44,7 @@
wantedBy = ["multi-user.target"];
path = [pkgs.docker];
script = builtins.readFile ./start.sh;
preStop = builtins.readFile ./stop.sh;
serviceConfig = {
Restart = "on-failure";
Type = "exec";

View File

@@ -46,6 +46,7 @@
<Content Include="Nix\woodpecker\compose.yaml" />
<Content Include="Nix\woodpecker\start.sh" />
<Content Include="Nix\woodpecker\woodpecker.nix" />
<Content Include="Nix\woodpecker\stop.sh" />
<Content Include="Nix\grafana\grafana.nix" />
<Content Include="Nix\grafana\node.json" />
<Content Include="Nix\prometheus\prometheus.nix" />