16
17

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Rails+postgresql+capistrano環境のwercker設定

Last updated at Posted at 2014-07-29

無料でCIしたいと思って導入したwercker。UIきれいですごくいい。

参考:http://devcenter.wercker.com/articles/introduction/

wercker.yml
box: wercker/ubuntu12.04-ruby2.0.0
services:
    - wercker/postgresql
build:
    steps:
        - bundle-install
        - rails-database-yml:
            service: postgresql
        - script:
            name: echo ruby information
            code: |
                echo "ruby version $(ruby --version) running"
                echo "from location $(which ruby)"
                echo -p "gem list: $(gem list)"
        - script:
            name: Set up db
            code: bundle exec rake db:schema:load RAILS_ENV=test
        - script:
            name: rspec
            code: bundle exec rspec
deploy:
    steps:
        - bundle-install
        - script:
            name: make .ssh directory
            code: mkdir -p "$HOME/.ssh"
        - create-file:
            name: write ssh key
            filename: $HOME/.ssh/id_rsa
            overwrite: true
            hide-from-log: true
            content: $WERCKER_SSH_KEY_PRIVATE
        - script:
            name: set permissions for ssh key
            code: chmod 0400 $HOME/.ssh/id_rsa
        - cap

WERCHER_SSH_KEYはwercherの設定画面からkeyを設定します。

参考

設定ファイルが正しいかどうかを確認するvalidate wercker.ymlにだいぶお世話になりました。問い合わせもすごいちゃんと答えてくれて無料だけど運営すごい頑張ってる。

16
17
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
16
17

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?