Name: drone-gdm
Owner: The New York Times
Description: Drone.io plugin to facilitate the use of Google Deployment Manager in drone deploy phase.
Created: 2017-08-08 20:23:40.0
Updated: 2018-05-22 22:59:29.0
Pushed: 2018-05-22 22:59:28.0
Homepage: https://open.nytimes.com/
Size: 102
Language: Go
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
A simple drone plugin which wraps Google Deployment Manager.
develop
tag to get the last thing that builtlatest
tag to get the latest v1.x stablebeta
tag to get the latest beta releasealpha
tag to get the latest alpha
releasedevelop
tag to get the last thing that built
(alpha, beta, and develop tags introduced as of 1.2.1a
)Starting with version 2.0.0a
the tag scheme is prefixed with major version, e.g:
v2-alpha
tag to get the latest 2.x alpha releasev2-beta
tag to get the latest 2.x beta releasev2-stable
tag to get the latest 2.x stable release
This pattern will continue with subsequent major version releases; enabling you to pin your build to the latest stable version of any given backwards-compatible, major-level releasestate
(absent, present, or latest) and the plugin determines whether to create, update, or delete.Drone-GDM has been tested with drone 0.4 and 0.8.
The bulk of the input parameters are mapped directly to gcloud
command options.
Documentation follows for the handful of parameters which are particular to drone-gdm
.
The state
can be one of absent
, present
, or latest
.
| Plugin “state” | Object Exists? | Action |
| ————– | ————– | ———– |
| present | no | create
|
| present | yes | no action |
| latest | no | create
|
| latest | yes | update
|
| absent | no | no action |
| absent | yes | delete
|
The specific action
selected by drone-gdm can be provided to your template
as a property, by specifying passAction: true
. This will invoke your
configuration or template with --properties=action:<action from table above>
.
oy:
m:
# Indicate where to acquire the image:
image: nytimes/drone-gdm:1.1.0b
# Provided JSON auth token (from drone secrets):
gcloudPath: /bin/gcloud # path to gcloud executable
verbose: false # (optional)
dryRun: false # (optional)
token: >
$$GOOGLE_JSON_CREDENTIALS
project: my-gcp-project # Da--project
preview: false # --preview
async: false # --async
configurations:
- name: my-deployment
group: deployment
state: present
path: ./my-deployment.yaml
description: A GDM Deployment
properties: # mapped to gcloud '--properties=...'
myvar: myval # can be referenced in jinja as: {{ properties.myvar }}
labels: # mapped to '--labels' or '--update-labels', as appropriate
mylabel: labelval
autoRollbackOnError: false
createPolicy: CREATE_OR_ACQUIRE # Optional: CREATE_OR_ACQUIRE or CREATE
deletePolicy: DELETE # Optional: DELETE or ABANDON
passAction: false # if true, pass action as property, e.g. "action:update"
- name: my-composite
version: beta # gcloud version to use
group: composite
state: present
path: ./my-composite.jinja
description: A GDM "Composite Type"
labels: # mapped to '--labels' or '--update-labels', as appropriate
mylabel: labelval
status: SUPPORTED # Optional: SUPPORTED, DEPRECATED, or EXPERIMENTAL
passAction: false
oy:
m:
# Indicate where to acquire the image:
image: nytimes/drone-gdm:1.2.1a
# Provided JSON auth token (from drone secrets):
gcloudPath: /bin/gcloud # path to gcloud executable
verbose: false # (optional)
dryRun: false # (optional)
token: >
$$GOOGLE_JSON_CREDENTIALS
project: my-gcp-project # Da--project
preview: false # --preview
async: false # --async
vars:
prefix: test1
configFile: my-configurations.yml
configurations:
- name: my-deployment
group: deployment
state: present
path: ./my-deployment.yaml
description: A GDM Deployment
properties: # mapped to gcloud '--properties=...'
myvar: myval # can be referenced in jinja as: {{ properties.myvar }}
labels: # mapped to '--labels' or '--update-labels', as appropriate
mylabel: labelval
autoRollbackOnError: false
createPolicy: CREATE_OR_ACQUIRE # Optional: CREATE_OR_ACQUIRE or CREATE
deletePolicy: DELETE # Optional: DELETE or ABANDON
passAction: false # if true, pass action as property, e.g. "action:update"
rsed as a golang template with variables populated from "vars" above.
me: {{.prefix}}-composite
rsion: beta # gcloud version to use
oup: composite
ate: present
th: ./my-composite.jinja
scription: A GDM "Composite Type"
bels: # mapped to '--labels' or '--update-labels', as appropriate
mylabel: labelval
atus: SUPPORTED # Optional: SUPPORTED, DEPRECATED, or EXPERIMENTAL
ssAction: false