Skip to content

Commit

Permalink
Add Dockerfile to reproduce Travis-CI environment for debug purposes
Browse files Browse the repository at this point in the history
  • Loading branch information
augu5te committed Sep 3, 2016
1 parent 0235020 commit ca3c369
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions misc/Dockerfile-CI
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#
# Aims of this Dockerfile is to reproduce environment similiar to one
# use during Travis CI.
#
FROM ubuntu:14.04
MAINTAINER Olivier Richard "[email protected]"

ENV container docker
ENV CONTAINER_LIB_PATH /var/lib/container
ENV HOME /root
ENV LC_ALL C
ENV DEBIAN_FRONTEND noninteractive
ENV DEBIAN_PRIORITY critical
ENV DEBCONF_NOWARNINGS yes
ENV COLOR green

ENV DB=postgresql
ENV PGPASSWORD=oar

RUN echo "export COLOR=green" > /etc/hostname.color

RUN apt-get update
RUN apt-get -y install \
git python python-virtualenv postgresql libpq-dev python-dev

RUN mkdir -p /etc/oar
RUN virtualenv -p python $HOME/virtualenv
RUN /bin/bash -c "source $HOME/virtualenv/bin/activate"
RUN pip install tox coverage pytest psycopg2 sphinx pytest-flask pytest-cov

RUN sed -i 's/peer/trust/g' /etc/postgresql/9.3/main/pg_hba.conf

RUN /etc/init.d/postgresql start && psql -U postgres -c "CREATE USER oar WITH PASSWORD 'oar';" \
&& psql -U postgres -c "CREATE DATABASE oar;" \
&& psql -U postgres -c "GRANT ALL PRIVILEGES ON DATABASE oar to oar;" \
&& psql -U postgres -c "CREATE USER oar_ro WITH PASSWORD 'oar_ro';" \
&& psql -U oar -c "ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO oar_ro;" -h localhost

RUN git clone --depth=50 --branch=master https://github.com/oar-team/oar3.git /root/oar3

0 comments on commit ca3c369

Please sign in to comment.