feat: teamcity

Signed-off-by: jolheiser <john.olheiser@gmail.com>
teamcity
jolheiser 2024-07-03 13:48:06 -05:00
parent 4c9de84663
commit 94aa7e53b7
Signed by: jolheiser
GPG Key ID: B853ADA5DA7BBF7A
6 changed files with 181 additions and 1 deletions

View File

@ -2,7 +2,7 @@ let
username = "jolheiser"; username = "jolheiser";
key = ''ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDfKqCWtDlS3tgvfT6hQN+ii8UtabIZ+ZNmYN+bLwIa8PHOEW5MbfaqXSlhKkSi4+7SfQDCHphw0SMfhsQ4qMEcoywZ+4niDgKlQEVkl+S/VGbLuPe92NRStkyreZBLPr3Rh7ScNlGHcmHmoV9v7725fMnsMmabGVhpGO84PwNHOfJyv2tx2h6LxFbAV8S44UQu2lc8YLWCK2UvKuRnBerBXLnDQThUUX8UuCFzb786gQzD5XDU0MENbByxiy0XdVGAC+tFXEiSIgFZlFbFYyShgdTP9MzX2MOglEi+ae+1UIFncraW7ptUey7qHFJylpHWWWvE+GTwsg2G50i0FvFj jolheiser@jolheiser''; key = ''ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDfKqCWtDlS3tgvfT6hQN+ii8UtabIZ+ZNmYN+bLwIa8PHOEW5MbfaqXSlhKkSi4+7SfQDCHphw0SMfhsQ4qMEcoywZ+4niDgKlQEVkl+S/VGbLuPe92NRStkyreZBLPr3Rh7ScNlGHcmHmoV9v7725fMnsMmabGVhpGO84PwNHOfJyv2tx2h6LxFbAV8S44UQu2lc8YLWCK2UvKuRnBerBXLnDQThUUX8UuCFzb786gQzD5XDU0MENbByxiy0XdVGAC+tFXEiSIgFZlFbFYyShgdTP9MzX2MOglEi+ae+1UIFncraW7ptUey7qHFJylpHWWWvE+GTwsg2G50i0FvFj jolheiser@jolheiser'';
in { 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; boot.tmp.cleanOnBoot = true;
zramSwap.enable = true; zramSwap.enable = true;

View File

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

View File

@ -0,0 +1,9 @@
name=Agent 1
ownPort=9090
serverUrl=http\://teamcity\:8111
workDir=../work
tempDir=../temp
systemDir=../system
teamcity.docker.use.sudo=true

View File

@ -0,0 +1,3 @@
{
imports = [./teamcity-compose.nix];
}

View File

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

View File

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