NYTimes/drone-gdm

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

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

drone-gdm

Build Status

A simple drone plugin which wraps Google Deployment Manager.

Docker Tags
All Versions 1.x Series

Starting with version 2.0.0a the tag scheme is prefixed with major version, e.g:

Features
Compatibility

Drone-GDM has been tested with drone 0.4 and 0.8.

Usage

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.

State and Action

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>.

Example
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
Example with External Configurations (1.2.x alpha only!)
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"
my-configurations.yml
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
Resources

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.