sudo: required
services:
  - docker

before_install:
  - docker pull bbinet/salt-minion:wheezy
  - docker pull bbinet/salt-master

install:
  - cp test/top.sls .
  - docker run -d --name salt-master -v $PWD:/data -v $PWD/test/config:/config bbinet/salt-master
  - docker run -d --name consul-server01 -h consul-server01 --link salt-master:salt bbinet/salt-minion:wheezy
  - docker run -d --name servicehost01 -h servicehost01 --link salt-master:salt bbinet/salt-minion:wheezy
  - sleep 10
  - docker ps
  - sudo lxc-attach -n "$(docker inspect --format '{{.Id}}' salt-master)" -- salt-key -L
  - sudo lxc-attach -n "$(docker inspect --format '{{.Id}}' salt-master)" -- salt-key -Ay
  #- docker exec salt-master salt-key -L
  #- docker exec salt-master salt-key -Ay

script:
  - sudo lxc-attach -n "$(docker inspect --format '{{.Id}}' consul-server01)" -- salt-call --retcode-passthrough state.highstate test=True
  - sudo lxc-attach -n "$(docker inspect --format '{{.Id}}' servicehost01)" -- salt-call --retcode-passthrough state.highstate test=True
  #- docker exec consul-server01 salt-call --retcode-passthrough state.highstate test=True
  #- docker exec servicehost01 salt-call --retcode-passthrough state.highstate test=True

sudo: required
services:
  - docker

before_install:
  - docker pull bbinet/salt-minion:wheezy
  - docker pull bbinet/salt-master

install:
  - cp test/top.sls .
  - docker run -d --name salt-master -v $PWD:/data -v $PWD/test/config:/config bbinet/salt-master
  - docker run -d --name consul-server01 -h consul-server01 --link salt-master:salt bbinet/salt-minion:wheezy
  - docker run -d --name servicehost01 -h servicehost01 --link salt-master:salt bbinet/salt-minion:wheezy
  - sleep 10
  - docker ps
  - docker exec salt-master salt-key -L
  - docker exec salt-master salt-key -Ay

script:
  - docker exec consul-server01 salt-call --retcode-passthrough state.highstate test=True
  - docker exec servicehost01 salt-call --retcode-passthrough state.highstate test=True

Revert "Use lxc-attach instead of "docker exec""
Revert "Use lxc-attach instead of "docker exec""

This reverts commit 7e15251a225826cfb624ac47fe173d164b950cb1.
