Skip to content

Commit

Permalink
Temporary fix commit for GeoServer travis unittests
Browse files Browse the repository at this point in the history
This commit attempts to copy over GeoServer lib from docker images to
host directory, because regular GeoServer war files not able to run.
  • Loading branch information
lucernae committed Oct 11, 2018
1 parent f52c030 commit 9817ca2
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 11 deletions.
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ branches:

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

Expand Down Expand Up @@ -69,6 +70,10 @@ before_script:
- scripts/misc/qgis_server_setup.sh before_script
- scripts/misc/bdd_setup.sh before_script

# Temporary Patch for Geoserver Travis Unittests
# Should be cleaned up after paver setup_geoserver run normally
- scripts/misc/geoserver_setup_patch.sh before_script

- paver setup

script:
Expand Down
4 changes: 2 additions & 2 deletions dev_config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
GEOSERVER_URL: "http://build.geo-solutions.it/geonode/geoserver/latest/geoserver-2.13.x.war"
DATA_DIR_URL: "http://build.geo-solutions.it/geonode/geoserver/latest/data-2.13.x.zip"
GEOSERVER_URL: "http://build.geo-solutions.it/geonode/geoserver/latest/geoserver-2.12.2.war"
DATA_DIR_URL: "http://build.geo-solutions.it/geonode/geoserver/latest/data-2.12.2.zip"
JETTY_RUNNER_URL: "http://repo2.maven.org/maven2/org/eclipse/jetty/jetty-runner/9.4.7.v20170914/jetty-runner-9.4.7.v20170914.jar"
WINDOWS:
py2exe: "http://downloads.sourceforge.net/project/py2exe/py2exe/0.6.9/py2exe-0.6.9.win32-py2.7.exe"
Expand Down
17 changes: 8 additions & 9 deletions pavement.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#
#########################################################################

import requests
import fileinput
import glob
import os
Expand Down Expand Up @@ -67,15 +68,13 @@ def grab(src, dest, name):
else:
download = False
if download:
if str(src).startswith("file://"):
src2 = src[7:]
if not os.path.exists(src2):
print "Source location (%s) does not exist" % str(src2)
else:
print "Copying local file from %s" % str(src2)
shutil.copyfile(str(src2), str(dest))
else:
urllib.urlretrieve(str(src), str(dest))
r = requests.get(str(src), verify=False, stream=True)
print "Stream download."
with open(str(dest), mode='wb') as f:
for chunk in r.iter_content(chunk_size=1024):
if chunk:
f.write(chunk)
print "Download finished."


@task
Expand Down
27 changes: 27 additions & 0 deletions scripts/misc/geoserver_setup_patch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env bash

set -x

if [ "$BACKEND" = "geonode.geoserver" ]; then

case $1 in
"before_install")
echo "Before install scripts"
ifconfig
pip install docker-compose==$DOCKER_COMPOSE_VERSION
scripts/misc/docker_check.sh
;;
"before_script")
echo "Setting up Geoserver docker"
echo "Start QGIS Server docker container"
docker run --rm -d --name geoserver_docker geosolutionsit/geoserver-docker:2.12.x tail -f /dev/null
docker ps
docker inspect geoserver_docker
echo "Copy over geoserver lib to host"
mkdir -p geoserver
docker cp geoserver_docker:/usr/local/tomcat/webapps/geoserver geoserver/
ls geoserver/geoserver
docker stop geoserver_docker
;;
esac
fi

0 comments on commit 9817ca2

Please sign in to comment.