From 28cb05e45b5f3b6123149d2dea7342edf3df3627 Mon Sep 17 00:00:00 2001 From: David Manzanares Date: Fri, 6 Oct 2017 18:24:11 +0200 Subject: [PATCH] Use windshaft docker image --- Dockerfile | 13 ++++++++----- docker-test.sh | 10 ++++++++++ package.json | 7 +++---- 3 files changed, 21 insertions(+), 9 deletions(-) create mode 100644 docker-test.sh diff --git a/Dockerfile b/Dockerfile index 3b4fd258..d16731c5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,21 +1,23 @@ FROM ubuntu:xenial - +# Add external repos RUN apt-get -y update RUN apt-get install -y software-properties-common RUN add-apt-repository -y ppa:ubuntu-toolchain-r/test RUN apt-get -y update -RUN apt-get -y install curl wget protobuf-c-compiler -#Use UTF8 to avoid encoding problems with pgsql +# Use UTF8 to avoid encoding problems with pgsql RUN apt-get -y install locales ENV LANG C.UTF-8 RUN locale-gen en_US.UTF-8 RUN update-locale LANG=en_US.UTF-8 -#Add 6.X node ppa +# Add 6.X node ppa +RUN apt-get -y install curl RUN curl -sL https://deb.nodesource.com/setup_6.x | bash -RUN apt-get -y install make libpixman-1-dev pkg-config postgresql-9.5 libcairo2-dev libjpeg8-dev libgif-dev libpango1.0-dev libgdal1i libgeos-dev libxml2-dev libgdal-dev libproj-dev postgresql-server-dev-9.5 redis-server nodejs gcc-4.9 g++-4.9 libprotobuf-c-dev git postgresql-plpython-9.5 libjson-c-dev + +# Install dependencies +RUN apt-get -y install make libpixman-1-dev pkg-config postgresql-9.5 libcairo2-dev libjpeg8-dev libgif-dev libpango1.0-dev libgdal1i libgeos-dev libxml2-dev libgdal-dev libproj-dev postgresql-server-dev-9.5 redis-server nodejs gcc-4.9 g++-4.9 libprotobuf-c-dev git postgresql-plpython-9.5 libjson-c-dev wget protobuf-c-compiler # Install PostGIS 2.4 from sources RUN wget http://download.osgeo.org/postgis/source/postgis-2.4.0.tar.gz && tar xvfz postgis-2.4.0.tar.gz && cd postgis-2.4.0 && ./configure && make && make install && cd .. && rm -rf postgis-2.4.0 @@ -26,6 +28,7 @@ RUN echo "host all all 0.0.0.0/0 trust" >> /etc/postgresql/ RUN echo "host all all ::1/128 trust" >> /etc/postgresql/9.5/main/pg_hba.conf RUN echo "listen_addresses='*'" >> /etc/postgresql/9.5/main/postgresql.conf +# Clean RUN apt-get -y remove wget protobuf-c-compiler RUN apt-get -y autoremove diff --git a/docker-test.sh b/docker-test.sh new file mode 100644 index 00000000..e340369e --- /dev/null +++ b/docker-test.sh @@ -0,0 +1,10 @@ +export NPROCS=1 && export JOBS=1 && export CXX=g++-4.9 && export PGUSER=postgres + +npm install + + /etc/init.d/postgresql start + +createdb template_postgis && createuser publicuser +psql -c "CREATE EXTENSION postgis" template_postgis + +npm test \ No newline at end of file diff --git a/package.json b/package.json index 5af0b9d3..b65a64d1 100644 --- a/package.json +++ b/package.json @@ -61,10 +61,9 @@ "test": "make test-all", "update-internal-deps": "rm -rf node_modules && rm -f yarn.lock && yarn", "docker-install": "sudo apt install docker.io && sudo usermod -aG docker $(whoami)", - "docker-pull": "docker pull cartoimages/windshaft-carto-testing", - "docker-test": "docker run -v `pwd`:/srv cartoimages/windshaft-carto-testing", - "docker-bash": "docker run -it -v `pwd`:/srv cartoimages/windshaft-carto-testing bash", - "docker-build": "docker build -t cartoimages/windshaft-carto-testing .", + "docker-pull": "docker pull cartoimages/windshaft-testing", + "docker-test": "docker run -v `pwd`:/srv cartoimages/windshaft-testing bash docker-test.sh", + "docker-bash": "docker run -it -v `pwd`:/srv cartoimages/windshaft-testing bash", "docker-publish": "docker push cartoimages/windshaft-carto-testing" }, "engines": {