Skip to content

Commit

Permalink
- Test GeoServer Integration Tests running with Docker Compose
Browse files Browse the repository at this point in the history
  • Loading branch information
afabiani committed May 14, 2018
1 parent 02fbe20 commit dbde966
Show file tree
Hide file tree
Showing 10 changed files with 365 additions and 175 deletions.
298 changes: 160 additions & 138 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,138 +1,160 @@
sudo: required

language: python

cache:
directories:
- $HOME/.cache/pip

before_cache:
- rm -f $HOME/.cache/pip/log/debug.log

python:
- "2.7"

virtualenv:
system_site_packages: true

services:
- docker
- postgresql

addons:
postgresql: 9.6
apt:
packages:
- postgresql-9.6-postgis-2.3

env:
- BACKEND: 'geonode.geoserver'
ON_TRAVIS: 'True'
TEST_RUN_CORE: 'True'
MONITORING_ENABLED: 'False'
- BACKEND: 'geonode.geoserver'
ON_TRAVIS: 'True'
TEST_RUN_INTERNAL_APPS: 'True'
MONITORING_ENABLED: 'False'
- BACKEND: 'geonode.geoserver'
ON_TRAVIS: 'True'
TEST_RUN_INTEGRATION: 'True'
MONITORING_ENABLED: 'False'
- BACKEND: 'geonode.qgis_server'
DOCKER_COMPOSE_VERSION: 1.11.2
# This is qgis server address
QGIS_SERVER_URL: http://localhost:9000/
# This is the location of docker network bridge
# So QGIS server can access this address
SITEURL: http://localhost:8000/
QGIS_SERVER_PORT: 9000
ON_TRAVIS: 'True'
TEST_RUN_CORE: 'True'
MONITORING_ENABLED: 'False'
CELERY_ALWAYS_EAGER: 'True'
- BACKEND: 'geonode.qgis_server'
DOCKER_COMPOSE_VERSION: 1.11.2
# This is qgis server address
QGIS_SERVER_URL: http://localhost:9000/
# This is the location of docker network bridge
# So QGIS server can access this address
SITEURL: http://localhost:8000/
QGIS_SERVER_PORT: 9000
ON_TRAVIS: 'True'
TEST_RUN_INTERNAL_APPS: 'True'
MONITORING_ENABLED: 'False'
CELERY_ALWAYS_EAGER: 'True'
- BACKEND: 'geonode.qgis_server'
DOCKER_COMPOSE_VERSION: 1.11.2
# This is qgis server address
QGIS_SERVER_URL: http://localhost:9000/
# This is the location of docker network bridge
# So QGIS server can access this address
SITEURL: http://localhost:8000/
QGIS_SERVER_PORT: 9000
ON_TRAVIS: 'True'
TEST_RUN_INTEGRATION: 'True'
MONITORING_ENABLED: 'False'
CELERY_ALWAYS_EAGER: 'True'

branches:
only:
- master
- 2.9.x
- 2.7.x
- 2.6.x

before_install:
- scripts/misc/qgis_server_setup.sh before_install
- chmod +x scripts/misc/bdd_setup.sh
- scripts/misc/bdd_setup.sh before_install

install:
- sudo apt-get -qq -y update
- sudo apt-get install -y libgdal1h python-gdal gdal-bin spatialite-bin
- sudo apt-get install -y python-virtualenv python-imaging python-lxml python-pyproj python-shapely python-nose python-httplib2 python-httplib2 gettext
- sudo apt-get install -y python-dev libxml2 libxml2-dev libxslt1-dev zlib1g-dev libjpeg-dev libpq-dev libgdal-dev git default-jdk
- sudo add-apt-repository -y ppa:webupd8team/java
- sudo apt-get update
- sudo apt-get install -y --force-yes oracle-java8-installer ant maven2 --no-install-recommends
- sudo update-java-alternatives --set java-8-oracle
- pip install -r requirements.txt
- pip install -e .
- pip install pygdal==`gdal-config --version`
- pip install codecov

before_script:
# Initialize DB
# - sudo apt-get install postgresql-9.6-postgis-2.3 -y -q
- psql -U postgres -c "create extension postgis"
- chmod +x scripts/misc/create_dbs_travis.sh
- scripts/misc/create_dbs_travis.sh before_script
# For QGIS Server Travis steps
- scripts/misc/qgis_server_setup.sh before_script
- scripts/misc/bdd_setup.sh before_script

- paver setup

script:
- paver run_tests --coverage --local false

after_script:
# For QGIS Server Travis steps
- scripts/misc/qgis_server_setup.sh after_script

# Cleanup
- paver reset_hard

after_success:
- codecov

notifications:
irc:
channels:
- "irc.freenode.org#geonode"
use_notice: true
email:
- alessio.fabiani@gmail.com
- ingenieroariel@gmail.com
- simone.dalmasso@gmail.com
slack: geonode-sprint:oQylJRkU9feZ8JruGi6czWwe
sudo: required

language: python

cache:
directories:
- $HOME/.cache/pip

before_cache:
- rm -f $HOME/.cache/pip/log/debug.log

python:
- "2.7"

virtualenv:
system_site_packages: true

services:
- docker
- postgresql

addons:
hosts:
- geonode
postgresql: 9.6
apt:
packages:
- postgresql-9.6-postgis-2.3
- nginx

env:
- BACKEND: 'geonode.geoserver'
ON_TRAVIS: 'True'
TEST_RUN_CORE: 'True'
MONITORING_ENABLED: 'False'
- BACKEND: 'geonode.geoserver'
ON_TRAVIS: 'True'
TEST_RUN_INTERNAL_APPS: 'True'
MONITORING_ENABLED: 'False'
- BACKEND: 'geonode.geoserver'
DOCKER_COMPOSE_VERSION: 1.19.0
# This is GeoServer server address
GEOSERVER_SERVER_URL: http://localhost:8080/geoserver/
GEOSERVER_SERVER_PORT: 8080
ON_TRAVIS: 'True'
TEST_RUN_INTEGRATION: 'True'
MONITORING_ENABLED: 'False'
CELERY_ALWAYS_EAGER: 'True'
- BACKEND: 'geonode.qgis_server'
DOCKER_COMPOSE_VERSION: 1.11.2
# This is qgis server address
QGIS_SERVER_URL: http://localhost:9000/
# This is the location of docker network bridge
# So QGIS server can access this address
SITEURL: http://localhost:8000/
QGIS_SERVER_PORT: 9000
ON_TRAVIS: 'True'
TEST_RUN_CORE: 'True'
MONITORING_ENABLED: 'False'
CELERY_ALWAYS_EAGER: 'True'
- BACKEND: 'geonode.qgis_server'
DOCKER_COMPOSE_VERSION: 1.11.2
# This is qgis server address
QGIS_SERVER_URL: http://localhost:9000/
# This is the location of docker network bridge
# So QGIS server can access this address
SITEURL: http://localhost:8000/
QGIS_SERVER_PORT: 9000
ON_TRAVIS: 'True'
TEST_RUN_INTERNAL_APPS: 'True'
MONITORING_ENABLED: 'False'
CELERY_ALWAYS_EAGER: 'True'
- BACKEND: 'geonode.qgis_server'
DOCKER_COMPOSE_VERSION: 1.11.2
# This is qgis server address
QGIS_SERVER_URL: http://localhost:9000/
# This is the location of docker network bridge
# So QGIS server can access this address
SITEURL: http://localhost:8000/
QGIS_SERVER_PORT: 9000
ON_TRAVIS: 'True'
TEST_RUN_INTEGRATION: 'True'
MONITORING_ENABLED: 'False'
CELERY_ALWAYS_EAGER: 'True'

branches:
only:
- master
- 2.9.x
- 2.8.0
- 2.7.x
- 2.6.x

before_install:
- scripts/misc/geoserver_server_setup.sh before_install
- scripts/misc/qgis_server_setup.sh before_install
- chmod +x scripts/misc/bdd_setup.sh
- scripts/misc/bdd_setup.sh before_install

install:
- sudo apt-get -qq -y update
- sudo apt-get install -y libgdal1h python-gdal gdal-bin spatialite-bin
- sudo apt-get install -y python-virtualenv python-imaging python-lxml python-pyproj python-shapely python-nose python-httplib2 python-httplib2 gettext
- sudo apt-get install -y python-dev libxml2 libxml2-dev libxslt1-dev zlib1g-dev libjpeg-dev libpq-dev libgdal-dev git default-jdk
- sudo add-apt-repository -y ppa:webupd8team/java
- sudo apt-get update
- sudo apt-get install -y --force-yes oracle-java8-installer ant maven2 --no-install-recommends
- sudo update-java-alternatives --set java-8-oracle
- pip install -r requirements.txt
- pip install -e .
- pip install pygdal==`gdal-config --version`
- pip install codecov

before_script:
# Initialize DB
# - sudo apt-get install postgresql-9.6-postgis-2.3 -y -q
- psql -U postgres -c "create extension postgis"
- chmod +x scripts/misc/create_dbs_travis.sh
- scripts/misc/create_dbs_travis.sh before_script
# For GeoServer Server Travis steps
- scripts/misc/geoserver_server_setup.sh before_script
# For QGIS Server Travis steps
- scripts/misc/qgis_server_setup.sh before_script
- scripts/misc/bdd_setup.sh before_script

# Start NGINX server
- sudo nginx -s stop
- sudo nginx -c `pwd`/scripts/misc/nginx_integration.conf

# Setup GeoNode
- paver setup

script:
- paver run_tests --coverage --local false

after_script:
# For GeoServer Server Travis steps
- scripts/misc/geoserver_server_setup.sh after_script
# For QGIS Server Travis steps
- scripts/misc/qgis_server_setup.sh after_script

# Stop NGINX server
- sudo nginx -c `pwd`/scripts/misc/nginx_integration.conf -s stop

# Cleanup
- paver reset_hard

after_success:
- codecov

notifications:
irc:
channels:
- "irc.freenode.org#geonode"
use_notice: true
email:
- alessio.fabiani@gmail.com
- ingenieroariel@gmail.com
- simone.dalmasso@gmail.com
slack: geonode-sprint:oQylJRkU9feZ8JruGi6czWwe
37 changes: 37 additions & 0 deletions docker-compose-geoserver-server.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
version: '2.2'
services:

data-dir-conf:
image: geonode/geoserver_data:2.13.x
restart: on-failure
container_name: gsconf4${COMPOSE_PROJECT_NAME}
labels:
org.geonode.component: conf
org.geonode.instance.name: geonode
command: /bin/true
volumes:
- geoserver-data-dir:/geoserver_data/data

geoserver:
image: geonode/geoserver:2.13.x
restart: unless-stopped
container_name: geoserver4${COMPOSE_PROJECT_NAME}
stdin_open: true
# tty: true
labels:
org.geonode.component: geoserver
org.geonode.instance.name: geonode
depends_on:
- data-dir-conf
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- geoserver-data-dir:/geoserver_data/data
env_file:
- ./scripts/docker/env/production/geoserver.env
ports:
- "${GEOSERVER_SERVER_PORT}:8080"
network_mode: "bridge"

volumes:
geoserver-data-dir:
name: ${COMPOSE_PROJECT_NAME}-gsdatadir
23 changes: 12 additions & 11 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,17 @@ services:
env_file:
- ./scripts/docker/env/production/celery.env

data-dir-conf:
image: geonode/geoserver_data:2.13.x
restart: on-failure
container_name: gsconf4${COMPOSE_PROJECT_NAME}
labels:
org.geonode.component: conf
org.geonode.instance.name: geonode
command: /bin/true
volumes:
- geoserver-data-dir:/geoserver_data/data

geoserver:
image: geonode/geoserver:2.13.x
restart: unless-stopped
Expand All @@ -68,6 +79,7 @@ services:
- db
# - elasticsearch
- rabbitmq
- data-dir-conf
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- geoserver-data-dir:/geoserver_data/data
Expand Down Expand Up @@ -110,17 +122,6 @@ services:
ports:
- "80:80"

data-dir-conf:
image: geonode/geoserver_data:2.13.x
restart: on-failure
container_name: gsconf4${COMPOSE_PROJECT_NAME}
labels:
org.geonode.component: conf
org.geonode.instance.name: geonode
command: /bin/true
volumes:
- geoserver-data-dir:/geoserver_data/data

volumes:
geoserver-data-dir:
name: ${COMPOSE_PROJECT_NAME}-gsdatadir
Expand Down

0 comments on commit dbde966

Please sign in to comment.