maximelebastard / drone-gcloudfunctions-plugin

Lightweight drone plugin to deploy a Google Cloud Function.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Drone Google Cloud Functions deployment plugin

Build Status

Lightweight drone plugin to deploy a Google Cloud Function.

It uses the official Google Cloud SDK image.

Usage

pipeline:
  deploy-production:
    image: maximelebastard/drone-gcloudfunctions-plugin
    project: myproject
    projectpath: ./maybe/a/subdirectory/of/the/project
    envfile: .env.staging.yaml
    function_name: myCloudFunction
    trigger: http
    region: europe-west-1
    memory: 128MB
    secrets:
      - source: GCLOUD_SERVICE_ACCOUNT_PROD
        target: GCLOUD_SERVICE_ACCOUNT
    when:
      event: deployment
      environment: production

Parameters

  • project : Google Cloud project identifier
  • projectpath : (Optional - default is ".") any subdirectory of the project that contains the cloud function
  • function_name: Name of the cloud function
  • trigger: Cloud function trigger. Only http trigger is supported for the moment
  • region: Deployment region
  • memory: Memory amount to provision for the instance
  • runtime: Runtime of the function
  • envfile: beta feature Environment file (see https://cloud.google.com/functions/docs/env-var#functions_env_var_set-nodejs)

Secrets

Create a Google Cloud service account that has the gcloud functions deployment permissions.

Make sure its content is exposed through the GCLOUD_CREDENTIALS secret.

About

Lightweight drone plugin to deploy a Google Cloud Function.


Languages

Language:Shell 87.0%Language:Dockerfile 13.0%