Skip to content

Instantly share code, notes, and snippets.

@donny-dont
Last active October 18, 2016 11:50
Show Gist options
  • Save donny-dont/1fc211d4acf35ca6232e69af04e722e1 to your computer and use it in GitHub Desktop.
Save donny-dont/1fc211d4acf35ca6232e69af04e722e1 to your computer and use it in GitHub Desktop.
Drone Agent Rancher
drone:
image: drone/drone:0.5.0
environment:
DRONE_SERVER: ${DRONE_SERVER}
DRONE_TOKEN: ${DRONE_TOKEN}
DRONE_DEBUG: ${DRONE_DEBUG}
DRONE_BACKOFF: ${DRONE_BACKOFF}
DRONE_PLUGIN_PULL: ${DRONE_PLUGIN_PULL}
DRONE_PLUGIN_NAMESPACE: ${DRONE_PLUGIN_NAMESPACE}
DRONE_PLUGIN_WHITELIST: ${DRONE_PLUGIN_WHITELIST}
DRONE_PLUGIN_PRIVILEGED: ${DRONE_PLUGIN_PRIVILEGED}
DRONE_PLUGIN_NETRC: ${DRONE_PLUGIN_NETRC}
DOCKER_HOST: ${DOCKER_HOST}
DOCKER_TLS_VERIFY: ${DOCKER_TLS_VERIFY}
DOCKER_CERT_PATH: ${DOCKER_TLS_VERIFY}
DOCKER_MAX_PROCS: ${DOCKER_MAX_PROCS}
DOCKER_OS: ${DOCKER_OS}
DOCKER_ARCH: ${DOCKER_ARCH}
HTTP_PROXY: ${HTTP_PROXY}
HTTPS_PROXY: ${HTTPS_PROXY}
NO_PROXY: ${NO_PROXY}
volumes:
- /var/run/docker.sock:/var/run/docker.sock
command: agent
labels:
io.rancher.container.pull_image: always
.catalog:
name: Drone
version: 0.5.0
description: Drone CI Build Agent
uuid: drone-0.5
minimum_rancher_version: v0.51.0
questions:
- variable: DRONE_SERVER
label: Drone server address
description: |
Drone server address. This is just the URL to the server.
required: true
type: string
- variable: DRONE_TOKEN
label: Drone server token
description: |
The generated token for the Drone server. Used to verify that the
agents can connect and execute builds.
required: true
type: string
- variable: DRONE_DEBUG
label: Debug mode
description: |
Runs the agent in debug mode. This will result in more logging being
produced by the agent.
required: true
type: boolean
default: false
- variable: DRONE_BACKOFF
label: Backoff time
description: |
The backoff time to reconnect agents when their connection to the
central server is interrupted.
required: false
type: string
- variable: DRONE_PLUGIN_PULL
label: Update plugins automatically
description: |
Whether plugins are pulled automatically by the agent.
type: boolean
default: true
- variable: DRONE_PLUGIN_NAMESPACE
label: Plugin namespace in DockerHub
description: Plugin namespace in DockerHub.
default: plugins
type: string
- variable: DRONE_PLUGIN_WHITELIST
label: Plugin whitelist
description: |
Plugin whitelist. Add to the string to include additional locations of
plugins.
type: string
default: "plugins/*"
- variable: DRONE_PLUGIN_PRIVILEGED
label: Plugins run in priviledged mode
description: |
Whether plugins are granted priviledged access.
type: boolean
default: false
- variable: DRONE_PLUGIN_NETRC
label: Plugins granted netrc access
description: |
Whether plugins are granted access to the netrc file.
type: boolean
default: true
- variable: DOCKER_HOST
label: Docker host address
description: Docker host address
type: string
- variable: DOCKER_TLS_VERIFY
label: Docker requires TLS verification
description: |
Whether Docker requires TLS verification.
type: boolean
default: true
- variable: DOCKER_CERT_PATH
label: Docker certificate path.
description: Docker certificate path.
type: string
- variable: DOCKER_MAX_PROCS
label: Docker concurrent build processes.
description: |
The number of concurrent builds run by the agent.
type: int
default: 1
- variable: DOCKER_OS
label: Docker operating system
description: |
The operating system in use.
type: enum
options:
- linux
- android
- freebsd
- solaris
- windows
default: linux
- variable: DOCKER_ARCH
label: Docker architecture
description: |
The CPU architecture of the host.
type: enum
options:
- amd64
- arm
- arm64
default: amd64
- variable: HTTP_PROXY
label: The proxy for HTTP connections.
description: |
The proxy for HTTP connections. Used when Drone is running behind a
firewall.
required: false
type: string
- variable: HTTPS_PROXY
label: The proxy for HTTPS connections.
description: |
The proxy for HTTPS connections. Used when Drone is running behind a
firewall.
required: false
type: string
- variable: NO_PROXY
label: The sites to not proxy.
description: |
The sites to not proxy. Used when Drone is running behind a
firewall.
required: false
type: string
Display the source blob
Display the rendered blob
Raw
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="43"
height="36.350704"
id="svg2"
version="1.1"
inkscape:version="0.48.3.1 r9886"
sodipodi:docname="drone-logo-no-circle.svg">
<defs
id="defs4" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#2b303b"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="2.8"
inkscape:cx="26.576205"
inkscape:cy="-72.54425"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
inkscape:snap-global="false"
inkscape:window-width="1295"
inkscape:window-height="744"
inkscape:window-x="65"
inkscape:window-y="24"
inkscape:window-maximized="1"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0">
<inkscape:grid
type="xygrid"
id="grid2996"
empspacing="5"
visible="true"
enabled="true"
snapvisiblegridlinesonly="true"
originx="-21.720779px"
originy="-990.37188px" />
</sodipodi:namedview>
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-21.720779,-25.639593)">
<path
sodipodi:type="arc"
style="fill:#2b303b;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
id="path2998"
sodipodi:cx="172.10474"
sodipodi:cy="458.39249"
sodipodi:rx="5.4295697"
sodipodi:ry="5.0507627"
d="m 177.53431,458.39249 c 0,2.78946 -2.43091,5.05076 -5.42957,5.05076 -2.99867,0 -5.42957,-2.2613 -5.42957,-5.05076 0,-2.78946 2.4309,-5.05077 5.42957,-5.05077 2.99866,0 5.42957,2.26131 5.42957,5.05077 z"
transform="matrix(1.0129716,0,0,1.0889445,-131.11643,-452.42373)" />
<path
style="fill:#2b303b;fill-opacity:1;stroke-width:0;stroke-miterlimit:4"
d="m 43.220779,25.640247 c 9.60163,0.0752 20.51786,6.8438 21.5,19.6 l -13,0 c 0,0 -1.67472,-7.04733 -8.5,-7 -6.82528,0.0473 -8.5,7 -8.5,7 l -13,0 c 0.63161,-12.53073 11.36576,-19.67935 21.5,-19.6 z"
id="rect3810"
inkscape:connector-curvature="0"
sodipodi:nodetypes="scczccs" />
<path
style="fill:#2b303b;fill-opacity:1;stroke-width:0;stroke-miterlimit:4"
d="m 43.310069,61.990247 c -7.159395,0.01905 -13.847588,-5.383347 -16.58929,-13.75 l 8,0 c 0,0 1.72575,6.96782 8.55103,6.92049 6.82528,-0.0473 8.44897,-6.92049 8.44897,-6.92049 l 8,0 c -1.783351,8.850973 -9.251314,13.730946 -16.41071,13.75 z"
id="rect3810-1"
inkscape:connector-curvature="0"
sodipodi:nodetypes="scczccs" />
</g>
</svg>
name: Drone Agent
description: |
Drone CI Build Agent.
version: 0.5.0
category: Continuous Integration
@majest
Copy link

majest commented Oct 18, 2016

Be very careful with DRONE_PLUGIN_NETRC and DRONE_PLUGIN_PRIVILEGED. For some reason those variables cause an authentication error in drone-ecr plugin, regardless of their value.

/usr/local/bin/docker daemon -g /var/lib/docker -s overlay
Error authenticating: exit status 1

I've prepared rancher catalog based on this gist. Available here: https://github.com/majest/rancher-catalog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment