ryotarai/itamae

View on GitHub
wercker.yml

Summary

Maintainability
Test Coverage
box: wercker/rvm
# Build definition
build:
  # The steps that will be executed on build
  # See the Ruby section on the wercker devcenter:
  # http://devcenter.wercker.com/articles/languages/ruby.html
  steps:
    # Uncomment this to force RVM to use a specific Ruby version
    - rvm-use:
        version: 2.2.3

    - script:
        name: update bundler
        code: gem update bundler

    # A step that executes `bundle install` command
    - bundle-install

    # A custom script step, name value is used in the UI
    # and the code value contains the command that get executed
    - 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: create .ssh directory
        code: mkdir -p $HOME/.ssh

    - create-file:
        name: put private key
        filename: $HOME/.ssh/id_rsa.vagrant
        overwrite: true
        hide-from-log: true
        content: $DIGITALOCEAN_PRIVATE_KEY

    - create-file:
        name: put public key
        filename: $HOME/.ssh/id_rsa.vagrant.pub
        overwrite: true
        hide-from-log: true
        content: $DIGITALOCEAN_PUBLIC_KEY

    - script:
        name: chmod 600 id_rsa
        code: chmod 600 $HOME/.ssh/id_rsa.vagrant

    - script:
        name: install libxml and libxslt
        code: sudo apt-get install libxml2-dev libxslt1-dev

    - script:
        name: bundle install
        code: bundle install --deployment -j4

    - script:
        name: start vm
        code: bundle exec vagrant up --provider=digital_ocean
        cwd: spec/integration

    # Add more steps here:
    - script:
        name: rspec
        code: bundle exec rake spec

  after-steps:
    - script:
        name: shutdown vm
        code: bundle exec vagrant destroy -f
        cwd: spec/integration

    - script:
        name: shutdown old vms
        code: bundle exec ruby ci/destroy_old_droplets.rb