Piece of code to add gocd stack

This commit is contained in:
disaster37 2017-03-31 14:20:52 +00:00
parent d4f83acad5
commit 20ca59da73
4 changed files with 121 additions and 0 deletions

View File

@ -0,0 +1,30 @@
# GoCD.io
### Info:
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.
### Usage:
Select GoCD from catalog.
Enter the number of GoCD agent you need.
Enter extra GoCD plugins to download and install.
Choose the key to autoregister GoCD agent.
Click deploy.
GoCD server can now be accessed over the Rancher network on port `8153` (http://IP_CONTAINER:8153). To access from external Rancher network, you need to set load balancer or expose the port 8153.
### Source, bugs and enhances
If you found bugs or need enhance, you can open ticket on github:
- [GoCD official core project](https://github.com/gocd/gocd)
- [GoCD Server docker image](https://github.com/disaster37/alpine-gocd-server)
- [GoCD Agent docker image](https://github.com/disaster37/alpine-gocd-agent)
- [Rancher Cattle metadata docker image](https://github.com/disaster37/rancher-cattle-metadata)

View File

@ -0,0 +1,82 @@
version: '2'
services:
gocd-server:
tty: true
image: webcenter/alpine-gocd-server:17.3.0
volumes:
- gocd-server-data:/data
environment:
- GOCD_CONFIG_memory="1024m"
- GOCD_CONFIG_agent-key="my_secure_key"
- 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"
- GOCD_CONFIG_plugin_docker-pipline="https://github.com/Haufe-Lexware/gocd-plugins/releases/download/v1.0.0-beta/gocd-docker-pipeline-plugin-1.0.0.jar"
- GOCD_CONFIG_plugin_github-pr="https://github.com/insano10/gocd-pr-comment-scalastyle/releases/download/1.2/github-pr-comment-scalastyle-1.2.jar"
- GOCD_CONFIG_plugin_email-notifier="https://github.com/gocd-contrib/email-notifier/releases/download/v0.1/email-notifier-0.1.jar"
- 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"
{{- if (ne .Values.DEPLOY_LB "true") and .Values.PUBLISH_PORT}}
ports:
- ${PUBLISH_PORT}:8153
{{- end}}
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
gocd-agent:
tty: true
image: webcenter/alpine-gocd-agent:17.3.0
volumes:
- gocd-agent-data:/data
- gocd-scheduler-setting:/opt/scheduler
environment:
- GOCD_CONFIG_memory="1024m"
- GOCD_CONFIG_agent_key="my_secure_key"
- GOCD_CONFIG_agent_resource_docker= "docker"
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
rancher-cattle-metadata:
network_mode: none
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.container.start_once: "true"
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
labels:
io.rancher.container.agent.role: environmentAdmin
io.rancher.container.create_agent: 'true'
{{- end}}
volumes:
minio-scheduler-setting:
driver: local
per_container: true
gocd-agent-data:
driver: local
per_container: true
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}}
{{- end}}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@ -0,0 +1,9 @@
name: gocd-server
description: |
GoCD Stack (server and agents)
version: 17.3.0-rancher1
category: Continuous Integration
maintainer: "Sebastien Langoureaux <linuxworkgroup@gmail.com>"
minimum_rancher_version: v1.5.0
license: Apache License
projectURL: https://www.gocd.io/