---
sudo: required

services:
  - docker

env:
  matrix:
    - distribution: centos
      version: 7
      init: /usr/lib/systemd/systemd
      run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"

before_install:
  - 'docker pull ${distribution}:${version}'

  - container_id=$(mktemp)
  - 'docker run --detach ${run_opts} ${distribution}:${version} "${init}" > "${container_id}"'

script:
  - 'docker exec --tty "$(cat ${container_id})" env TERM=xterm yum install -y sudo'
  - 'docker exec --tty "$(cat ${container_id})" env TERM=xterm bash -c "$(curl -fsSL https://git.io/imokuri)"'
  - 'docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook ~/.setup.yaml --tags optional'

  - 'docker stop "$(cat ${container_id})"'

notifications:
  email: false

---
sudo: required

services:
  - docker

env:
  matrix:
    - distribution: centos
      version: 7
      init: /usr/lib/systemd/systemd
      run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"

before_install:
  - docker pull ${distribution}:${version}

  - container_id=$(mktemp)
  - docker run --detach ${run_opts} ${distribution}:${version} "${init}" > "${container_id}"

script:
  - docker exec --tty "$(cat ${container_id})" env TERM=xterm yum install -y sudo
  - docker exec --tty "$(cat ${container_id})" env TERM=xterm bash -c "$(curl -fsSL https://git.io/imokuri)"
  - docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook ~/.setup.yaml --tags optional

  - docker stop "$(cat ${container_id})"

notifications:
  email: false

Revert "add quote for docker command"
Revert "add quote for docker command"

This reverts commit 4ba55bf7f8a8b6bed7b8f604f678275f0f68e65d.
