Skip to content

Instantly share code, notes, and snippets.

@thoughtspeed7
Created January 3, 2018 23:08
Show Gist options
  • Save thoughtspeed7/ad280563eb87fa2fcacc06cdcef97989 to your computer and use it in GitHub Desktop.
Save thoughtspeed7/ad280563eb87fa2fcacc06cdcef97989 to your computer and use it in GitHub Desktop.
Example YML file for Continuous Integration (CI) and Delivery (CD) for Google Cloud Functions (GCF) using CircleCI
# om namah shivay
machine:
node:
# current node version running in cloud functions as of 02 Jan 2018. see https://cloud.google.com/functions/docs/writing
version: 6.11.5
dependencies:
pre:
# see https://cloud.google.com/sdk/gcloud/reference
- sudo /opt/google-cloud-sdk/bin/gcloud components update --quiet
- sudo /opt/google-cloud-sdk/bin/gcloud components install beta --quiet
- sudo /opt/google-cloud-sdk/bin/gcloud config set project [your project id]
# see https://circleci.com/docs/1.0/google-auth
- echo $GCLOUD_SERVICE_KEY | base64 --decode --ignore-garbage > ${HOME}/gcloud-service-key.json
- sudo /opt/google-cloud-sdk/bin/gcloud auth activate-service-account --key-file ${HOME}/gcloud-service-key.json
deployment:
production:
branch: master
commands:
# see https://cloud.google.com/sdk/gcloud/reference/beta/functions/deploy
- sudo /opt/google-cloud-sdk/bin/gcloud beta functions deploy helloWorld --entry-point sayHelloWorld --memory 128MB --region us-central1 --trigger-http
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment