language: c
services:
  - docker
env:
  - mitamae_version="1.7.1"
script:
  # download mitamae
  - curl -o "/tmp/mitamae-x86_64-linux.tar.gz" -fL "https://github.com/k0kubun/mitamae/releases/download/v${mitamae_version}/mitamae-x86_64-linux.tar.gz"
  - tar xvzf "/tmp/mitamae-x86_64-linux.tar.gz" -C /tmp
  - install -m 0555 /tmp/mitamae-x86_64-linux /tmp/mitamae

  # prepare node.yml for testing
  - |
    cat <<YAML > /tmp/node.yml
    rbenv:
      global:
        2.6.1
      versions:
        - 2.6.1
    YAML

  # prepare recipe for testing
  - |
    cat <<RUBY > /tmp/default.rb
    execute 'apt-get update'
    package 'curl'

    include_recipe 'rbenv::system'
    RUBY

  # run mitamae with the plugin
  - |
    docker run -it -v "$(pwd):/plugins/itamae-plugin-recipe-rbenv" -v "/tmp:/travis" ubuntu:18.04 \
      bash -c "cd / && /travis/mitamae local -y /travis/node.yml /travis/default.rb"

language: c
services:
  - docker
env:
  - mitamae_version="1.7.1"
script:
  # download mitamae
  - curl -o "/tmp/mitamae-x86_64-linux.tar.gz" -fL "https://github.com/k0kubun/mitamae/releases/download/v${mitamae_version}/mitamae-x86_64-linux.tar.gz"
  - tar xvzf "/tmp/mitamae-x86_64-linux.tar.gz" -C /tmp
  - install -m 0555 /tmp/mitamae-x86_64-linux /tmp/mitamae

  # prepare node.yml for testing
  - |
    cat <<YAML > /tmp/node.yml
    rbenv:
      global:
        2.6.1
      versions:
        - 2.6.1
      plugins:
        dcarley/rbenv-sudo:
          revision: master
    ruby-build:
      revision: master
    rbenv-default-gems:
      default-gems:
        - bundler
      install: true
    YAML

  # prepare recipe for testing
  - |
    cat <<RUBY > /tmp/default.rb
    execute 'apt-get update'
    package 'curl'

    include_recipe 'rbenv::system'
    RUBY

  # run mitamae with the plugin
  - |
    docker run -it -v "$(pwd):/plugins/itamae-plugin-recipe-rbenv" -v "/tmp:/travis" ubuntu:18.04 \
      bash -c "cd / && /travis/mitamae local -y /travis/node.yml /travis/default.rb"

Test plugin installation on CI
Test plugin installation on CI
