LoginSignup
29
30

More than 5 years have passed since last update.

CircleCI on Heroku - 簡易自動デプロイ circle.ymlサンプル

Posted at

デプロイ + マイグレーション + Slack通知

  • stagingブランチに対するpush、mergeがトリガーになる
circle.yml
deployment:
  staging:
    branch: staging
    commands:
      - curl https://slack.com/api/chat.postMessage -X POST -d 'channel=#heroku' -d 'text=【START】ステージング環境へのデプロイを開始しました。' -d 'username=circle_ci' -d 'token=xoxp-xxxxxxxxxx'
      - git push git@heroku.com:MY-APP-NAME.git $CIRCLE_SHA1:refs/heads/master
      - heroku run rake db:migrate --app MY-APP-NAME
      - curl https://slack.com/api/chat.postMessage -X POST -d 'channel=#heroku' -d 'text=【END】ステージング環境へのデプロイが完了しました。' -d 'username=circle_ci' -d 'token=xoxp-xxxxxxxxxx'

※Slack-Channel名の#はエスケープしないでOK(エスケープすると「channel_not_found」エラーになる)

29
30
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
29
30