Merge pull request #523 from rawmind0/master

updated drone to 0.7.1
This commit is contained in:
Raúl Sánchez 2017-06-09 18:50:15 +02:00 committed by GitHub
commit ef58051123
4 changed files with 228 additions and 1 deletions

View File

@ -0,0 +1,19 @@
# Drone
### Info:
This template creates an instance of Drone CI server 0.6 along with selectable number of agents to perform the builds.
### Usage:
Select the Drone template from the catalog. Provide the following information:
1. Publish port
2. Agents scale
3. Drone secret
4. Run mode. debug | release
3. Remote driver and config. (Ie. GitHub)
4. Database driver and config. (Ie. sqlite)
See [Drone documentation](http://readme.drone.io/admin) for complete information.

View File

@ -0,0 +1,79 @@
version: '2'
services:
agent:
image: drone/drone:0.7.1
environment:
DRONE_SERVER: ws://drone:8000/ws/broker
DRONE_SECRET: ${drone_secret}
volumes:
- /var/run/docker.sock:/var/run/docker.sock
links:
- server:drone
command:
- agent
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
server:
image: drone/drone:0.7.1
environment:
GIN_MODE: ${gin_mode}
DRONE_SECRET: ${drone_secret}
DRONE_OPEN: ${drone_open}
{{- if (.Values.drone_admin)}}
DRONE_ADMIN: ${drone_admins}
{{- end}}
{{- if (.Values.drone_orgs)}}
DRONE_ORGS: ${drone_orgs}
{{- end}}
{{- if eq .Values.drone_driver "github"}}
DRONE_GITHUB: true
DRONE_GITHUB_CLIENT: ${drone_driver_client}
DRONE_GITHUB_SECRET: ${drone_driver_secret}
{{- end}}
{{- if eq .Values.drone_driver "bitbucket"}}
DRONE_BITBUCKET: true
DRONE_BITBUCKET_CLIENT: ${drone_driver_client}
DRONE_BITBUCKET_SECRET: ${drone_driver_secret}
{{- end}}
{{- if eq .Values.drone_driver "gitlab"}}
DRONE_GITLAB: true
DRONE_GITLAB_CLIENT: ${drone_driver_secret}
DRONE_GITLAB_SECRET: ${drone_driver_secret}
DRONE_GITLAB_URL: ${drone_driver_url}
{{- end}}
{{- if eq .Values.drone_driver "gogs"}}
DRONE_GOGS: true
DRONE_GOGS_URL: ${drone_driver_url}
{{- end}}
{{- if ne .Values.database_driver "sqlite"}}
DRONE_DATABASE_DRIVER: ${database_driver}
DRONE_DATABASE_DATASOURCE: ${database_source}
{{- 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
{{- if eq .Values.database_driver "sqlite"}}
io.rancher.sidekicks: server-volume
volumes_from:
- server-volume
server-volume:
image: rawmind/alpine-volume:0.0.2-1
environment:
SERVICE_GID: '0'
SERVICE_UID: '0'
SERVICE_VOLUME: /var/lib/drone
network_mode: none
volumes:
- /var/lib/drone
labels:
io.rancher.container.start_once: '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
{{- end}}
lb:
image: rancher/load-balancer-service
ports:
- ${host_port}:8000/tcp
links:
- server:server

View File

@ -0,0 +1,129 @@
version: 2
catalog:
name: Drone
version: 0.7.1-rancher1
upgrade_from: 0.5-rancher1
description: |
Drone CI Server ref http://readme.drone.io/admin/installation-guide/
questions:
- variable: host_port
label: Drone server Host Port
description: |
Port that will be exposed on service creation
required: true
default: 8000
type: int
- variable: agent_scale
label: Drone agent scale
description: Drone agent scale to deploy
required: true
default: 1
type: int
- variable: drone_secret
label: Server and agents sercret.
description: Server and agents secret to be communicate. http://readme.drone.io/admin/user-registration/
type: password
required: true
- variable: gin_mode
label: Run mode
description: "Drone run mode, GIN_MODE"
type: enum
default: "release"
options:
- "release"
- "debug"
required: true
- variable: drone_open
label: Open registration
description: |
Users self register. http://readme.drone.io/admin/user-registration/
required: true
default: true
type: enum
options:
- true
- false
- variable: drone_admin
label: Drone Admin
description: List of admins for drone coma seperated. http://readme.drone.io/admin/user-admins/
type: string
required: false
- variable: drone_orgs
label: Organizations
description: Comman seperated list of org that can access drone. http://readme.drone.io/admin/user-registration/
type: string
required: false
- variable: "drone_driver"
type: "enum"
required: true
label: "Remote Driver"
default: "github"
description: "Remote Git and Auth scheme. ref http://readme.drone.io/admin"
options:
- github
- bitbucket
- gitlab
- gogs
- variable: drone_driver_client
label: Remote Driver client
description: "Client key from remote driver. Required for github, bitbucket and gitlab."
type: string
required: false
- variable: drone_driver_secret
label: Remote Driver secret
description: "Secret key from remote driver. Required for github, bitbucket and gitlab."
type: string
required: false
- variable: drone_driver_url
label: Remote Driver url
description: "Remote Driver server url. Required for gitlab and gogs, http://readme.drone.io/admin"
type: string
required: false
- variable: database_driver
label: Database Driver
description: "Database driver. If sqlite, additional volume would be mounted at /var/lib/drone."
type: enum
default: "sqlite"
options:
- "sqlite"
- "mysql"
- "postgres"
required: true
- variable: "database_source"
type: "string"
label: "Database source"
description: "Database datasource. Required if database driver is mysql or postgres, http://readme.drone.io/admin/database-engines/"
required: false
services:
agent:
scale: ${agent_scale}
start_on_create: true
server:
scale: 1
start_on_create: true
health_check:
port: 8000
interval: 2000
unhealthy_threshold: 3
strategy: recreate
request_line: GET / HTTP/1.0
healthy_threshold: 2
response_timeout: 2000
lb:
scale: 1
start_on_create: true
lb_config:
certs: []
port_rules:
- priority: 1
protocol: http
service: server
source_port: ${host_port}
target_port: 8000
health_check:
healthy_threshold: 2
response_timeout: 2000
port: 42
unhealthy_threshold: 3
interval: 2000
strategy: recreate

View File

@ -1,5 +1,5 @@
name: Drone
description: |
Drone CI Server
version: 0.5-rancher1
version: 0.7.1-rancher1
category: Continuous Integration