-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathdocker-compose.manual.yml
More file actions
94 lines (88 loc) · 3.7 KB
/
Copy pathdocker-compose.manual.yml
File metadata and controls
94 lines (88 loc) · 3.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# Manual-testing stack for the Octopus connection feature. Brings up, and leaves running:
# - TeamCity 2024.12 with the built plugin installed, booted from the prepared datadir
# (e2e/src/test/resources/teamcity_config.zip) so there is NO first-start wizard
# - A free-tier Octopus Deploy (+ MSSQL) — no licence required
# - A TeamCity agent (authorise it once in the UI: Agents -> Unauthorized -> Authorize)
#
# Credentials are read from a .env file (auto-loaded by docker compose). Create it first:
# cp .env.example .env # throwaway local-only values; adjust if you like
#
# Prerequisite — build the plugin zip first (JDK 11):
# JAVA_HOME=/opt/homebrew/opt/openjdk@11 ./gradlew distZip
#
# Run:
# docker compose -f docker-compose.manual.yml up # add -d to detach
# # TeamCity: http://localhost:8111 (log in with OCTOPUS_ADMIN_USERNAME / OCTOPUS_ADMIN_PASSWORD)
# # Octopus: http://localhost:8080 (same admin login; API key = OCTOPUS_ADMIN_API_KEY)
# docker compose -f docker-compose.manual.yml down # add -v to also wipe the datadir/db
#
# To test a connection: in TeamCity add an "Octopus Deploy" connection
# (Project Settings -> Connections) with:
# URL = http://octopus:8080 (the in-network alias the agent can reach; NOT localhost)
# API key = your OCTOPUS_ADMIN_API_KEY (from .env)
# then add an Octopus build step and pick the connection.
services:
mssql:
image: mcr.microsoft.com/mssql/server:2022-latest
platform: linux/amd64 # amd64-only image; runs under emulation on arm64 hosts
environment:
ACCEPT_EULA: "Y"
MSSQL_SA_PASSWORD: "${MSSQL_SA_PASSWORD}"
octopus:
image: octopusdeploy/octopusdeploy:2025.4
platform: linux/amd64 # amd64-only image; runs under emulation on arm64 hosts
depends_on:
- mssql
ports:
- "8080:8080"
environment:
ACCEPT_EULA: "Y"
DB_CONNECTION_STRING: "Server=mssql,1433;Database=Octopus;User Id=sa;Password=${MSSQL_SA_PASSWORD};TrustServerCertificate=true"
ADMIN_USERNAME: "${OCTOPUS_ADMIN_USERNAME}"
ADMIN_PASSWORD: "${OCTOPUS_ADMIN_PASSWORD}"
ADMIN_API_KEY: "${OCTOPUS_ADMIN_API_KEY}"
DISABLE_DIND: "Y"
# One-shot: lay down the prepared TeamCity datadir (once) and (re)install the freshly-built plugin.
tc-init:
image: alpine:3.20
volumes:
- tc-datadir:/datadir
- ./:/repo:ro
command:
- sh
- -c
- >
set -e;
apk add --no-cache unzip >/dev/null;
if [ ! -f /datadir/.octopus-manual-initialised ]; then
echo "Initialising prepared TeamCity datadir...";
unzip -o -q /repo/e2e/src/test/resources/teamcity_config.zip -d /datadir;
touch /datadir/.octopus-manual-initialised;
fi;
mkdir -p /datadir/plugins;
if ! ls /repo/build/distributions/Octopus.TeamCity.*.zip >/dev/null 2>&1; then
echo "ERROR: plugin zip not found in build/distributions — run './gradlew distZip' first." >&2;
exit 1;
fi;
cp /repo/build/distributions/Octopus.TeamCity.*.zip /datadir/plugins/Octopus.TeamCity.zip;
chown -R 1000:1000 /datadir;
echo "Datadir ready.";
teamcity-server:
image: jetbrains/teamcity-server:2025.03.3 # 2025.03+ bundles Java 21 (needed by the OIDC plugin)
depends_on:
tc-init:
condition: service_completed_successfully
ports:
- "8111:8111"
environment:
TEAMCITY_SERVER_OPTS: "-Dteamcity.startup.maintenance=false"
volumes:
- tc-datadir:/data/teamcity_server/datadir
teamcity-agent:
image: jetbrains/teamcity-agent:2025.03.3
depends_on:
- teamcity-server
environment:
SERVER_URL: "http://teamcity-server:8111"
volumes:
tc-datadir: