Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save i-b1/99f7b47c8f893227feeddd622d64432a to your computer and use it in GitHub Desktop.
Save i-b1/99f7b47c8f893227feeddd622d64432a to your computer and use it in GitHub Desktop.
trigger:
- master
pool:
vmImage: 'ubuntu-latest'
steps:
- task: NodeTool@0
inputs:
versionSpec: '10.x'
displayName: 'Install Node.js'
- script: |
npm install
displayName: 'npm install'
- task: DownloadSecureFile@1
name: authkey
displayName: 'Download Service Account Key'
inputs:
secureFile: 'GoogleServiceAccountKey.json'
retryCount: '2'
- script: |
wget https://dl.google.com/dl/cloudsdk/release/google-cloud-sdk.tar.gz
tar zxvf google-cloud-sdk.tar.gz && ./google-cloud-sdk/install.sh --quiet --usage-reporting=false --path-update=true
PATH="google-cloud-sdk/bin:${PATH}"
gcloud --quiet components update
echo $(authkey.secureFilePath)
displayName: 'install gcloud SDK'
- script:
echo $(authkey.secureFilePath)
gcloud auth activate-service-account --key-file $(authkey.secureFilePath)
gcloud functions deploy [FUNCTION_NAME] --runtime nodejs8 --trigger-http --region=[REGION] --project=[PROJECT_ID]
displayName: 'deploy cloud function'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment