/
marathon.json.mustache
114 lines (114 loc) · 4.11 KB
/
marathon.json.mustache
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
{
"id": "{{service.name}}",
"cpus": {{service.cpus}},
"mem": {{service.mem}},
"instances": 1,
{{#security.secret-name}}
"secrets": {
"serviceCredential": {
"source": "{{security.secret-name}}"
}
},
{{/security.secret-name}}
"env": {
"JENKINS_AGENT_ROLE": "{{roles.jenkins-agent-role}}",
"JENKINS_AGENT_USER": "{{service.user}}",
"JENKINS_FRAMEWORK_NAME": "{{service.name}}",
{{#security.secret-name}}
"DCOS_SERVICE_ACCOUNT_CREDENTIAL": { "secret": "serviceCredential" },
"MESOS_MODULES": "{\"libraries\": [{\"file\": \"libdcos_security.so\", \"modules\": [{\"name\": \"com_mesosphere_dcos_ClassicRPCAuthenticatee\"}]}]}",
"MESOS_AUTHENTICATEE": "com_mesosphere_dcos_ClassicRPCAuthenticatee",
{{/security.secret-name}}
"JENKINS_CONTEXT": "/service/{{service.name}}",
"JENKINS_MESOS_MASTER": "{{advanced.mesos-master}}",
{{#networking.virtual-host}}
"JENKINS_ROOT_URL": "{{#networking.https-redirect}}https://{{/networking.https-redirect}}{{^networking.https-redirect}}http://{{/networking.https-redirect}}{{networking.virtual-host}}/service/{{service.name}}",
{{/networking.virtual-host}}
{{^storage.host-volume}}
"JENKINS_HOME":"/mnt/mesos/sandbox/jenkins_home",
{{/storage.host-volume}}
"JVM_OPTS": "{{advanced.jvm-opts}}",
"JENKINS_OPTS": "{{advanced.jenkins-opts}}",
"PROMETHEUS_ENDPOINT": "{{advanced.prometheus-endpoint}}",
"SSH_KNOWN_HOSTS": "{{networking.known-hosts}}"
},
"portDefinitions": [
{"port": 0, "protocol": "tcp", "name": "nginx"},
{"port": 0, "protocol": "tcp", "name": "jenkins"},
{"port": 0, "protocol": "tcp", "name": "agent"}
],
"container": {
"type": "MESOS",
"docker": {
"image": "{{resource.assets.container.docker.jenkins}}"
},
"volumes": [
{{#storage.host-volume}}
{
"containerPath": "/var/jenkins_home",
"hostPath": "{{storage.host-volume}}/{{service.name}}",
"mode": "RW"
}
{{/storage.host-volume}}
{{^storage.external-persistent-volume-name}}
{
"persistent": {
"size": {{storage.local-persistent-volume-size}}
},
"mode": "RW",
"containerPath": "jenkins_home"
}
{{/storage.external-persistent-volume-name}}
{{#storage.external-persistent-volume-name}}
{
"external": {
"size": {{storage.external-persistent-volume-size}},
"name": "{{storage.external-persistent-volume-name}}",
"provider": "dvdi",
"options": { "dvdi/driver": "rexray" }
},
"mode": "RW",
"containerPath": "jenkins_home"
}
{{/storage.external-persistent-volume-name}}
]
},
{{#advanced.docker-credentials-uri}}
"fetch": [
{
"uri": "{{advanced.docker-credentials-uri}}",
"executable": false,
"extract": true
}
],{{/advanced.docker-credentials-uri}}
"acceptedResourceRoles": [ "{{roles.jenkins-master-role}}" ],
"healthChecks": [
{
"path": "/service/{{service.name}}",
"portIndex": 0,
"protocol": "MESOS_HTTP",
"gracePeriodSeconds": 30,
"intervalSeconds": 60,
"timeoutSeconds": 20,
"maxConsecutiveFailures": 3
}
],
"labels": {
{{#networking.virtual-host}}
"HAPROXY_GROUP":"external",
"HAPROXY_0_VHOST":"{{networking.virtual-host}}",
"HAPROXY_0_REDIRECT_TO_HTTPS": "{{networking.https-redirect}}",
{{/networking.virtual-host}}
"MARATHON_SINGLE_INSTANCE_APP": "true",
"DCOS_PACKAGE_FRAMEWORK_NAME": "{{service.name}}",
"DCOS_SERVICE_NAME": "{{service.name}}",
"DCOS_SERVICE_PORT_INDEX": "0",
"DCOS_SERVICE_SCHEME": "http"
},
"upgradeStrategy":{
"minimumHealthCapacity": 0,
"maximumOverCapacity": 0
}{{#storage.pinned-hostname}},
"constraints": [["hostname", "CLUSTER", "{{storage.pinned-hostname}}"]]
{{/storage.pinned-hostname}}
}