Last active
September 7, 2018 17:11
-
-
Save andrzj/7c1f49aa915205eee7e9204cd5b9762e to your computer and use it in GitHub Desktop.
Gitlab CI - Google Cloud
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
variables: | |
GCP_PROJECT_ID: **** | |
GCLOUD_SERVICE_KEY: **** | |
NPM_TOKEN: **** | |
image: andrzj/gcloud-ci | |
cache: | |
untracked: true | |
key: "$CI_BUILD_REF_NAME" | |
paths: | |
- node_modules/ | |
policy: pull # https://docs.gitlab.com/ee/ci/yaml/README.html#cache-policy | |
stages: | |
- setup | |
- test | |
- deploy | |
setup: | |
stage: setup | |
only: | |
- master | |
script: | |
- echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc | |
- npm install --only=production | |
test: | |
stage: test | |
script: | |
- npm test | |
deploy: | |
stage: deploy | |
only: | |
- master | |
dependencies: | |
- test | |
script: | |
- gcloud beta functions deploy $CI_PROJECT_NAME --runtime=nodejs8 --source=$CI_PROJECT_NAME --memory=256MB --timeout=60s --stage-bucket=**** --trigger-http |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment