From 98204991ec25de29f613f04b5138b1df01e0db2c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Adrien=20B=C3=A9raud?= <adrien.beraud@savoirfairelinux.com>
Date: Fri, 29 Jul 2016 20:06:51 -0400
Subject: [PATCH] travis with docker

---
 .travis.yml | 34 +++-------------------------------
 Dockerfile  |  6 ++++++
 2 files changed, 9 insertions(+), 31 deletions(-)
 create mode 100644 Dockerfile

diff --git a/.travis.yml b/.travis.yml
index 2e7ac20e..fb2db830 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,44 +1,16 @@
-sudo: false
+sudo: required
 
 services:
   - docker
 
 language: cpp
 
-compiler:
-  - gcc
-  - clang
-
-addons:
-  apt:
-    sources:
-    - ubuntu-toolchain-r-test
-    packages:
-    - gcc-6
-    - g++-6
-    - libgnutls28-dev
-    - cmake
-
 before_install:
-  - if [ $TRAVIS_OS_NAME == linux ] && [ $CXX == g++ ]; then export CXX=/usr/bin/g++-6 && export CC=/usr/bin/gcc-6; fi
-  - if [ $TRAVIS_OS_NAME == linux ]; then git clone https://github.com/msgpack/msgpack-c.git; fi
-  - if [ $TRAVIS_OS_NAME == linux ]; then cd msgpack-c && git checkout cpp-1.2.0 && mkdir build && mkdir -p $HOME/usr && cd build; fi
-  - if [ $TRAVIS_OS_NAME == linux ]; then cmake -DCMAKE_INSTALL_PREFIX=$HOME/usr -DMSGPACK_CXX11=ON -DMSGPACK_BUILD_EXAMPLES=OFF .. && make -j && make install && cd ../.. && pwd; fi
-  - if [ $TRAVIS_OS_NAME == osx ]; then brew update && brew install llvm36 && brew install msgpack && brew install gnutls && brew link --force llvm36; fi
-
-before_script:
-  - if [ $TRAVIS_OS_NAME == linux ]; then travis_retry ./autogen.sh && ./configure --prefix=$HOME/usr; fi
-  - if [ $TRAVIS_OS_NAME == osx ]; then travis_retry ./autogen.sh && ./configure; fi
+- docker pull aberaud/opendht-deps
 
 script:
-  - make -j
+- docker build .
 
 notifications:
   email:
       - adrien.beraud@savoirfairelinux.com
-
-env:
-  - LANG="en_US.UTF-8"
-
-os:
-  - osx
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 00000000..51e93acb
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,6 @@
+FROM aberaud/opendht-deps
+MAINTAINER Adrien Béraud <adrien.beraud@savoirfairelinux.com>
+COPY . /root/opendht
+RUN cd /root/opendht && mkdir build && cd build \
+	&& cmake .. -DCMAKE_INSTALL_PREFIX=/usr && make -j8 && make install \
+	&& cd ../.. && rm -rf opendht
-- 
GitLab