LoginSignup
36
37

More than 5 years have passed since last update.

Circle CIをカスタマイズしてテストからデプロイまで

Posted at

前書いた記事。
Circle CIでテストにかかる時間を短縮 w/ Jenkins
http://qiita.com/tachiba@github/items/73a7052ff9316f1eb1ca

冷静に考えたらJenkinsいらないじゃんって気づいた。

--

circle.yml

circle.yml
machine:
  ruby:
    version: 2.0.0-p195

deployment:
  staging:
    branch: develop
    commands:
      - bundle exec cap staging deploy:setup
      - bundle exec cap staging deploy

  production:
    branch: master
    commands:
      - bundle exec cap production deploy:setup
      - bundle exec cap production deploy

ふつうにcapまで書いちゃえば良いじゃん.
いくつか設定しとかなきゃいけないところがあって、

Circle CIのプロジェクトの設定から鍵を登録する

デプロイ先のサーバーに入る鍵を対で登録する

デプロイ先のサーバーからリポジトリへアクセスするための鍵をdeploy.rbに書く

set :ssh_options, {:keys => [File.join(ENV["HOME"], ".ssh", "github_no_kagi")]}

なんか、.ssh/configに書いてもうまくいかなかったので、こうなった。

デプロイのためにJenkins側でも環境を作るのって時間とリソースの無駄だし、スッキリした感じがある。

サーバーの鍵預けるのが不安じゃない方はアリでは?

36
37
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
36
37