LoginSignup
3
5

More than 5 years have passed since last update.

LaravelをCircleCIでテストしてGAEへ自動デプロイ

Posted at

こんな感じ。

machine:
  timezone: Asia/Tokyo
  php:
    version: 7.0.4
  node:
    version: 6.3.0
  post:
    - npm install -g npm@3
  environment:
    APP_ENV: testing
    APP_KEY: "入力してください"
    DB_HOST: 127.0.0.1
    DB_CONNECTION: mysql
    DB_DATABASE: circle_test
    DB_USERNAME: ubuntu
    DB_PASSWORD: ""
    STORAGE_DIR: /tmp
database:
  override:
    - "php artisan migrate"
    - "php artisan db:seed"
test:
  pre:
    - echo "-----start test-----"
  override:
    - vendor/bin/phpunit
  post:
    - echo "-----end test-----"
deployment:
  staging:
    branch: develop
    commands:
      - cp app.yaml.staging app.yaml
      - gcloud config set project プロジェクト名
      - gcloud auth activate-service-account $ACCOUNT --key-file サービスアカウントのキーファイルパス
      - gcloud -q app deploy --version=staging
  production:
    branch: master
    commands:
      - cp app.yaml.production app.yaml
      - gcloud config set project プロジェクト名
      - gcloud auth activate-service-account $ACCOUNT --key-file サービスアカウントのキーファイルパス
      - gcloud -q app deploy
3
5
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
3
5