Home

dotnix @main - refs - log -
-
https://git.jolheiser.com/dotnix.git
My nix dotfiles
tree log patch
feat: teamcity Signed-off-by: jolheiser <john.olheiser@gmail.com>
Signature
-----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEgqEQpE3xoo1QwJO/uFOtpdp7v3oFAmaFnOYACgkQuFOtpdp7 v3qpURAAui3UgNdVchi3xOTrlMIiVCLi7n7+ObVCOEa/4o1J6Hi5G6X+YAYfG8cp /CxkYIXA3Wr+YQwU2YCxU4Q7uwEyhpk8eJd62/qRXuX095IOXknWBUbS+TbrTR5Y 4QLnabM7zkAgJZpJiQnLZsx+DiIXCYBh5e1JLxF711eNgI6Xi5hei44nrczC+skO BG99+oTjBI8qZoGB75VTWRf7bmVF7C0RfQDTMCy6/dpHxWF2Td8aF9X0asVrtABg wumbtpasHQsK6PoWAbfqyZ7qNjJjQwGD4SroIPKu+0C6INCg3mgEDh9quYsKKU4c qT4aMA+owScGHj4pk0eZPxy5FoTg0RrUndPk7bP2OJmie7bL7VIpOHuwjN09p4VJ +uYZfc86ewS9eRWm03jGN4j+wbdzxHWP9JBRcjNkXNaVmbyAUX5Qbu3NZORwO3JD pxG+uZa2+RUEg7iVpTY0rumR2LBm6mBLgqw8Ba6a3AWrwPk3oRtgIIaWEqndtAOJ RHpDnowhLhszqvKzpUYnMUOFB6yXvt5Qp8S415U7eAEGbyVeO4iNarfqfQqCgzD9 2wgeqZXy1dC0nUqQmH6c0odDA/6Ms0Kxsst7n2drQnMwBT5ripbGq5DX9ypQJwN2 +W2P69VW4aK9ziZah95IVkiygYHpE1z2YujbmfCBMK2mKW22orE= =+7GW -----END PGP SIGNATURE-----
jolheiser <john.olheiser@gmail.com>
5 months ago
6 changed files, 181 additions(+), 1 deletions(-)
M machines/dragonwell/default.nix -> machines/dragonwell/default.nix
diff --git a/machines/dragonwell/default.nix b/machines/dragonwell/default.nix
index 9ba27149e6cae14925606122bc2e41141cc05185..aa70fd753286749a89dc44af9ec37f4eb804b868 100644
--- a/machines/dragonwell/default.nix
+++ b/machines/dragonwell/default.nix
@@ -2,7 +2,7 @@ let
   username = "jolheiser";
   key = ''ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDfKqCWtDlS3tgvfT6hQN+ii8UtabIZ+ZNmYN+bLwIa8PHOEW5MbfaqXSlhKkSi4+7SfQDCHphw0SMfhsQ4qMEcoywZ+4niDgKlQEVkl+S/VGbLuPe92NRStkyreZBLPr3Rh7ScNlGHcmHmoV9v7725fMnsMmabGVhpGO84PwNHOfJyv2tx2h6LxFbAV8S44UQu2lc8YLWCK2UvKuRnBerBXLnDQThUUX8UuCFzb786gQzD5XDU0MENbByxiy0XdVGAC+tFXEiSIgFZlFbFYyShgdTP9MzX2MOglEi+ae+1UIFncraW7ptUey7qHFJylpHWWWvE+GTwsg2G50i0FvFj jolheiser@jolheiser'';
 in {
-  imports = [./caddy.nix ./dex.nix ./golink.nix ./gotosocial.nix ./restic.nix ./tandoor.nix ./ugit.nix ./vikunja.nix ./hardware.nix];
+  imports = [./caddy.nix ./dex.nix ./golink.nix ./gotosocial.nix ./restic.nix ./tandoor.nix ./teamcity ./ugit.nix ./vikunja.nix ./hardware.nix];
 
   boot.tmp.cleanOnBoot = true;
   zramSwap.enable = true;
I machines/dragonwell/teamcity/README.md
diff --git a/machines/dragonwell/teamcity/README.md b/machines/dragonwell/teamcity/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..6a451a7e7386d12ecc76c35b46771e066ebcc424
--- /dev/null
+++ b/machines/dragonwell/teamcity/README.md
@@ -0,0 +1,9 @@
+To generate the nix file, use either of the following commands depending on whether you're in the root dir or not:
+
+```sh
+nix run github:aksiksi/compose2nix -- --inputs machines/dragonwell/teamcity.yml --output machines/dragonwell/teamcity.nix --runtime docker
+```
+
+```sh
+nix run github:aksiksi/compose2nix -- --inputs teamcity.yml --output teamcity.nix --runtime docker
+```
I machines/dragonwell/teamcity/buildAgent.properties
diff --git a/machines/dragonwell/teamcity/buildAgent.properties b/machines/dragonwell/teamcity/buildAgent.properties
new file mode 100644
index 0000000000000000000000000000000000000000..5ff79b273e7199f213e69bb99da2307f656ea80e
--- /dev/null
+++ b/machines/dragonwell/teamcity/buildAgent.properties
@@ -0,0 +1,9 @@
+name=Agent 1
+ownPort=9090
+serverUrl=http\://teamcity\:8111
+
+workDir=../work
+tempDir=../temp
+systemDir=../system
+
+teamcity.docker.use.sudo=true
I machines/dragonwell/teamcity/default.nix
diff --git a/machines/dragonwell/teamcity/default.nix b/machines/dragonwell/teamcity/default.nix
new file mode 100644
index 0000000000000000000000000000000000000000..79425e73dd569c5971174b64fdc543c1556a4604
--- /dev/null
+++ b/machines/dragonwell/teamcity/default.nix
@@ -0,0 +1,3 @@
+{
+  imports = [./teamcity-compose.nix];
+}
I machines/dragonwell/teamcity/teamcity.nix
diff --git a/machines/dragonwell/teamcity/teamcity.nix b/machines/dragonwell/teamcity/teamcity.nix
new file mode 100644
index 0000000000000000000000000000000000000000..46fedeb51ebef45f2f8178bb7772137494aa90e2
--- /dev/null
+++ b/machines/dragonwell/teamcity/teamcity.nix
@@ -0,0 +1,136 @@
+# Auto-generated using compose2nix v0.2.0-pre.
+{
+  pkgs,
+  lib,
+  ...
+}: {
+  # Runtime
+  virtualisation.docker = {
+    enable = true;
+    autoPrune.enable = true;
+  };
+  virtualisation.oci-containers.backend = "docker";
+
+  # Containers
+  virtualisation.oci-containers.containers."teamcity-teamcity" = {
+    image = "jetbrains/teamcity-server:2024.03.3";
+    volumes = [
+      "/var/lib/teamcity/logs:/opt/teamcity/logs:rw"
+      "/var/lib/teamcity/server:/data/teamcity_server/datadir:rw"
+    ];
+    ports = [
+      "8112:8111/tcp"
+    ];
+    log-driver = "journald";
+    extraOptions = [
+      "--network-alias=teamcity"
+      "--network=teamcity_default"
+    ];
+  };
+  systemd.services."docker-teamcity-teamcity" = {
+    serviceConfig = {
+      Restart = lib.mkForce "no";
+    };
+    after = [
+      "docker-network-teamcity_default.service"
+    ];
+    requires = [
+      "docker-network-teamcity_default.service"
+    ];
+    partOf = [
+      "docker-compose-teamcity-root.target"
+    ];
+    wantedBy = [
+      "docker-compose-teamcity-root.target"
+    ];
+  };
+  virtualisation.oci-containers.containers."teamcity-teamcity-agent-1" = {
+    image = "jetbrains/teamcity-agent:2024.03.3-linux-sudo";
+    environment = {
+      DOCKER_IN_DOCKER = "start";
+    };
+    volumes = [
+      "/var/lib/teamcity/agent-1/conf:/data/teamcity_agent/conf:rw"
+    ];
+    log-driver = "journald";
+    extraOptions = [
+      "--network-alias=teamcity-agent-1"
+      "--network=teamcity_default"
+      "--privileged"
+    ];
+  };
+  systemd.services."docker-teamcity-teamcity-agent-1" = {
+    serviceConfig = {
+      Restart = lib.mkForce "no";
+    };
+    after = [
+      "docker-network-teamcity_default.service"
+    ];
+    requires = [
+      "docker-network-teamcity_default.service"
+    ];
+    partOf = [
+      "docker-compose-teamcity-root.target"
+    ];
+    wantedBy = [
+      "docker-compose-teamcity-root.target"
+    ];
+  };
+  virtualisation.oci-containers.containers."teamcity-teamcity-agent-2" = {
+    image = "jetbrains/teamcity-agent:2024.03.3-linux-sudo";
+    environment = {
+      DOCKER_IN_DOCKER = "start";
+    };
+    volumes = [
+      "/var/lib/teamcity/agent-2/conf:/data/teamcity_agent/conf:rw"
+    ];
+    log-driver = "journald";
+    extraOptions = [
+      "--network-alias=teamcity-agent-2"
+      "--network=teamcity_default"
+      "--privileged"
+    ];
+  };
+  systemd.services."docker-teamcity-teamcity-agent-2" = {
+    serviceConfig = {
+      Restart = lib.mkForce "no";
+    };
+    after = [
+      "docker-network-teamcity_default.service"
+    ];
+    requires = [
+      "docker-network-teamcity_default.service"
+    ];
+    partOf = [
+      "docker-compose-teamcity-root.target"
+    ];
+    wantedBy = [
+      "docker-compose-teamcity-root.target"
+    ];
+  };
+
+  # Networks
+  systemd.services."docker-network-teamcity_default" = {
+    path = [pkgs.docker];
+    serviceConfig = {
+      Type = "oneshot";
+      RemainAfterExit = true;
+      ExecStop = "${pkgs.docker}/bin/docker network rm -f teamcity_default";
+    };
+    script = ''
+      docker network inspect teamcity_default || docker network create teamcity_default
+    '';
+    partOf = ["docker-compose-teamcity-root.target"];
+    wantedBy = ["docker-compose-teamcity-root.target"];
+  };
+
+  # Root service
+  # When started, this will automatically create all resources and start
+  # the containers. When stopped, this will teardown all resources.
+  systemd.targets."docker-compose-teamcity-root" = {
+    unitConfig = {
+      Description = "Root target generated by compose2nix.";
+    };
+    wantedBy = ["multi-user.target"];
+  };
+}
I machines/dragonwell/teamcity/teamcity.yml
diff --git a/machines/dragonwell/teamcity/teamcity.yml b/machines/dragonwell/teamcity/teamcity.yml
new file mode 100644
index 0000000000000000000000000000000000000000..d29e94ed7440564e444ec30fed1a08f7537c6ece
--- /dev/null
+++ b/machines/dragonwell/teamcity/teamcity.yml
@@ -0,0 +1,23 @@
+name: teamcity
+services:
+  teamcity:
+    image: jetbrains/teamcity-server:2024.03.3
+    ports:
+      - "8112:8111"
+    volumes:
+      - /var/lib/teamcity/server:/data/teamcity_server/datadir
+      - /var/lib/teamcity/logs:/opt/teamcity/logs
+  teamcity-agent-1:
+    image: jetbrains/teamcity-agent:2024.03.3-linux-sudo
+    privileged: true
+    volumes:
+      - /var/lib/teamcity/agent-1/conf:/data/teamcity_agent/conf
+    environment:
+      - DOCKER_IN_DOCKER=start
+  teamcity-agent-2:
+    image: jetbrains/teamcity-agent:2024.03.3-linux-sudo
+    privileged: true
+    volumes:
+      - /var/lib/teamcity/agent-2/conf:/data/teamcity_agent/conf
+    environment:
+      - DOCKER_IN_DOCKER=start