From b4e98980dd7d8aed924b7e9647c7bc1263819c27 Mon Sep 17 00:00:00 2001 From: Wolfgang Kaltz Date: Tue, 17 Jul 2018 13:14:20 +0200 Subject: [PATCH 01/16] remove index-url to pypi.camptocamp.net, as server is no longer maintained --- Makefile | 1 - c2cgeoportal/scaffolds/update/CONST_Makefile_tmpl | 1 - dev-requirements.txt | 1 - requirements.txt | 1 - 4 files changed, 4 deletions(-) diff --git a/Makefile b/Makefile index 5e8390c235..1153911b85 100644 --- a/Makefile +++ b/Makefile @@ -162,7 +162,6 @@ c2cgeoportal/locale/en/LC_MESSAGES/c2cgeoportal.po: c2cgeoportal/locale/c2cgeopo mkdir -p $(dir $@) virtualenv --setuptools --no-site-packages .build/venv $(PIP_CMD) install \ - --index-url http://pypi.camptocamp.net/pypi \ 'pip==7.1.2' 'setuptools==21.0.0' $(PIP_REDIRECT) touch $@ diff --git a/c2cgeoportal/scaffolds/update/CONST_Makefile_tmpl b/c2cgeoportal/scaffolds/update/CONST_Makefile_tmpl index e02fab363f..63ef0986be 100644 --- a/c2cgeoportal/scaffolds/update/CONST_Makefile_tmpl +++ b/c2cgeoportal/scaffolds/update/CONST_Makefile_tmpl @@ -810,7 +810,6 @@ $(INSTANCE_ID_MARKER): upgrade: .build/requirements.timestamp project.yaml .build/venv/bin/pip install \ --trusted-host pypi.camptocamp.net \ - --index-url http://pypi.camptocamp.net/pypi \ --find-links http://pypi.camptocamp.net/internal-pypi/index/c2cgeoportal \ c2cgeoportal==${VERSION} $(VENV_BIN)/c2ctool upgrade $(UPGRADE_MAKE_FILE) ${UPGRADE_ARGS} ${VERSION} diff --git a/dev-requirements.txt b/dev-requirements.txt index dc036f9c61..0eb6583827 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,4 +1,3 @@ ---index-url http://pypi.camptocamp.net/pypi c2c.cssmin c2c.template==1.1.2 c2cgeoportal/tests/testegg/dist/testegg-1.0.tar.gz diff --git a/requirements.txt b/requirements.txt index 6494c49b29..e8f997b532 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,3 @@ ---index-url http://pypi.camptocamp.net/pypi -e git+https://github.com/camptocamp/pyramid_closure#egg=pyramid_closure -e git+https://github.com/Pylons/pyramid@1e02bbfc0df09259bf207112acf019c8dba44a90#egg=pyramid -r c2cgeoportal/scaffolds/update/CONST_versions.txt From 9bf7830db63b19beb343ea179352b41eaf8c8551 Mon Sep 17 00:00:00 2001 From: Wolfgang Kaltz Date: Tue, 24 Jul 2018 14:45:03 +0200 Subject: [PATCH 02/16] disable tests with postgres etc. (version used by c2cgeoportal 1.6 is no longer supported) --- .travis.yml | 54 +------------------------------------ travis/build-new-project.sh | 23 ---------------- 2 files changed, 1 insertion(+), 76 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4af7286149..6271bd3ca7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,15 +1,10 @@ dist: precise language: python -dist: precise - python: - 2.6 - 2.7 -services: -- postgresql - env: global: - secure: "UxpVOfQ9oePIcgRqsFzuVvpcng/syX6snuqw01XjK/3dWwyjhehBL17Yfzsn8NAgsiEdJ7SiTOhb3cfiHNHNX0mzfojPtvcFcGDmHGfH5nIufsGubeck6CErKHFT0uAhJywfPSgi53n0RteiIJAKc0bzaYzoMRG7RUPsvk3HRnE=" @@ -17,62 +12,18 @@ env: before_install: - git fetch - cat /etc/apt/sources.list.d/* -- sudo apt-get remove --assume-yes --force-yes postgresql-9.1-postgis-2.2-scripts - sudo apt-get install -y --force-yes aptitude -- sudo add-apt-repository -y ppa:stephane-brunner/precise-gis - sudo apt-get update -- sudo aptitude install -y apache2 facter libapache2-mod-wsgi tomcat7 deploy cgi-mapserver postgis=2.0.3-2~precise4 postgresql-9.1-postgis-2.0=2.0.3-2~precise4 postgresql-9.1-postgis-2.0-scripts=2.0.3-2~precise4 gettext -- dpkg -l | grep postgis -- sudo -u postgres psql --version - -- sudo -u postgres createdb -E UTF8 -T template0 template_postgis -- psql -d template_postgis -U postgres -f /usr/share/postgresql/9.1/contrib/postgis-2.0/postgis.sql > /dev/null -- psql -d template_postgis -U postgres -f /usr/share/postgresql/9.1/contrib/postgis-2.0/spatial_ref_sys.sql > /dev/null -#- psql -d template_postgis -U postgres -c "CREATE EXTENSION postgis;" - -- sudo -u postgres createdb -E UTF8 -T template_postgis c2cgeoportal_test -- sudo -u postgres createdb -E UTF8 -T template_postgis geomapfish - -- sudo -u postgres createuser www-data --no-superuser --no-createdb --no-createrole -- sudo -u postgres psql -q -d c2cgeoportal_test -f travis/db.sql +- sudo aptitude install -y deploy install: - make -f travis.mk c2c-egg -- .build/venv/bin/pcreate -s c2cgeoportal_create /tmp/test package=test srid=21781 mobile_application_title="Mobile App éàè" apache_vhost=test extent= > /dev/null -- .build/venv/bin/pcreate -s c2cgeoportal_update /tmp/test package=test srid=21781 mobile_application_title="Mobile App éàè" apache_vhost=test > /dev/null # on create -- cp /tmp/test/project.yaml.mako project.yaml -- .build/venv/bin/pcreate -s c2cgeoportal_update /tmp/test > /dev/null # on upgrade - don't add any argument on this command -- rm project.yaml -- travis/build-new-project.sh -- make -f travis.mk build -- sudo /usr/sbin/apache2ctl graceful -- .build/venv/bin/flake8 --version script: - if [ ${TRAVIS_PULL_REQUEST} != "false" ] ; then git fetch origin ${TRAVIS_BRANCH}:${TRAVIS_BRANCH}; fi - if [ ${TRAVIS_PULL_REQUEST} != "false" ] ; then git diff --check ${TRAVIS_BRANCH} -- ; fi -- find /tmp/test/CONST_alembic -name \*.py | xargs .build/venv/bin/flake8 --copyright-check --copyright-min-file-size=1 --copyright-regexp="Copyright \(c\) [0-9\-]*$(shell date +%Y), Camptocamp SA" --max-line-length=100 -- find /tmp/test/setup.py /tmp/test/test/*.py /tmp/test/test/views -name \*.py | xargs .build/venv/bin/flake8 --max-line-length=100 -- find /tmp/test/setup.py /tmp/test/test/*.py /tmp/test/test/views -name \*.py | xargs travis/quote -# Actually don't work on travis see: -# https://travis-ci.org/camptocamp/c2cgeoportal/jobs/48455036#L5312 -#- travis/test-new-project.sh -- travis/status.sh /tmp/test/ -- travis/empty-make-new-project.sh -- travis/empty-make.sh -f travis.mk build -- cp travis/empty-vars.mk /tmp/test/ -- travis/run-on.sh /tmp/test/ 'make -f empty-vars.mk .build/config.yaml' - make -f travis.mk doc -- make -f travis.mk checks -- make -f travis.mk c2cgeoportal/tests/functional/alembic.ini - travis/quote `find c2cgeoportal/lib c2cgeoportal/scaffolds c2cgeoportal/templates c2cgeoportal/tests c2cgeoportal/views -name '*.py'` c2cgeoportal/*.py setup.py -- .build/venv/bin/alembic -c c2cgeoportal/tests/functional/alembic.ini heads -- .build/venv/bin/alembic -c c2cgeoportal/tests/functional/alembic_static.ini heads -- .build/venv/bin/alembic -c c2cgeoportal/tests/functional/alembic.ini upgrade head -- .build/venv/bin/alembic -c c2cgeoportal/tests/functional/alembic_static.ini upgrade head -- .build/venv/bin/alembic -c c2cgeoportal/tests/functional/alembic_static.ini downgrade base -- .build/venv/bin/alembic -c c2cgeoportal/tests/functional/alembic.ini downgrade base -- .build/venv/bin/python setup.py nosetests --stop --nocapture --nologcapture - git checkout c2cgeoportal/locale/*/LC_MESSAGES/c2cgeoportal.po - travis/status.sh # verify c2cgeoportal version @@ -80,9 +31,6 @@ script: - if [[ ${TRAVIS_TAG} =~ ^[0-9]+.[0-9]+.[0-9]+(dev[0-9]+|rc[0-9]|\.[0-9]+)?$ ]] ; then test `grep c2cgeoportal-win== c2cgeoportal/scaffolds/update/CONST_requirements_windows.txt|awk -F '==' '{{print $2}}'` = ${TRAVIS_TAG} ; fi - if [[ ${TRAVIS_TAG} =~ ^[0-9]+.[0-9]+.[0-9]+(dev[0-9]+|rc[0-9]|\.[0-9]+)?$ ]] ; then test `python setup.py --version` = ${TRAVIS_TAG} ; fi -after_failure: -- .build/venv/bin/python setup.py nosetests - after_success: - travis/deploy.sh - travis/pip.sh install coveralls diff --git a/travis/build-new-project.sh b/travis/build-new-project.sh index 95b0c20871..b0fc01634a 100755 --- a/travis/build-new-project.sh +++ b/travis/build-new-project.sh @@ -17,31 +17,8 @@ git add -A git submodule add https://github.com/camptocamp/cgxp.git test/static/lib/cgxp git commit -q -m "Initial commit" -sudo chmod 777 /var/lib/tomcat7/webapps - make -f travis.mk build echo "Build complete" -git add test/locale/*/LC_MESSAGES/test-server.po -git commit -m "Add location" - -sudo -u postgres psql -c 'GRANT SELECT ON TABLE spatial_ref_sys TO "www-data"' geomapfish -sudo -u postgres psql -c 'GRANT ALL ON TABLE geometry_columns TO "www-data"' geomapfish -sudo -u postgres psql -c "CREATE SCHEMA main;" geomapfish -sudo -u postgres psql -c "CREATE SCHEMA main_static;" geomapfish -sudo -u postgres psql -c 'GRANT ALL ON SCHEMA main TO "www-data"' geomapfish -sudo -u postgres psql -c 'GRANT ALL ON SCHEMA main_static TO "www-data"' geomapfish - -.build/venv/bin/alembic upgrade head - -sudo touch /etc/apache2/sites-enabled/test.conf -sudo chmod 666 /etc/apache2/sites-enabled/test.conf -echo "Include /tmp/test/apache/*.conf" > /etc/apache2/sites-enabled/test.conf - -sudo a2enmod headers -sudo a2enmod rewrite -sudo a2enmod wsgi -sudo /usr/sbin/apachectl restart - cd - From 481e53be32c06fb3587e12089872f1504e102d00 Mon Sep 17 00:00:00 2001 From: Wolfgang Kaltz Date: Wed, 25 Jul 2018 08:08:13 +0200 Subject: [PATCH 03/16] review feedback --- .travis.yml | 1 + travis/build-new-project.sh | 24 ------------------------ 2 files changed, 1 insertion(+), 24 deletions(-) delete mode 100755 travis/build-new-project.sh diff --git a/.travis.yml b/.travis.yml index 6271bd3ca7..c567564e73 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,6 +18,7 @@ before_install: install: - make -f travis.mk c2c-egg +- make -f travis.mk build script: - if [ ${TRAVIS_PULL_REQUEST} != "false" ] ; then git fetch origin ${TRAVIS_BRANCH}:${TRAVIS_BRANCH}; fi diff --git a/travis/build-new-project.sh b/travis/build-new-project.sh deleted file mode 100755 index b0fc01634a..0000000000 --- a/travis/build-new-project.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -ex - -# create fake vhosts -sudo mkdir -p /var/www/vhosts/test/conf -sudo chmod g+w,o+w /var/www/vhosts/test/conf - -cp travis/build.mk /tmp/test/travis.mk - -cd /tmp/test/ - -sed -e 's@^c2cgeoportal==.*$@/home/travis/build/camptocamp/c2cgeoportal@' -i CONST_requirements.txt - -git config --global user.name "Travis" -git config --global user.email "travis@example.com" -git init -git add -A -git submodule add https://github.com/camptocamp/cgxp.git test/static/lib/cgxp -git commit -q -m "Initial commit" - -make -f travis.mk build - -echo "Build complete" - -cd - From 71a030aab6aafe3aff23fa47e48f79c3af71dce7 Mon Sep 17 00:00:00 2001 From: Wolfgang Kaltz Date: Wed, 25 Jul 2018 08:15:01 +0200 Subject: [PATCH 04/16] need facter for make build --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c567564e73..0cc43dbe54 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,7 @@ before_install: - cat /etc/apt/sources.list.d/* - sudo apt-get install -y --force-yes aptitude - sudo apt-get update -- sudo aptitude install -y deploy +- sudo aptitude install -y facter deploy install: - make -f travis.mk c2c-egg From 78eba35125ea903cb170ce7b869f9fcdf05030bd Mon Sep 17 00:00:00 2001 From: Wolfgang Kaltz Date: Wed, 25 Jul 2018 08:21:33 +0200 Subject: [PATCH 05/16] need another package for msgfmt (used by build) --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 0cc43dbe54..232940a6fc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,7 @@ before_install: - cat /etc/apt/sources.list.d/* - sudo apt-get install -y --force-yes aptitude - sudo apt-get update -- sudo aptitude install -y facter deploy +- sudo aptitude install -y facter deploy gettext install: - make -f travis.mk c2c-egg From 6845b3c5c2b1b1b2b36a603f6d09a0283650ba47 Mon Sep 17 00:00:00 2001 From: Wolfgang Kaltz Date: Wed, 25 Jul 2018 11:35:03 +0200 Subject: [PATCH 06/16] Do release 1.6.14 --- c2cgeoportal/scaffolds/update/CONST_requirements.txt | 2 +- c2cgeoportal/scaffolds/update/CONST_requirements_windows.txt | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/c2cgeoportal/scaffolds/update/CONST_requirements.txt b/c2cgeoportal/scaffolds/update/CONST_requirements.txt index fa59460846..a5cab4d7c6 100644 --- a/c2cgeoportal/scaffolds/update/CONST_requirements.txt +++ b/c2cgeoportal/scaffolds/update/CONST_requirements.txt @@ -5,5 +5,5 @@ Shapely==1.5.6 Pillow==2.7.0 https://github.com/Pylons/pyramid/archive/1e02bbfc0df09259bf207112acf019c8dba44a90.zip#egg=pyramid>=1.6.dev https://github.com/camptocamp/pyramid_closure/archive/819bc43420b3cd924d8698c5a9606592c19dbb15.zip#egg=pyramid_closure -c2cgeoportal==1.6.13 +c2cgeoportal==1.6.14 -e . diff --git a/c2cgeoportal/scaffolds/update/CONST_requirements_windows.txt b/c2cgeoportal/scaffolds/update/CONST_requirements_windows.txt index cfd22c6a33..44ffb3821d 100644 --- a/c2cgeoportal/scaffolds/update/CONST_requirements_windows.txt +++ b/c2cgeoportal/scaffolds/update/CONST_requirements_windows.txt @@ -5,5 +5,5 @@ wheels/Shapely-1.5.13-cp27-none-win32.whl wheels/Pillow-2.8.1-cp27-none-win32.whl https://github.com/Pylons/pyramid/archive/1e02bbfc0df09259bf207112acf019c8dba44a90.zip#egg=pyramid>=1.6.dev https://github.com/camptocamp/pyramid_closure/archive/819bc43420b3cd924d8698c5a9606592c19dbb15.zip#egg=pyramid_closure -c2cgeoportal-win==1.6.13 +c2cgeoportal-win==1.6.14 -e . diff --git a/setup.py b/setup.py index c8f2bf1da0..aaf51c0662 100644 --- a/setup.py +++ b/setup.py @@ -88,7 +88,7 @@ setup( name="c2cgeoportal", - version="1.6.13", + version="1.6.14", description="c2cgeoportal", long_description=README, classifiers=[ From 473d52600a732327776a37d7876b6ca6a84180d4 Mon Sep 17 00:00:00 2001 From: Wolfgang Kaltz Date: Thu, 26 Jul 2018 07:33:09 +0200 Subject: [PATCH 07/16] small precisions about update process --- doc/conf.py | 2 +- doc/developer/build_release.rst | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index b6fef5387f..c128db7c84 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -49,7 +49,7 @@ # General information about the project. project = u'c2cgeoportal' -copyright = u'2011-2014, Camptocamp' +copyright = u'2011-2018, Camptocamp' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the diff --git a/doc/developer/build_release.rst b/doc/developer/build_release.rst index 897e02f15b..502fb14808 100644 --- a/doc/developer/build_release.rst +++ b/doc/developer/build_release.rst @@ -205,13 +205,15 @@ When a new release or a new version is done you should do the following tasks: curl 'http://pypi.camptocamp.net/internal-pypi/regenerate-index' --data '' \ --max-time 1000 -* Upgrade the demo in your home folder with ``c2ctool``. -* Update the demo on the main folder with: +* Upgrade the demo project in your home folder, by following upgrade application + instructions and pushing the results to the repository. +* Update the demo on the main folder as follows, using a Makefile appropriate + for the server settings: .. prompt:: bash - sudo -u sigdev make -f demo.mk update - sudo -u sigdev make -f demo.mk build + sudo -u sigdev make -f update + sudo -u sigdev make -f build * Test the demo. * Move all the open issues to a new milestone and close the current milestone From 695d425e24b637ec6771b9c7a2534371f7b081fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Thu, 21 Jun 2018 16:15:42 +0200 Subject: [PATCH 08/16] Better solution --- .../scaffolds/update/CONST_vars.yaml_tmpl | 8 ++++---- geoportal/c2cgeoportal_geoportal/views/dev.py | 3 --- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/geoportal/c2cgeoportal_geoportal/scaffolds/update/CONST_vars.yaml_tmpl b/geoportal/c2cgeoportal_geoportal/scaffolds/update/CONST_vars.yaml_tmpl index bf9f01f71d..b900c0bef4 100644 --- a/geoportal/c2cgeoportal_geoportal/scaffolds/update/CONST_vars.yaml_tmpl +++ b/geoportal/c2cgeoportal_geoportal/scaffolds/update/CONST_vars.yaml_tmpl @@ -72,7 +72,7 @@ vars: TINYOWS_URL: http://tinyows:8080/ MAPSERVER_URL: http://mapserver:8080/ PRINT_URL: http://print:8080/print/ - DEVSERVER_URL: http://webpack-dev-server:8080${entry_point} + DEVSERVER_HOST: webpack-dev-server:8080 REDIS_HOST: redis REDIS_PORT: 6379 C2C_REDIS_URL: redis://redis:6379 @@ -407,7 +407,7 @@ vars: print_url: '{PRINT_URL}' mapserver_url: '{MAPSERVER_URL}' mapcache_url: '{MAPCACHE_URL}' - devserver_url: '{DEVSERVER_URL}' + devserver_url: http://{DEVSERVER_HOST}{entry_point} memcached_host: '{MEMCACHED_HOST}' memcached_port: '{MEMCACHED_PORT}' tilegeneration_sqs_queue: '{TILEGENERATION_SQS_QUEUE}' @@ -604,8 +604,8 @@ runtime_environment: default: http://print:8080/print/ - name: MAPCACHE_URL default: http://mapcache:8080/ - - name: DEVSERVER_URL - default: http://webpack-dev-server:8080/ + - name: DEVSERVER_HOST + default: webpack-dev-server:8080 - name: REDIS_HOST default: redis - name: REDIS_PORT diff --git a/geoportal/c2cgeoportal_geoportal/views/dev.py b/geoportal/c2cgeoportal_geoportal/views/dev.py index 3eb8fc4bdb..037dcdba21 100644 --- a/geoportal/c2cgeoportal_geoportal/views/dev.py +++ b/geoportal/c2cgeoportal_geoportal/views/dev.py @@ -33,7 +33,6 @@ from pyramid.httpexceptions import HTTPFound from pyramid.view import view_config import re -import os logger = logging.getLogger(__name__) @@ -45,8 +44,6 @@ class Dev(Proxy): def __init__(self, request): super().__init__(request) self.dev_url = self.request.registry.settings['devserver_url'] - if 'VISIBLE_ENTRY_POINT' in os.environ: - self.dev_url = self.dev_url.replace('${VISIBLE_ENTRY_POINT}', os.environ['VISIBLE_ENTRY_POINT']) @view_config(route_name='dev') def dev(self): From 65ebd328da44bd5ebc981ac432ab3a2ededf9851 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Fri, 27 Jul 2018 10:56:39 +0200 Subject: [PATCH 09/16] Be able to automatically get the gmfSearchGroups --- .../c2cgeoportal_geoportal/scaffolds/create/vars.yaml_tmpl | 7 ++++++- .../scaffolds/nondockercreate/vars.yaml_tmpl | 7 ++++++- geoportal/c2cgeoportal_geoportal/templates/dynamic.js | 3 +++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/geoportal/c2cgeoportal_geoportal/scaffolds/create/vars.yaml_tmpl b/geoportal/c2cgeoportal_geoportal/scaffolds/create/vars.yaml_tmpl index e751e396d7..264c889120 100644 --- a/geoportal/c2cgeoportal_geoportal/scaffolds/create/vars.yaml_tmpl +++ b/geoportal/c2cgeoportal_geoportal/scaffolds/create/vars.yaml_tmpl @@ -26,7 +26,6 @@ vars: constants: &constants defaultTheme: Demo defaultLang: en - gmfSearchGroups: [osm, district] gmfSearchActions: - action: add_theme title: Add a theme @@ -66,6 +65,9 @@ vars: mobile: <<: *interface redirect_interface: desktop + constants: + <<: *constants + gmfSearchGroups: [] mobile_alt: <<: *interface constants: @@ -76,6 +78,9 @@ vars: <<: *interface redirect_interface: mobile do_redirect: True + constants: + <<: *constants + gmfSearchGroups: [] routes: <<: *routes gmfProfileJsonUrl: profile.json diff --git a/geoportal/c2cgeoportal_geoportal/scaffolds/nondockercreate/vars.yaml_tmpl b/geoportal/c2cgeoportal_geoportal/scaffolds/nondockercreate/vars.yaml_tmpl index f3f27a9607..b96ec9f77d 100644 --- a/geoportal/c2cgeoportal_geoportal/scaffolds/nondockercreate/vars.yaml_tmpl +++ b/geoportal/c2cgeoportal_geoportal/scaffolds/nondockercreate/vars.yaml_tmpl @@ -26,7 +26,6 @@ vars: constants: &constants defaultTheme: Demo defaultLang: en - gmfSearchGroups: [osm, district] gmfSearchActions: - action: add_theme title: Add a theme @@ -66,6 +65,9 @@ vars: mobile: <<: *interface redirect_interface: desktop + constants: + <<: *constants + gmfSearchGroups: [] mobile_alt: <<: *interface constants: @@ -76,6 +78,9 @@ vars: <<: *interface redirect_interface: mobile do_redirect: True + constants: + <<: *constants + gmfSearchGroups: [] routes: <<: *routes gmfProfileJsonUrl: profile.json diff --git a/geoportal/c2cgeoportal_geoportal/templates/dynamic.js b/geoportal/c2cgeoportal_geoportal/templates/dynamic.js index 943dfa7c36..f203881c83 100644 --- a/geoportal/c2cgeoportal_geoportal/templates/dynamic.js +++ b/geoportal/c2cgeoportal_geoportal/templates/dynamic.js @@ -28,6 +28,9 @@ wfs_permalink.update(interface_config.get('wfs_permalink', {})) % for name, value in interface_config['constants'].items(): module.constant('${name}', ${json.dumps(value) | n}) % endfor +% if 'gmfSearchGroups' not in interface_config['constants']: + module.constant('gmfSearchGroups', ${json.dumps(fulltextsearch_groups) | n}); +% endif module.constant('langUrls', ${json.dumps(lang_urls) | n}); module.constant('cacheVersion', '${get_cache_version()}'); module.constant('ngeoWfsPermalinkOptions', ${json.dumps(wfs_permalink) | n}); From a0ccc507847a8d22e52a123354bb9da19fd03a6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Fri, 27 Jul 2018 17:17:06 +0200 Subject: [PATCH 10/16] Fix the Git branch on Travis --- docker-run | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docker-run b/docker-run index b6ca32c8bd..c6d21d59c1 100755 --- a/docker-run +++ b/docker-run @@ -49,9 +49,11 @@ def main(): if is_windows else dir_path[1:].replace("/", "-") try: - git_branch = subprocess.check_output([ - "git", "rev-parse", "--abbrev-ref", "HEAD" - ]).decode("utf-8").strip() + git_branch = \ + os.environ['TRAVIS_BRANCH'] if 'TRAVIS_BRANCH' in os.environ else \ + subprocess.check_output([ + "git", "rev-parse", "--abbrev-ref", "HEAD" + ]).decode("utf-8").strip() git_hash = subprocess.check_output([ "git", "rev-parse", "HEAD" ]).decode("utf-8").strip() From 3836914ec4b53831e2074db06db68b420395038b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Mon, 30 Jul 2018 08:52:48 +0200 Subject: [PATCH 11/16] Add a lock on getting the autoloaded table --- .../lib/dbreflection.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/geoportal/c2cgeoportal_geoportal/lib/dbreflection.py b/geoportal/c2cgeoportal_geoportal/lib/dbreflection.py index bfcdf70943..832a15e27a 100644 --- a/geoportal/c2cgeoportal_geoportal/lib/dbreflection.py +++ b/geoportal/c2cgeoportal_geoportal/lib/dbreflection.py @@ -26,8 +26,7 @@ # The views and conclusions contained in the software and documentation are those # of the authors and should not be interpreted as representing official policies, # either expressed or implied, of the FreeBSD Project. - - +import threading import warnings from typing import Dict, Tuple # noqa, pylint: disable=unused-import @@ -125,6 +124,9 @@ def _get_schema(tablename): return tablename, schema +_get_table_lock = threading.RLock() + + def get_table(tablename, schema=None, session=None, primary_key=None): if schema is None: tablename, schema = _get_schema(tablename) @@ -148,12 +150,13 @@ def get_table(tablename, schema=None, session=None, primary_key=None): if primary_key is not None: # Ensure we have a primary key to be able to edit views args.append(Column(primary_key, Integer, primary_key=True)) - table = Table( - *args, - schema=schema, - autoload=True, - autoload_with=engine - ) + with _get_table_lock: + table = Table( + *args, + schema=schema, + autoload=True, + autoload_with=engine + ) return table From c46e9a515118f9a6263d346fc827932c4bf37b3f Mon Sep 17 00:00:00 2001 From: Wolfgang Kaltz Date: Mon, 30 Jul 2018 12:09:13 +0200 Subject: [PATCH 12/16] small fix --- doc/developer/build_release.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/developer/build_release.rst b/doc/developer/build_release.rst index 502fb14808..b2e6289f54 100644 --- a/doc/developer/build_release.rst +++ b/doc/developer/build_release.rst @@ -220,4 +220,4 @@ When a new release or a new version is done you should do the following tasks: in `cgxp _` and in `c2cgeoportal _`. * Send a release email to the ``geomapfish@googlegroups.com`` - and ``geospatial@lists.camptocamp.com`` mailing lists. + and ``geospatial-list@camptocamp.com`` mailing lists. From 2e51eecc2198092af5462da0631a793f94a0b1eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Mon, 30 Jul 2018 15:53:17 +0200 Subject: [PATCH 13/16] Add customOpenLayersOptions metadata --- .../scaffolds/update/CONST_vars.yaml_tmpl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/geoportal/c2cgeoportal_geoportal/scaffolds/update/CONST_vars.yaml_tmpl b/geoportal/c2cgeoportal_geoportal/scaffolds/update/CONST_vars.yaml_tmpl index bf9f01f71d..790e97c67e 100644 --- a/geoportal/c2cgeoportal_geoportal/scaffolds/update/CONST_vars.yaml_tmpl +++ b/geoportal/c2cgeoportal_geoportal/scaffolds/update/CONST_vars.yaml_tmpl @@ -280,6 +280,8 @@ vars: - name: geometryValidation # V1 type: boolean - name: excludeProperties # not yet used + - name: customOpenLayersOptions + type: json # WMS - name: directedFilterAttributes type: list From dc251f4c6f27d61e1815ed4fca8ddcbf3d78e85d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Thu, 2 Aug 2018 11:57:08 +0200 Subject: [PATCH 14/16] Update to mapserver 7.2 --- docker/test-mapserver/Dockerfile | 2 +- .../scaffolds/create/docker-compose-build.yaml.mako | 2 +- .../scaffolds/create/docker-compose.yaml.mako | 2 +- travis/docker-compose-build.yaml.mako | 2 +- travis/docker-compose.yaml.mako | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docker/test-mapserver/Dockerfile b/docker/test-mapserver/Dockerfile index d7d697fb28..d00174d63c 100644 --- a/docker/test-mapserver/Dockerfile +++ b/docker/test-mapserver/Dockerfile @@ -1,3 +1,3 @@ -FROM camptocamp/mapserver:7.0 +FROM camptocamp/mapserver:7.2 LABEL maintainer Camptocamp "info@camptocamp.com" COPY *.map /etc/mapserver/ diff --git a/geoportal/c2cgeoportal_geoportal/scaffolds/create/docker-compose-build.yaml.mako b/geoportal/c2cgeoportal_geoportal/scaffolds/create/docker-compose-build.yaml.mako index b65c92e65c..fe4fb7fad1 100644 --- a/geoportal/c2cgeoportal_geoportal/scaffolds/create/docker-compose-build.yaml.mako +++ b/geoportal/c2cgeoportal_geoportal/scaffolds/create/docker-compose-build.yaml.mako @@ -15,7 +15,7 @@ services: image: ${docker_base}-config:${docker_tag} mapserver: - image: camptocamp/mapserver:7.0 + image: camptocamp/mapserver:7.2 volumes_from: - config:rw ${service_defaults('mapserver', 80)}\ diff --git a/geoportal/c2cgeoportal_geoportal/scaffolds/create/docker-compose.yaml.mako b/geoportal/c2cgeoportal_geoportal/scaffolds/create/docker-compose.yaml.mako index 16e3b86d2d..ae68d43169 100644 --- a/geoportal/c2cgeoportal_geoportal/scaffolds/create/docker-compose.yaml.mako +++ b/geoportal/c2cgeoportal_geoportal/scaffolds/create/docker-compose.yaml.mako @@ -19,7 +19,7 @@ ${service_defaults('config')}\ ${service_defaults('print', 8080)}\ mapserver: - image: camptocamp/mapserver:7.0 + image: camptocamp/mapserver:7.2 user: www-data volumes_from: - config:rw diff --git a/travis/docker-compose-build.yaml.mako b/travis/docker-compose-build.yaml.mako index 180e8c63b2..2d25181738 100644 --- a/travis/docker-compose-build.yaml.mako +++ b/travis/docker-compose-build.yaml.mako @@ -23,7 +23,7 @@ ${service_defaults('db', 5432)}\ ${service_defaults('external-db', 5432)}\ mapserver: - image: camptocamp/mapserver:7.0 + image: camptocamp/mapserver:7.2 volumes_from: - config:rw links: diff --git a/travis/docker-compose.yaml.mako b/travis/docker-compose.yaml.mako index 432abe9ab3..53450f31fb 100644 --- a/travis/docker-compose.yaml.mako +++ b/travis/docker-compose.yaml.mako @@ -26,7 +26,7 @@ ${service_defaults('external-db', 5432)}\ ${service_defaults('print', 8080)}\ mapserver: - image: camptocamp/mapserver:7.0 + image: camptocamp/mapserver:7.2 user: www-data volumes_from: - config:rw From 6107d529a94cb94ca255232e13a8829d5086c893 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Thu, 2 Aug 2018 13:10:17 +0200 Subject: [PATCH 15/16] Fix stange test --- geoportal/tests/functional/test_entry.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/geoportal/tests/functional/test_entry.py b/geoportal/tests/functional/test_entry.py index f42038cb71..eadfafc682 100644 --- a/geoportal/tests/functional/test_entry.py +++ b/geoportal/tests/functional/test_entry.py @@ -1165,7 +1165,7 @@ def test_layer(self): "minResolutionHint": 1.76, "maxResolutionHint": 8.8200000000000003, "public": True, - "queryable": 0, + "queryable": 1, "metadataUrls": [{ "url": "http://example.com/wmsfeatures.metadata", "type": "TC211", From 162dc631b488102c56cf386db96f6f40401bcb96 Mon Sep 17 00:00:00 2001 From: Patrick Valsecchi Date: Fri, 3 Aug 2018 07:17:51 +0200 Subject: [PATCH 16/16] Improve tinyows logs on Docker Put the logs where the Docker images is expecting them. --- .../scaffolds/create/mapserver/tinyows.xml.tmpl.mako | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/geoportal/c2cgeoportal_geoportal/scaffolds/create/mapserver/tinyows.xml.tmpl.mako b/geoportal/c2cgeoportal_geoportal/scaffolds/create/mapserver/tinyows.xml.tmpl.mako index fdad87d5b2..1e13812c11 100644 --- a/geoportal/c2cgeoportal_geoportal/scaffolds/create/mapserver/tinyows.xml.tmpl.mako +++ b/geoportal/c2cgeoportal_geoportal/scaffolds/create/mapserver/tinyows.xml.tmpl.mako @@ -1,7 +1,7 @@