LoginSignup
1
0

More than 5 years have passed since last update.

circleciでcloud-sdkを使用してapp engineにデプロイする

Last updated at Posted at 2019-04-20

下記のようにgoogle/cloud-sdkイメージを使用して「initialize gcloud」内のような形でgcloudの設定を行う。
quietオプションがないとインタラクティブになるので注意。

version: 2
jobs:
  deploy_production:
    docker:
      - image: google/cloud-sdk
    steps:
      - checkout

      - run:
          name: initialize gcloud
          command: |
            echo $GCLOUD_SERVICE_KEY | gcloud auth activate-service-account --key-file=-
            gcloud --quiet config set project ${GOOGLE_PROJECT_ID}
            gcloud --quiet config set compute/zone ${GOOGLE_COMPUTE_ZONE}

      - run:
          name: deploy production
          command: |
            curl -sL https://deb.nodesource.com/setup_10.x | bash -
            apt-get install -y nodejs
            npm i
            npm run build
            gcloud app deploy --quiet --project=hogehoge prod-app.yaml
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0