Created
April 6, 2020 21:15
-
-
Save i-b1/99f7b47c8f893227feeddd622d64432a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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