forked from jenkins-docs/quickstart-tutorials
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yaml
175 lines (165 loc) · 7.29 KB
/
docker-compose.yaml
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
services:
sidekick_service:
# Configuration for the sidekick service
image: ${IMAGE_PREFIX}/${GHCR_USERNAME}/quickstart-tutorials/jenkinsci-tutorials:sidekick_${BRANCH_SUFFIX}
stdin_open: true
tty: true
entrypoint: sh -c "/usr/local/bin/keygen.sh /ssh-dir" # Runs the keygen.sh script and specifies the output directory
volumes:
- agent-ssh-dir:/ssh-dir # Mounts the agent-ssh-dir volume to the /ssh-dir path inside the container
healthcheck:
test: [ "CMD-SHELL", "[ -f /ssh-dir/conductor_ok ] || exit 1" ] # Checks if the conductor_ok file exists in the /ssh-dir path
interval: 5s
timeout: 10s
retries: 5
jenkins_controller:
image: ${IMAGE_PREFIX}/${GHCR_USERNAME}/quickstart-tutorials/jenkinsci-tutorials:simple_controller_${BRANCH_SUFFIX}
restart: on-failure
ports:
- "8080:8080"
volumes:
- jenkins_home:/var/jenkins_home # Mounts the jenkins_home volume to the /var/jenkins_home path inside the container
- agent-ssh-dir:/ssh-dir # Mounts the agent-ssh-dir volume to the /app path inside the container
depends_on:
sidekick_service:
condition: service_completed_successfully # Depends on the successful completion of the sidekick_service
healthcheck:
test: [ "CMD-SHELL", "[ -f /ssh-dir/conductor_ok ] || exit 1" ] # Checks if the conductor_ok file exists in the /ssh-dir path
interval: 5s
timeout: 10s
retries: 5
default_agent:
image: jenkins/ssh-agent:5.5.0
container_name: desktop-jenkins_agent-1
depends_on:
sidekick_service:
condition: service_completed_successfully # Depends on the successful completion of the sidekick_service
jenkins_controller:
condition: service_started
healthcheck:
test: [ "CMD-SHELL", "[ -f /home/jenkins/.ssh/authorized_keys ] || exit 1" ] # Checks if the authorized_keys file exists in the /home/jenkins/.ssh path
interval: 5s
timeout: 10s
retries: 5
volumes:
- agent-ssh-dir:/home/jenkins/.ssh:ro # Mounts the agent-ssh-dir volume to the /home/jenkins/.ssh path inside the container as read-only
maven:
image: ${IMAGE_PREFIX}/${GHCR_USERNAME}/quickstart-tutorials/jenkinsci-tutorials:maven_agent_${BRANCH_SUFFIX}
container_name: desktop-jenkins_agent-1
profiles:
- maven
depends_on:
sidekick_service:
condition: service_completed_successfully # Depends on the successful completion of the sidekick_service
jenkins_controller:
condition: service_started
healthcheck:
test: [ "CMD-SHELL", "[ -f /home/jenkins/.ssh/authorized_keys ] || exit 1" ] # Checks if the authorized_keys file exists in the /home/jenkins/.ssh path
interval: 5s
timeout: 10s
retries: 5
volumes:
- agent-ssh-dir:/home/jenkins/.ssh:ro # Mounts the agent-ssh-dir volume to the /home/jenkins/.ssh path inside the container as read-only
python:
image: ${IMAGE_PREFIX}/${GHCR_USERNAME}/quickstart-tutorials/jenkinsci-tutorials:python_agent_${BRANCH_SUFFIX}
container_name: desktop-jenkins_agent-1
profiles:
- python
depends_on:
sidekick_service:
condition: service_completed_successfully # Depends on the successful completion of the sidekick_service
jenkins_controller:
condition: service_started
healthcheck:
test: [ "CMD-SHELL", "[ -f /home/jenkins/.ssh/authorized_keys ] || exit 1" ] # Checks if the authorized_keys file exists in the /home/jenkins/.ssh path
interval: 5s
timeout: 10s
retries: 5
volumes:
- agent-ssh-dir:/home/jenkins/.ssh:ro # Mounts the agent-ssh-dir volume to the /home/jenkins/.ssh path inside the container as read-only
node:
image: ${IMAGE_PREFIX}/${GHCR_USERNAME}/quickstart-tutorials/jenkinsci-tutorials:node_agent_${BRANCH_SUFFIX}
environment:
- GITPOD_WORKSPACE_URL=${GITPOD_WORKSPACE_URL}
container_name: desktop-jenkins_agent-1
profiles:
- node
depends_on:
sidekick_service:
condition: service_completed_successfully # Depends on the successful completion of the sidekick_service
jenkins_controller:
condition: service_started
ports:
- "3000:3000"
healthcheck:
test: [ "CMD-SHELL", "[ -f /home/jenkins/.ssh/authorized_keys ] || exit 1" ] # Checks if the authorized_keys file exists in the /home/jenkins/.ssh path
interval: 5s
timeout: 10s
retries: 5
volumes:
- agent-ssh-dir:/home/jenkins/.ssh:ro # Mounts the agent-ssh-dir volume to the /home/jenkins/.ssh path inside the container as read-only
android:
image: ${IMAGE_PREFIX}/${GHCR_USERNAME}/quickstart-tutorials/jenkinsci-tutorials:android_agent_${BRANCH_SUFFIX}
environment:
- GITPOD_WORKSPACE_URL=${GITPOD_WORKSPACE_URL}
container_name: desktop-jenkins_agent-1
profiles:
- android
depends_on:
sidekick_service:
condition: service_completed_successfully # Depends on the successful completion of the sidekick_service
jenkins_controller:
condition: service_started
ports:
- "3000:3000"
healthcheck:
test: [ "CMD-SHELL", "[ -f /home/jenkins/.ssh/authorized_keys ] || exit 1" ] # Checks if the authorized_keys file exists in the /home/jenkins/.ssh path
interval: 5s
timeout: 10s
retries: 5
volumes:
- agent-ssh-dir:/home/jenkins/.ssh:ro # Mounts the agent-ssh-dir volume to the /home/jenkins/.ssh path inside the container as read-only
multi_jenkins_controller:
image: ${IMAGE_PREFIX}/${GHCR_USERNAME}/quickstart-tutorials/jenkinsci-tutorials:simple_controller_${BRANCH_SUFFIX}
restart: on-failure
ports:
- "8080:8080"
profiles:
- multi
volumes:
- jenkins_home:/var/jenkins_home # Mounts the jenkins_home volume to the /var/jenkins_home path inside the container
- agent-ssh-dir:/ssh-dir # Mounts the agent-ssh-dir volume to the /app path inside the container
depends_on:
sidekick_service:
condition: service_completed_successfully # Depends on the successful completion of the sidekick_service
healthcheck:
test: [ "CMD-SHELL", "[ -f /ssh-dir/conductor_ok ] || exit 1" ] # Checks if the conductor_ok file exists in the /ssh-dir path
interval: 5s
timeout: 10s
retries: 5
multi:
image: ${IMAGE_PREFIX}/${GHCR_USERNAME}/quickstart-tutorials/jenkinsci-tutorials:node_agent_${BRANCH_SUFFIX}
environment:
- GITPOD_WORKSPACE_URL=${GITPOD_WORKSPACE_URL}
container_name: desktop-jenkins_agent-1
profiles:
- multi
depends_on:
sidekick_service:
condition: service_completed_successfully # Depends on the successful completion of the sidekick_service
multi_jenkins_controller:
condition: service_started
ports:
- "3000:3000"
- "5000:5000"
healthcheck:
test: [ "CMD-SHELL", "[ -f /home/jenkins/.ssh/authorized_keys ] || exit 1" ] # Checks if the authorized_keys file exists in the /home/jenkins/.ssh path
interval: 5s
timeout: 10s
retries: 5
volumes:
- agent-ssh-dir:/home/jenkins/.ssh:ro # Mounts the agent-ssh-dir volume to the /home/jenkins/.ssh path inside the container as read-only
volumes:
jenkins_home:
agent-ssh-dir:
name: agent-ssh-dir # Creates a named volume called agent-ssh-dir