Capistrano へのデプロイ
クラウド
This document is applicable to CircleCI クラウド
Server v4.x
This document is applicable to CircleCI Server v4.x
Server v3.x
This document is applicable to CircleCI Server v3.x
このノウハウガイドでは、CapistranoにデプロイするためのCircleCIの設定例を紹介します。
はじめに
このページでは、Capistrano にデプロイするための設定ファイルを紹介します。 Capistrano を使用するようにプロジェクトをセットアップしたら、CircleCI のジョブステップで、必要に応じて デプロイコマンド を実行できます。
設定ファイル例
version: 2.1
workflows:
build-deploy:
jobs:
- build-job
- deploy-job:
requires:
- build-job # Only run deploy job once build job has completed
filters:
branches:
only: main # Only run deploy job when commit is on the main branch
jobs:
# build and test jobs go here - not included for brevity
deploy-job:
docker:
- image: <docker-image-name-tag>
auth:
username: mydockerhub-user
password: $DOCKERHUB_PASSWORD # context / project UI env-var reference
working_directory: ~/repo
steps:
- checkout
- run:
name: Bundle Install
command: bundle check || bundle install
- run:
name: Deploy if tests pass and branch is Main
command: bundle exec cap production deploy