Skip to content

Commit

Permalink
Fixes Travis geonode-selenium build
Browse files Browse the repository at this point in the history
  • Loading branch information
afabiani committed Feb 21, 2019
1 parent 9c8d1b2 commit d8b05a3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
16 changes: 9 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ addons:
postgresql: 9.6
apt:
packages:
- postgresql-9.6-postgis-2.4
- nginx
- postgresql-9.6-postgis-2.4
- nginx
firefox: "latest-esr"

matrix:
Expand All @@ -36,13 +36,15 @@ matrix:
python: 2.7
env:
- BACKEND: 'geonode.geoserver'
DOCKER_COMPOSE_VERSION: 1.19.0
ON_TRAVIS: 'True'
TEST_RUN_CORE: 'True'
MONITORING_ENABLED: 'False'
- name: "GeoServer-backend Contrib Apps Smoke Tests"
python: 2.7
env:
- BACKEND: 'geonode.geoserver'
DOCKER_COMPOSE_VERSION: 1.19.0
ON_TRAVIS: 'True'
TEST_RUN_INTERNAL_APPS: 'True'
MONITORING_ENABLED: 'False'
Expand Down Expand Up @@ -173,12 +175,12 @@ install:
sudo apt-get install -y libgdal1i 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;
echo debconf shared/accepted-oracle-license-v1-1 select true | sudo debconf-set-selections;
echo debconf shared/accepted-oracle-license-v1-1 seen true | sudo debconf-set-selections;
sudo apt-get install -y oracle-java8-set-default ant maven --no-install-recommends;
sudo apt-add-repository -y ppa:webupd8team/java;
sudo apt update; sudo apt upgrade -y; sudo apt autoremove --purge;
sudo apt install -y oracle-java8-set-default ant maven;
sudo update-java-alternatives --set java-8-oracle;
export JAVA_HOME=$(readlink -f /usr/bin/java | sed "s:bin/java::")
export PATH=$JAVA_HOME'bin/java':$PATH
pip install -r requirements.txt --upgrade;
pip install -e . --upgrade;
pip install pygdal==`gdal-config --version`.*;
Expand Down
13 changes: 12 additions & 1 deletion pavement.py
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,17 @@ def start_geoserver(options):
# prevents geonode security from initializing correctly otherwise
with pushd(data_dir):
javapath = "java"
if on_travis:
sh((
'echo debconf shared/accepted-oracle-license-v1-1 select true | sudo debconf-set-selections;'
' echo debconf shared/accepted-oracle-license-v1-1 seen true | sudo debconf-set-selections;'
' sudo apt install -y oracle-java8-set-default ant maven;'
' sudo update-java-alternatives --set java-8-oracle'
))
# import subprocess
# result = subprocess.run(['update-alternatives', '--list', 'java'], stdout=subprocess.PIPE)
# javapath = result.stdout
javapath = "/usr/lib/jvm/java-8-oracle/jre/bin/java"
loggernullpath = os.devnull

# checking if our loggernullpath exists and if not, reset it to
Expand All @@ -701,7 +712,7 @@ def start_geoserver(options):
loggernullpath = "../../downloaded/null.txt"

try:
sh(('java -version'))
sh(('%(javapath)s -version') % locals() )
except BaseException:
print "Java was not found in your path. Trying some other options: "
javapath_opt = None
Expand Down

0 comments on commit d8b05a3

Please sign in to comment.