パラボラアンテナと星の日記

あることないこと

wercker.ymlを元にCircleCI2.0用の設定ファイルを書いてみる!

設定ファイルがめっちゃ似てる

ので移行しようと思ったら瞬時に終わります。

手元にあったrails用のwercker.yml

phantomjsはdocker image内に入れてしまっています(諸事情でrubyのバージョンが古い)

# wercker.yml
box: hoshinotsuyoshi/ruby:2.1.3-phantomjs
build:
    steps:
        - bundle-install
        - script:
            name: timezone
            code: ln -sf /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
        - script:
            name: rspec
            code: bundle exec rspec

yamlを書いてみる

このファイルとかを 参考に書いたのがこちら。

# .circleci/config.yml
version: 2
jobs:
  build:
    docker:
      - image: hoshinotsuyoshi/ruby:2.1.3-phantomjs
    working_directory: /home/ubuntu/hogehoge
    steps:
      - checkout
      - run:
          name: Install Ruby Dependencies
          command: bundle install
      - run:
          name: timezone
          command: ln -sf /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
      - run:
          name: rspec
          command: bundle exec rspec

これで終わりです。

ローカルで試す この方法でcircleci buildして手元テストが動きました。

こちらの記事 も見ました。

circleci.com上では、まだビルドを試したりしていない。