machine:
  services:
    - docker
dependencies:
  cache_directories:
    - "~/docker-apt-cacher-ng"
  override:
    - docker info
    - if [[ -e ~/docker-apt-cacher-ng/image.tar ]]; then docker load --input ~/docker-apt-cacher-ng/image.tar; fi
    - docker build -t sameersbn/apt-cacher-ng .
    - mkdir -p ~/docker-apt-cacher-ng; docker save --output ~/docker-apt-cacher-ng/image.tar sameersbn/apt-cacher-ng
test:
  override:
    - docker run --name=apt-cacher-ng -d -p 172.17.42.1:3142:3142 sameersbn/apt-cacher-ng; sleep 10
    - docker exec -it apt-cacher-ng su -c 'echo "Acquire::http::Proxy \"http://172.17.42.1:3142\";" > /etc/apt/apt.conf.d/01proxy'

machine:
  services:
    - docker
dependencies:
  cache_directories:
    - "~/docker-apt-cacher-ng"
  override:
    - docker info
    - if [[ -e ~/docker-apt-cacher-ng/image.tar ]]; then docker load --input ~/docker-apt-cacher-ng/image.tar; fi
    - docker build -t sameersbn/apt-cacher-ng .
    - mkdir -p ~/docker-apt-cacher-ng; docker save --output ~/docker-apt-cacher-ng/image.tar sameersbn/apt-cacher-ng
test:
  override:
    - docker run -d -p 172.17.42.1:3142:3142 sameersbn/apt-cacher-ng; sleep 10
    - curl --retry 10 --retry-delay 5 -v "http://172.17.42.1:3142/acng-report.html?doCount=Count+Data"

Revert "ci: test apt-cacher-ng from within the apt-cacher-ng container"
Revert "ci: test apt-cacher-ng from within the apt-cacher-ng container"

This reverts commit 16028df9a87cb542c8698e6e9304b4c788e553f8.

circleci does not support `exec`.. FUCK IT!
