Skip to content

d1sco/gitlab-pipeline-gcp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 

Repository files navigation

gitlab-pipeline-gcp

variables:
  GCP_ZONE: us-central1-a

stages:
  - build
  - deploy

build:
  image: node:12.14.0
  stage: build
  only:
    - master
  script:
    - npm install

deploy:
  stage: deploy
  image: google/cloud-sdk:latest
  only:
    - master
  dependencies:
    - build
  script:
    #
    # Authenticate using the service account stored here: https://gitlab.com/groups/{YOUR_GITLAB_PROJECT}/-/settings/ci_cd
    - echo $GCLOUD_SERVICE_KEY > ${HOME}/gcloud-service-key.json
    - gcloud auth activate-service-account --key-file ${HOME}/gcloud-service-key.json
    # Register GCP Project
    # - gcloud auth activate-service-account --key-file=$GCLOUD_SERVICE_KEY
    - gcloud config set project $PROJECT_ID
  
    # Deploy
    - gcloud beta functions deploy $FUNCTION_NAME --runtime nodejs10 --trigger-http

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published