Browse Source

test with docker ubuntu 16.04 ok

nico 8 years ago
parent
commit
fef568997f
2 changed files with 28 additions and 2 deletions
  1. 13 1
      docker/docker.md
  2. 15 1
      docker/ubuntu_16_04.dockerfile

+ 13 - 1
docker/docker.md

@@ -2,7 +2,19 @@
 
 ## Create images
 
-Build the image for Ubuntu 16.04
+Build the image for Ubuntu 16.04.
 ```
 docker build --force-rm=true -t kalliope-app -f ubuntu_16_04.dockerfile .
+```
+
+If we want a specific branch of Kalliope
+```
+docker build --force-rm=true --build-arg branch=dev -t kalliope-app -f ubuntu_16_04.dockerfile .
+```
+
+## Run the test
+
+Ubuntu image
+```
+docker run -it --rm kalliope-app
 ```

+ 15 - 1
docker/ubuntu_16_04.dockerfile

@@ -9,10 +9,24 @@ RUN echo "deb http://us.archive.ubuntu.com/ubuntu/ xenial multiverse" >> /etc/ap
 RUN apt-get update && apt-get install -y \
     git python-dev libsmpeg0 libttspico-utils libsmpeg0 flac dialog \
     libffi-dev libffi-dev libssl-dev portaudio19-dev build-essential \
-    sox libatlas3-base mplayer wget \
+    sox libatlas3-base mplayer wget vim\
     && rm -rf /var/lib/apt/lists/*
 
 # Install the last PIP
 RUN wget https://bootstrap.pypa.io/get-pip.py
 RUN python get-pip.py
 
+# add a standart user. tests must not be ran as root
+RUN useradd -m -u 1000 tester
+
+# by default we get the master branch. We can override this by adding
+ARG branch=master
+RUN cd /home/tester && git clone https://github.com/kalliope-project/kalliope.git
+RUN cd /home/tester/kalliope && git checkout ${branch} && python setup.py install
+RUN chown -R tester:tester /home/tester/kalliope
+
+USER tester
+WORKDIR /home/tester/kalliope
+
+# run tests
+CMD ["python", "-m", "unittest", "discover"]