try gocd templte
This commit is contained in:
parent
20ca59da73
commit
6fd9b319c4
@ -5,6 +5,11 @@
|
||||
This template creates one GoCD server and scale out the number of GoCD agent you need.
|
||||
|
||||
The GoCD agent embedded Docker support, so the idea is to not create GoCD agent per language but use docker container to build and test your stuff.
|
||||
You can use on GoCD agent:
|
||||
- docker cli
|
||||
- docker-compose cli
|
||||
- rancher-compose cli
|
||||
- make
|
||||
|
||||
|
||||
### Usage:
|
||||
|
@ -1,13 +1,19 @@
|
||||
version: '2'
|
||||
services:
|
||||
{{- if eq .Values.DEPLOY_SERVER "true"}}
|
||||
gocd-server:
|
||||
tty: true
|
||||
image: webcenter/alpine-gocd-server:17.3.0
|
||||
image: webcenter/alpine-gocd-server:develop
|
||||
volumes:
|
||||
{{- if (contains .Values.VOLUME_DRIVER_SERVER "/")}}
|
||||
- gocd-server-data:/data
|
||||
{{- else}}
|
||||
- ${VOLUME_DRIVER_SERVER}:/data
|
||||
{{- end}}
|
||||
environment:
|
||||
- GOCD_CONFIG_memory="1024m"
|
||||
- GOCD_CONFIG_agent-key="my_secure_key"
|
||||
- GOCD_CONFIG_memory="${GOCD_SERVER_MEMORY}"
|
||||
- GOCD_CONFIG_agent-key="${GOCD_AGENT_KEY}"
|
||||
{{- if eq .Values.GOCD_AGENT_PACKAGE "true"}}
|
||||
- GOCD_CONFIG_plugin_script-executor="https://github.com/gocd-contrib/script-executor-task/releases/download/0.3/script-executor-0.3.0.jar"
|
||||
- GOCD_CONFIG_plugin_docker-task="https://github.com/manojlds/gocd-docker/releases/download/0.1.27/docker-task-assembly-0.1.27.jar"
|
||||
- GOCD_CONFIG_plugin_slack="https://github.com/Vincit/gocd-slack-task/releases/download/v1.3.1/gocd-slack-task-1.3.1.jar"
|
||||
@ -17,6 +23,7 @@ services:
|
||||
- GOCD_CONFIG_plugin_slack-notifier="https://github.com/ashwanthkumar/gocd-slack-build-notifier/releases/download/v1.4.0-RC11/gocd-slack-notifier-1.4.0-RC11.jar"
|
||||
- GOCD_CONFIG_plugin_github-notifier="https://github.com/gocd-contrib/gocd-build-status-notifier/releases/download/1.3/github-pr-status-1.3.jar"
|
||||
- GOCD_CONFIG_plugin_github-scm="https://github.com/ashwanthkumar/gocd-build-github-pull-requests/releases/download/v1.3.3/github-pr-poller-1.3.3.jar"
|
||||
{{- end}}
|
||||
{{- if (ne .Values.DEPLOY_LB "true") and .Values.PUBLISH_PORT}}
|
||||
ports:
|
||||
- ${PUBLISH_PORT}:8153
|
||||
@ -24,20 +31,45 @@ services:
|
||||
labels:
|
||||
io.rancher.scheduler.affinity:container_label_soft_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name}
|
||||
io.rancher.container.hostname_override: container_name
|
||||
{{- if eq .Values.DEPLOY_LB "true"}}
|
||||
lb:
|
||||
image: rancher/lb-service-haproxy:v0.6.2
|
||||
{{- if .Values.PUBLISH_PORT}}
|
||||
ports:
|
||||
- ${PUBLISH_PORT}:8153/tcp
|
||||
{{- else}}
|
||||
expose:
|
||||
- 8153:8153/tcp
|
||||
{{- end}}
|
||||
links:
|
||||
- gocd-server:gocd-server
|
||||
labels:
|
||||
io.rancher.container.agent.role: environmentAdmin
|
||||
io.rancher.container.create_agent: 'true'
|
||||
{{- end}}
|
||||
{{- end}}
|
||||
{{- if eq .Values.DEPLOY_AGENT "true"}}
|
||||
gocd-agent:
|
||||
tty: true
|
||||
image: webcenter/alpine-gocd-agent:17.3.0
|
||||
image: webcenter/alpine-gocd-agent:develop
|
||||
volumes:
|
||||
{{- if (contains .Values.VOLUME_DRIVER_AGENT "/")}}
|
||||
- ${VOLUME_DRIVER_AGENT}:/data
|
||||
{{- else}}
|
||||
- gocd-agent-data:/data
|
||||
{{- end}}
|
||||
- gocd-scheduler-setting:/opt/scheduler
|
||||
environment:
|
||||
- GOCD_CONFIG_memory="1024m"
|
||||
- GOCD_CONFIG_agent_key="my_secure_key"
|
||||
- GOCD_CONFIG_agent_resource_docker= "docker"
|
||||
- GOCD_CONFIG_memory="${GOCD_AGENT_MEMORY}"
|
||||
- GOCD_CONFIG_agent_key="${GOCD_AGENT_KEY}"
|
||||
- GOCD_CONFIG_agent_resource_docker= "${GOCD_AGENT_RESOURCE}"
|
||||
- DOCKER_HOST: tcp://docker-engine:2375
|
||||
labels:
|
||||
io.rancher.scheduler.affinity:container_label_soft_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name}
|
||||
io.rancher.container.hostname_override: container_name
|
||||
io.rancher.sidekicks: rancher-cattle-metadata
|
||||
io.rancher.container.agent.role: environment
|
||||
io.rancher.container.create_agent: 'true'
|
||||
io.rancher.sidekicks: rancher-cattle-metadata,docker-engine
|
||||
rancher-cattle-metadata:
|
||||
network_mode: none
|
||||
labels:
|
||||
@ -47,36 +79,32 @@ services:
|
||||
image: webcenter/rancher-cattle-metadata:1.0.1
|
||||
volumes:
|
||||
- gocd-scheduler-setting:/opt/scheduler
|
||||
{{- if eq .Values.DEPLOY_LB "true"}}
|
||||
lb:
|
||||
image: rancher/lb-service-haproxy:v0.6.2
|
||||
{{- if .Values.PUBLISH_PORT}}
|
||||
ports:
|
||||
- ${PUBLISH_PORT}:8153/tcp
|
||||
{{- else}}
|
||||
expose:
|
||||
- 8153:8153/tcp
|
||||
{{- end}}
|
||||
links:
|
||||
- gocd-server:gocd-server
|
||||
docker-engine:
|
||||
network_mode: none
|
||||
privileged: true
|
||||
labels:
|
||||
io.rancher.container.agent.role: environmentAdmin
|
||||
io.rancher.container.create_agent: 'true'
|
||||
io.rancher.scheduler.affinity:container_label_soft_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name}
|
||||
io.rancher.container.hostname_override: container_name
|
||||
image: index.docker.io/docker:1.13-dind
|
||||
volumes:
|
||||
{{- if (contains .Values.VOLUME_DRIVER_AGENT "/")}}
|
||||
- ${VOLUME_DRIVER_AGENT}:/data
|
||||
{{- else}}
|
||||
- gocd-agent-data:/data
|
||||
{{- end}}
|
||||
{{- end}}
|
||||
|
||||
|
||||
volumes:
|
||||
minio-scheduler-setting:
|
||||
driver: local
|
||||
per_container: true
|
||||
{{- if not (contains .Values.VOLUME_DRIVER_AGENT "/")}}
|
||||
gocd-agent-data:
|
||||
driver: local
|
||||
driver: ${VOLUME_DRIVER_AGENT}
|
||||
per_container: true
|
||||
{{- end}}
|
||||
{{- if not (contains .Values.VOLUME_DRIVER_SERVER "/")}}
|
||||
gocd-server-data:
|
||||
driver: local
|
||||
{{- if not (contains .Values.VOLUME_DRIVER "/")}}
|
||||
{{- range $idx, $e := atoi .Values.MINIO_DISKS | until }}
|
||||
minio-data-{{$idx}}:
|
||||
per_container: true
|
||||
driver: ${VOLUME_DRIVER}
|
||||
{{- end}}
|
||||
driver: ${VOLUME_DRIVER_SERVER}
|
||||
{{- end}}
|
137
templates/gocd/0/rancher-compose.yml
Normal file
137
templates/gocd/0/rancher-compose.yml
Normal file
@ -0,0 +1,137 @@
|
||||
version: '2'
|
||||
catalog:
|
||||
name: GoCD
|
||||
version: 17.3.0-rancher1
|
||||
questions:
|
||||
- variable: "DEPLOY_SERVER"
|
||||
description: "Deploy GoCD server"
|
||||
label: "Deploy GoCD server"
|
||||
required: true
|
||||
type: enum
|
||||
default: "true"
|
||||
options:
|
||||
- "true"
|
||||
- "false"
|
||||
- variable: "DEPLOY_AGENT"
|
||||
description: "Deploy GoCD agent"
|
||||
label: "Deploy GoCD agent"
|
||||
required: true
|
||||
type: enum
|
||||
default: "true"
|
||||
options:
|
||||
- "true"
|
||||
- "false"
|
||||
- variable: "GOCD_AGENT_SCALE"
|
||||
description: "Number of GoCD agent"
|
||||
label: "GoCD Agents"
|
||||
required: true
|
||||
default: 1
|
||||
type: "string"
|
||||
- variable: "GOCD_AGENT_KEY"
|
||||
description: "Key to use for auto registration agent"
|
||||
label: "Agent key"
|
||||
required: true
|
||||
type: "password"
|
||||
- variable: "GOCD_SERVER_MEMORY"
|
||||
description: "Max memory allowed to GoCD server"
|
||||
label: "Max memory for server"
|
||||
type: "string"
|
||||
required: true
|
||||
default: "1024m"
|
||||
- variable: "GOCD_AGENT_MEMORY"
|
||||
description: "Max memory allowed to GoCD agent"
|
||||
label: "Max memory for agent"
|
||||
type: "string"
|
||||
required: true
|
||||
default: "2048m"
|
||||
- variable: "GOCD_AGENT_RESOURCE"
|
||||
description: "Resource name associated for agent"
|
||||
label: "Resource name"
|
||||
type: "string"
|
||||
required: true
|
||||
default: "docker"
|
||||
- variable: "GOCD_AGENT_PACKAGE"
|
||||
description: "Install GoCD extra plugins"
|
||||
label: "Install extra plugins"
|
||||
required: true
|
||||
type: enum
|
||||
default: "true"
|
||||
options:
|
||||
- "true"
|
||||
- "false"
|
||||
- variable: "VOLUME_DRIVER_SERVER"
|
||||
description: "Docker driver to store volume or base path for GoCD server"
|
||||
label: "Volume drver / Path for server"
|
||||
type: "string"
|
||||
required: true
|
||||
default: "local"
|
||||
- variable: "VOLUME_DRIVER_AGENT"
|
||||
description: "Docker driver to store volume or base path for GoCD agent"
|
||||
label: "Volume drver / Path for agent"
|
||||
type: "string"
|
||||
required: true
|
||||
default: "local"
|
||||
- variable: "DEPLOY_LB"
|
||||
description: "Deploy Loadbalancer"
|
||||
label: "Deploy Loadbalancer"
|
||||
required: true
|
||||
type: enum
|
||||
default: "true"
|
||||
options:
|
||||
- "true"
|
||||
- "false"
|
||||
- variable: "PUBLISH_PORT"
|
||||
description: "Set port if you want publish external port for GoCD server or Loadbalancer"
|
||||
label: "Publish port"
|
||||
required: false
|
||||
type: "string"
|
||||
default: "8153"
|
||||
- variable: "CONFD_BACKEND"
|
||||
description: "The confd backend to grab config"
|
||||
label: "Confd backend"
|
||||
required: true
|
||||
default: "env"
|
||||
type: "string"
|
||||
- variable: "CONFD_NODES"
|
||||
description: "The confd nodes"
|
||||
label: "Confd nodes"
|
||||
required: false
|
||||
type: "string"
|
||||
- variable: "CONFD_PREFIX"
|
||||
description: "The confd prefix"
|
||||
label: "Confd prefix"
|
||||
required: true
|
||||
default: "/gocd"
|
||||
type: "string"
|
||||
|
||||
services:
|
||||
gocd-agent:
|
||||
scale: ${GOCD_AGENT_SCALE}
|
||||
retain_ip: true
|
||||
gocd-server:
|
||||
scale: 1
|
||||
retain_ip: false
|
||||
health_check:
|
||||
port: 8153
|
||||
interval: 5000
|
||||
unhealthy_threshold: 3
|
||||
request_line: ''
|
||||
healthy_threshold: 2
|
||||
response_timeout: 5000
|
||||
lb:
|
||||
scale: 1
|
||||
start_on_create: true
|
||||
lb_config:
|
||||
certs: []
|
||||
port_rules:
|
||||
- priority: 1
|
||||
protocol: http
|
||||
service: gocd-server
|
||||
source_port: 8153
|
||||
target_port: 8153
|
||||
health_check:
|
||||
response_timeout: 2000
|
||||
healthy_threshold: 2
|
||||
port: 42
|
||||
unhealthy_threshold: 3
|
||||
interval: 2000
|
@ -1,4 +1,4 @@
|
||||
name: gocd-server
|
||||
name: GoCD
|
||||
description: |
|
||||
GoCD Stack (server and agents)
|
||||
version: 17.3.0-rancher1
|
||||
|
Loading…
x
Reference in New Issue
Block a user