Merge pull request #702 from gitlawr/cicd
Add Rancher Pipeline into Catalog
This commit is contained in:
commit
c0c9c3d2b5
40
infra-templates/pipeline/0/README.md
Normal file
40
infra-templates/pipeline/0/README.md
Normal file
@ -0,0 +1,40 @@
|
||||
# Rancher Pipeline
|
||||
|
||||
Easier to use, Easier to integrate CI/CD with Rancher.
|
||||
|
||||
## Description
|
||||
|
||||
This template deploys Rancher Pipeline, the continuous integration service powered by Jenkins.
|
||||
|
||||
It will be set up as an infrastructure stack in the Rancher environment.
|
||||
|
||||
## Prerequisite
|
||||
|
||||
Minimum system requirement of 2 core, 4 GB memory.
|
||||
|
||||
## Features
|
||||
|
||||
- Configure and manage your CI jobs in native Rancher UI.
|
||||
- Simple to use, container based continuous integration system.
|
||||
- multiple trigger types supported.
|
||||
- Flexible CI flow control(stop, rerun, timeout, parallel/serial run, approve/deny, etc. ).
|
||||
|
||||
## Parameters
|
||||
|
||||
- `# of slaves`: The number of Jenkins slave to set up. Please set at least one slave. You can also do scaling of slaves after installation.
|
||||
- `# of executors`: The number of executors on each Jenkins slave. The maximum number of concurrent builds that Jenkins may perform on a agent. A good value to start with would be the number of CPU cores on the machine. Setting a higher value would cause each build to take longer, but could increase the overall throughput. For example, one build might be CPU-bound, while a second build running at the same time might be I/O-bound — so the second build could take advantage of the spare I/O capacity at that moment. Agents must have at least one executor.
|
||||
|
||||
|
||||
- `Host with Label to put pipeline components on`: This parameter specify the host labels to use. Pipeline components will be scheduled to dedicated hosts matching these host labels.
|
||||
|
||||
## Usage:
|
||||
|
||||
Select the template from the catalog.
|
||||
|
||||
Configure the parameters according to your workload and resource.
|
||||
|
||||
Click `Launch`.
|
||||
|
||||
After service is up, access Pipeline UI on top navigation bar of Rancher UI.
|
||||
|
||||
See [Pipeline documentation](https://github.com/rancher/pipeline) for detail information.
|
82
infra-templates/pipeline/0/docker-compose.yml.tpl
Normal file
82
infra-templates/pipeline/0/docker-compose.yml.tpl
Normal file
@ -0,0 +1,82 @@
|
||||
{{- $jenkinsMasterImage:="jenkins/jenkins:2.60.2-alpine"}}
|
||||
{{- $jenkinsBootImage:="rancher/jenkins-boot:v0.1.1"}}
|
||||
{{- $jenkinsSlaveImage:="rancher/pipeline-jenkins-slave:v0.1.0"}}
|
||||
{{- $pipelineServerImage:="rancher/pipeline:v0.1.0"}}
|
||||
{{- $pipelineUIImage:="rancher/pipeline-ui:v0.1.0"}}
|
||||
|
||||
version: '2'
|
||||
services:
|
||||
jenkins-master:
|
||||
image: {{$jenkinsMasterImage}}
|
||||
restart: always
|
||||
environment:
|
||||
- JENKINS_SLAVE_AGENT_PORT=50000
|
||||
- JENKINS_HOME=/var/jenkins_home
|
||||
volumes_from:
|
||||
- jenkins-boot
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
labels:
|
||||
io.rancher.sidekicks: jenkins-boot
|
||||
io.rancher.container.create_agent: true
|
||||
io.rancher.container.agent.role: environmentAdmin
|
||||
{{- if ne .Values.HOST_LABEL "" }}
|
||||
io.rancher.scheduler.affinity:host_label: ${HOST_LABEL}
|
||||
{{- end }}
|
||||
jenkins-boot:
|
||||
image: {{$jenkinsBootImage}}
|
||||
volumes:
|
||||
- jenkins_home:/var/jenkins_home
|
||||
labels:
|
||||
io.rancher.container.start_once: true
|
||||
jenkins-slave:
|
||||
image: {{$jenkinsSlaveImage}}
|
||||
restart: always
|
||||
links:
|
||||
- jenkins-master
|
||||
environment:
|
||||
- SLAVE_EXECUTORS=${EXECUTORS}
|
||||
- JENKINS_MASTER=http://jenkins-master:8080
|
||||
- JENKINS_USERNAME=admin
|
||||
- JENKINS_PASSWORD=admin
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
- /var/jenkins_home
|
||||
labels:
|
||||
io.rancher.scheduler.affinity:container_label_soft_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name}
|
||||
io.rancher.container.create_agent: true
|
||||
io.rancher.container.agent.role: environmentAdmin
|
||||
io.rancher.container.pull_image: always
|
||||
{{- if ne .Values.HOST_LABEL "" }}
|
||||
io.rancher.scheduler.affinity:host_label: ${HOST_LABEL}
|
||||
{{- end }}
|
||||
pipeline-server:
|
||||
image: {{$pipelineServerImage}}
|
||||
restart: always
|
||||
links:
|
||||
- jenkins-master
|
||||
environment:
|
||||
- JENKINS_ADDRESS=http://jenkins-master:8080
|
||||
- JENKINS_USER=admin
|
||||
- JENKINS_TOKEN=admin
|
||||
labels:
|
||||
io.rancher.container.create_agent: true
|
||||
io.rancher.container.agent.role: environmentAdmin
|
||||
io.rancher.container.pull_image: always
|
||||
{{- if ne .Values.HOST_LABEL "" }}
|
||||
io.rancher.scheduler.affinity:host_label: ${HOST_LABEL}
|
||||
{{- end }}
|
||||
pipeline-ui:
|
||||
image: {{$pipelineUIImage}}
|
||||
restart: always
|
||||
labels:
|
||||
io.rancher.container.create_agent: true
|
||||
io.rancher.container.agent.role: environment
|
||||
io.rancher.container.pull_image: always
|
||||
io.rancher.service.ui_link.label: "{\"en-us\":\"PIPELINE\",\"zh-hans\":\"流水线\"}"
|
||||
{{- if ne .Values.HOST_LABEL "" }}
|
||||
io.rancher.scheduler.affinity:host_label: ${HOST_LABEL}
|
||||
{{- end }}
|
||||
volumes:
|
||||
jenkins_home:
|
||||
driver: "local"
|
28
infra-templates/pipeline/0/rancher-compose.yml
Normal file
28
infra-templates/pipeline/0/rancher-compose.yml
Normal file
@ -0,0 +1,28 @@
|
||||
version: '2'
|
||||
catalog:
|
||||
name: Pipeline
|
||||
version: v0.1.0
|
||||
minimum_rancher_version: 1.6.13-rc2
|
||||
description: "Rancher Pipeline"
|
||||
questions:
|
||||
- variable: SLAVES
|
||||
type: "int"
|
||||
default: "1"
|
||||
label: "# of slaves"
|
||||
description: "How many jenkins slaves to run ci tasks. At least 1."
|
||||
- variable: EXECUTORS
|
||||
type: "int"
|
||||
default: "2"
|
||||
label: "# of executors"
|
||||
description: "How many executors on a jenkins slave"
|
||||
- variable: HOST_LABEL
|
||||
label: "Host with Label to put pipeline components on"
|
||||
description: |
|
||||
Run pipeline components on Host with specific labels.
|
||||
Example: 'pipeline=true'
|
||||
required: false
|
||||
default: ""
|
||||
type: "string"
|
||||
services:
|
||||
jenkins-slave:
|
||||
scale: ${SLAVES}
|
23
infra-templates/pipeline/catalogIcon-CICD.svg
Normal file
23
infra-templates/pipeline/catalogIcon-CICD.svg
Normal file
@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 19.2.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 242.2 107.4" style="enable-background:new 0 0 242.2 107.4;" xml:space="preserve">
|
||||
<g>
|
||||
<g>
|
||||
<path d="M229,23.6l-2.5-14.9c-0.8-4.8-2.7-8.7-4.1-8.7c-1.5,0-2.7,4-2.7,8.8v3.9c0,4.8-4,8.8-8.8,8.8H207c-0.3,0-0.6,0-0.8,0v10.7
|
||||
c0.3,0,0.6,0,0.8,0h14.7C226.5,32.2,229.8,28.3,229,23.6"/>
|
||||
<path d="M193.9,11h-23.7c-0.2,0-0.4,0-0.6,0h-24.4c-0.3,0-0.6,0-0.8,0.1V8.8c0-4.8-1.2-8.8-2.7-8.8s-3.3,3.9-4.1,8.7l-2.5,14.9
|
||||
c-0.8,4.8,2.5,8.7,7.4,8.7h14.6c1.5,0,2.9-0.2,4.2-0.6c-0.5,2.5-2.6,4.4-5.3,4.4h-20.5c-3.3,0-5.8-3-5.3-6.3l2.1-12.5
|
||||
c0.5-3.3-2-6.3-5.3-6.3H24.8c-2.2,0-4,1.3-4.9,3.2L0.7,43.5c-0.3,0.5-0.3,1.1,0.1,1.6l3.7,4.4c0.5,0.6,1.3,0.6,1.9,0.2l13.1-10.3
|
||||
V102c0,3,2.4,5.4,5.4,5.4h29c3,0,5.4-2.4,5.4-5.4V80.2c0-3,2.4-5.4,5.4-5.4h72.4c3,0,5.4,2.4,5.4,5.4V102c0,3,2.4,5.4,5.4,5.4h29
|
||||
c3,0,5.4-2.4,5.4-5.4V78.6h-15.4c-4.8,0-8.8-4-8.8-8.8V54.7c0-2.9,1.4-5.4,3.5-7v18c0,4.8,4,8.8,8.8,8.8h23.7c4.8,0,8.8-4,8.8-8.8
|
||||
V19.9C202.7,14.9,198.8,11,193.9,11"/>
|
||||
</g>
|
||||
<g>
|
||||
<path d="M230.6,5.6c0-3.9,2.9-5.6,5.6-5.6s5.6,1.7,5.6,5.6c0,3.8-2.9,5.5-5.6,5.5S230.6,9.4,230.6,5.6z M240.5,5.6
|
||||
c0-3.1-2-4.4-4.2-4.4S232,2.5,232,5.6c0,3,2.1,4.4,4.3,4.4C238.5,9.9,240.5,8.6,240.5,5.6z M234.4,2.8h2c1,0,2,0.3,2,1.7
|
||||
c0,0.8-0.6,1.3-1.3,1.5l1.3,2.3h-1.2L236,6.1h-0.5v2.2h-1.1L234.4,2.8L234.4,2.8z M236.4,5.3c0.5,0,0.9-0.3,0.9-0.8
|
||||
c0-0.6-0.5-0.7-0.9-0.7h-1v1.5H236.4z"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.6 KiB |
7
infra-templates/pipeline/config.yml
Normal file
7
infra-templates/pipeline/config.yml
Normal file
@ -0,0 +1,7 @@
|
||||
name: Rancher Pipeline
|
||||
description: Rancher CI service
|
||||
version: v0.1.0
|
||||
category: Continuous Integration
|
||||
labels:
|
||||
io.rancher.certified: Experimental
|
||||
io.rancher.orchestration.supported: 'cattle'
|
Loading…
x
Reference in New Issue
Block a user