<commit_before># This references the default Ruby container from
# the Docker Hub.
# https://registry.hub.docker.com/_/ruby/
# If you want to use a specific version you would use a tag:
# ruby:2.2.2
box: drecom/centos-ruby:2.3.1
# You can also use services such as databases. Read more on our dev center:
# http://devcenter.wercker.com/docs/services/index.html
# services:
    # - postgres
    # http://devcenter.wercker.com/docs/services/postgresql.html

    # - mongo
    # http://devcenter.wercker.com/docs/services/mongodb.html

# This is the build pipeline. Pipelines are the core of wercker
# Read more about pipelines on our dev center
# http://devcenter.wercker.com/docs/pipelines/index.html
build:
    # Steps make up the actions in your pipeline
    # Read more about steps on our dev center:
    # http://devcenter.wercker.com/docs/steps/index.html
    steps:
        - script:
            name: Install Vagrant
            code: |
                wget https://releases.hashicorp.com/vagrant/1.8.4/vagrant_1.8.4_x86_64.rpm
                rpm -i vagrant_1.8.4_x86_64.rpm
                vagrant plugin install vagrant-digitalocean

        - script:
            # NOTE: vagrant v1.8.4 depends on bundler v1.12.5
            # https://github.com/mitchellh/vagrant/blob/v1.8.4/vagrant.gemspec#L23
            name: Install bundler
            code: |
                 gem uninstall bundler --all --force
                 gem install bundler -v 1.12.5

        - bundle-install:
            jobs: 4

        - script:
            name: create .ssh directory
            code: mkdir -m 700 -p $HOME/.ssh

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

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

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

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

        - script:
            name: vagrant ssh-config
            code: vagrant ssh-config
            cwd: spec/integration

        - script:
            name: run integration test
            code: bundle exec rake spec
            cwd: spec/integration

    after-steps:
        - script:
            name: Set variables
            code: |
                # NOTE: override .ruby-version in pretty-slack-notify
                export RBENV_VERSION=2.3.1

        - script:
            name: shutdown all vms
            code: vagrant destroy -f
            cwd: spec/integration

        - wantedly/pretty-slack-notify:
            webhook_url: $SLACK_WEBHOOK_URL
            username: wercker_build<commit_msg>Use slack-notifier instead of wantedly/pretty-slack-notify<commit_after># This references the default Ruby container from
# the Docker Hub.
# https://registry.hub.docker.com/_/ruby/
# If you want to use a specific version you would use a tag:
# ruby:2.2.2
box: drecom/centos-ruby:2.3.1
# You can also use services such as databases. Read more on our dev center:
# http://devcenter.wercker.com/docs/services/index.html
# services:
    # - postgres
    # http://devcenter.wercker.com/docs/services/postgresql.html

    # - mongo
    # http://devcenter.wercker.com/docs/services/mongodb.html

# This is the build pipeline. Pipelines are the core of wercker
# Read more about pipelines on our dev center
# http://devcenter.wercker.com/docs/pipelines/index.html
build:
    # Steps make up the actions in your pipeline
    # Read more about steps on our dev center:
    # http://devcenter.wercker.com/docs/steps/index.html
    steps:
        - script:
            name: Install Vagrant
            code: |
                wget https://releases.hashicorp.com/vagrant/1.8.4/vagrant_1.8.4_x86_64.rpm
                rpm -i vagrant_1.8.4_x86_64.rpm
                vagrant plugin install vagrant-digitalocean

        - script:
            # NOTE: vagrant v1.8.4 depends on bundler v1.12.5
            # https://github.com/mitchellh/vagrant/blob/v1.8.4/vagrant.gemspec#L23
            name: Install bundler
            code: |
                 gem uninstall bundler --all --force
                 gem install bundler -v 1.12.5

        - bundle-install:
            jobs: 4

        - script:
            name: create .ssh directory
            code: mkdir -m 700 -p $HOME/.ssh

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

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

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

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

        - script:
            name: vagrant ssh-config
            code: vagrant ssh-config
            cwd: spec/integration

        - script:
            name: run integration test
            code: bundle exec rake spec
            cwd: spec/integration

    after-steps:
        - script:
            name: shutdown all vms
            code: vagrant destroy -f
            cwd: spec/integration

        - slack-notifier:
            url: $SLACK_WEBHOOK_URL
            username: wercker_build
{'fraction_non_alphanumeric': 0.08682276533925824, 'fraction_numerical': 0.017262006494616306, 'mean_word_length': 1.6648451730418943, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1396297', 'n_tokens_mistral': 1855, 'n_tokens_neox': 1711, 'n_words': 459}