From 38d6b1aa58704d75dcad300992f51263c9f42fd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Tue, 24 Oct 2017 14:47:53 +0200 Subject: [PATCH] Add YAML lint Fix YAML style --- .travis.yml | 565 ++++++------ Makefile | 7 +- docker-compose.yaml.mako | 52 +- docker/build/requirements.txt | 1 + .../scaffolds/create/+dot+travis.yml | 10 +- .../create/docker-compose-build.yaml.mako | 56 +- .../scaffolds/create/docker-compose.yaml.mako | 9 +- .../print-apps/+package+/config.yaml.mako | 260 +++--- .../scaffolds/create/project.yaml.mako_tmpl | 7 +- .../scaffolds/create/vars.yaml_tmpl | 282 +++--- .../scaffolds/create/yamllint.yaml | 9 + .../docker-compose-build.yaml.mako | 48 +- .../print-apps/+package+/config.yaml.mako | 260 +++--- .../nondockercreate/project.yaml.mako_tmpl | 9 +- .../nondockercreate/vars_nondocker.yaml_tmpl | 58 +- .../nondockerupdate/+dot+upgrade.yaml_tmpl | 214 ++--- .../scaffolds/update/+dot+upgrade.yaml_tmpl | 280 +++--- .../scaffolds/update/CONST_Makefile_tmpl | 8 +- .../scaffolds/update/CONST_config-schema.yaml | 829 +++++++++--------- .../scaffolds/update/CONST_vars.yaml_tmpl | 816 ++++++++--------- geoportal/tests/config.yaml | 5 +- travis/docker-compose.yaml | 3 +- travis/v22-project.yaml | 43 +- travis/vars-nondocker.yaml | 20 +- travis/vars.yaml | 38 +- vars.yaml | 48 +- yamllint.yaml | 9 + 27 files changed, 2034 insertions(+), 1912 deletions(-) create mode 100644 geoportal/c2cgeoportal_geoportal/scaffolds/create/yamllint.yaml create mode 100644 yamllint.yaml diff --git a/.travis.yml b/.travis.yml index abd5d3645a..84b38fd305 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,299 +1,328 @@ +--- + dist: trusty sudo: required language: python python: -- "3.6" + - "3.6" service: -- docker + - docker env: global: - - secure: aZWcHZWV8lN2SNU2fcUsG8+fVQLOxwDUFYDvuftZALebRG2AHINTkbS31sKbeSwS19ZYpjcuVOKC9HxNAlnMxsdO1NvvFEbSJJD/yqq0V4EfTRqptZYsFCUou0eXIUWEnoFHD1nY3NhuPQjDoad995xU92z0BzwduxUAj28liu4= + - secure: "aZWcHZWV8lN2SNU2fcUsG8+fVQLOxwDUFYDvuftZALebRG2AHINTkbS31sKbeSwS19ZYpjcuVOKC9HxNAlnMxsdO1Nvv\ + FEbSJJD/yqq0V4EfTRqptZYsFCUou0eXIUWEnoFHD1nY3NhuPQjDoad995xU92z0BzwduxUAj28liu4=" - DOCKER_USERNAME=sbrunner - - secure: SosPNhER7I5YnVZy7AoUjrs+P08S60fPje1sFgMdfRNRElI42oLgO6wk1nEFEGGjUevSLzpsDruy7z1m5ilzyMenO1hG1lASf2BeeJC8rRz75MgRKnlf7Py6BA9GbNprzMdgxNPlUtrEkp9ExLvC7MZs7H0RvwxBgQmepQG5Mdg= + - secure: "SosPNhER7I5YnVZy7AoUjrs+P08S60fPje1sFgMdfRNRElI42oLgO6wk1nEFEGGjUevSLzpsDruy7z1m5ilzyMenO1hG\ + 1lASf2BeeJC8rRz75MgRKnlf7Py6BA9GbNprzMdgxNPlUtrEkp9ExLvC7MZs7H0RvwxBgQmepQG5Mdg=" install: -- sudo service postgresql stop -- docker pull camptocamp/geomapfish-build-dev-travis:${TRAVIS_BUILD_NUMBER} -- docker pull camptocamp/geomapfish-commons-travis:${TRAVIS_BUILD_NUMBER} -- docker pull camptocamp/geomapfish-build-travis:${TRAVIS_BUILD_NUMBER} -- docker tag camptocamp/geomapfish-build-dev-travis:${TRAVIS_BUILD_NUMBER} camptocamp/geomapfish-build-dev:2.3 -- docker tag camptocamp/geomapfish-commons-travis:${TRAVIS_BUILD_NUMBER} camptocamp/geomapfish-commons:2.3 -- docker tag camptocamp/geomapfish-build-travis:${TRAVIS_BUILD_NUMBER} camptocamp/geomapfish-build:2.3 -- git config --global user.email travis@camptocamp.com -- git config --global user.name Travis -- python3 -m pip install --requirement=travis/requirements.txt + - sudo service postgresql stop + - docker pull camptocamp/geomapfish-build-dev-travis:${TRAVIS_BUILD_NUMBER} + - docker pull camptocamp/geomapfish-commons-travis:${TRAVIS_BUILD_NUMBER} + - docker pull camptocamp/geomapfish-build-travis:${TRAVIS_BUILD_NUMBER} + - docker tag camptocamp/geomapfish-build-dev-travis:${TRAVIS_BUILD_NUMBER} + camptocamp/geomapfish-build-dev:2.3 + - docker tag camptocamp/geomapfish-commons-travis:${TRAVIS_BUILD_NUMBER} camptocamp/geomapfish-commons:2.3 + - docker tag camptocamp/geomapfish-build-travis:${TRAVIS_BUILD_NUMBER} camptocamp/geomapfish-build:2.3 + - git config --global user.email travis@camptocamp.com + - git config --global user.name Travis + - python3 -m pip install --requirement=travis/requirements.txt jobs: include: - - stage: Prepare, first tests - env: [JOB=test-commons] - install: - - sudo apt-get update - - sudo apt-get autoremove postgis* - - sudo apt-get autoremove postgresql* - - sudo apt-get install postgresql-9.3-postgis-2.1 - before_script: - - psql -c "CREATE USER \"www-data\" WITH PASSWORD 'www-data';" -U postgres - - psql -c "CREATE DATABASE c2cgeoportal_tests WITH OWNER \"www-data\";" -U postgres - - psql -d c2cgeoportal_tests -c "CREATE EXTENSION postgis;" -U postgres - script: - - cd commons - - make check test + - stage: Prepare, first tests + env: [JOB=test-commons] + install: + - sudo apt-get update + - sudo apt-get autoremove postgis* + - sudo apt-get autoremove postgresql* + - sudo apt-get install postgresql-9.3-postgis-2.1 + before_script: + - psql -c "CREATE USER \"www-data\" WITH PASSWORD 'www-data';" -U postgres + - psql -c "CREATE DATABASE c2cgeoportal_tests WITH OWNER \"www-data\";" -U postgres + - psql -d c2cgeoportal_tests -c "CREATE EXTENSION postgis;" -U postgres + script: + - cd commons + - make check test + + - env: [JOB=test-admin] + install: + - sudo apt-get update + - sudo apt-get autoremove postgis* + - sudo apt-get autoremove postgresql* + - sudo apt-get install postgresql-9.3-postgis-2.1 + - rm -rf ~/.nvm + - git clone https://github.com/creationix/nvm.git ~/.nvm + - (cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`) + - source ~/.nvm/nvm.sh + - nvm install 6 + - npm -version + before_script: + - psql -c "CREATE USER \"www-data\" WITH PASSWORD 'www-data';" -U postgres + - psql -c "CREATE DATABASE c2cgeoportal_tests WITH OWNER \"www-data\";" -U postgres + - psql -d c2cgeoportal_tests -c "CREATE EXTENSION postgis;" -U postgres + script: + - cd admin + - make check test - - env: [JOB=test-admin] - install: - - sudo apt-get update - - sudo apt-get autoremove postgis* - - sudo apt-get autoremove postgresql* - - sudo apt-get install postgresql-9.3-postgis-2.1 - - rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh && nvm install 6 - - npm -version - before_script: - - psql -c "CREATE USER \"www-data\" WITH PASSWORD 'www-data';" -U postgres - - psql -c "CREATE DATABASE c2cgeoportal_tests WITH OWNER \"www-data\";" -U postgres - - psql -d c2cgeoportal_tests -c "CREATE EXTENSION postgis;" -U postgres - script: - - cd admin - - make check test + - env: [JOB=build-docker-images] + install: + - docker --version + - docker-compose --version + - python3 -m pip install --requirement=travis/requirements.txt + script: + - docker build --tag camptocamp/geomapfish-build-dev:2.3 docker/build + - docker tag camptocamp/geomapfish-build-dev:2.3 camptocamp/geomapfish-build-dev-travis:${TRAVIS_BUILD_NUMBER} + - ./docker-run travis/empty-make.sh help + - ./docker-run make build + - docker build --tag camptocamp/geomapfish-commons:2.3 commons + - docker tag camptocamp/geomapfish-commons:2.3 camptocamp/geomapfish-commons-travis:${TRAVIS_BUILD_NUMBER} + - docker build --tag camptocamp/geomapfish-build-travis:${TRAVIS_BUILD_NUMBER} geoportal + - docker login --username ${DOCKER_USERNAME} --password ${DOCKER_PASSWORD} + - docker push camptocamp/geomapfish-build-dev-travis:${TRAVIS_BUILD_NUMBER} + - docker push camptocamp/geomapfish-commons-travis:${TRAVIS_BUILD_NUMBER} + - docker push camptocamp/geomapfish-build-travis:${TRAVIS_BUILD_NUMBER} - - env: [JOB=build-docker-images] - install: - - docker --version - - docker-compose --version - - python3 -m pip install --requirement=travis/requirements.txt - script: - - docker build --tag camptocamp/geomapfish-build-dev:2.3 docker/build - - docker tag camptocamp/geomapfish-build-dev:2.3 camptocamp/geomapfish-build-dev-travis:${TRAVIS_BUILD_NUMBER} - - ./docker-run travis/empty-make.sh help - - ./docker-run make build - - docker build --tag camptocamp/geomapfish-commons:2.3 commons - - docker tag camptocamp/geomapfish-commons:2.3 camptocamp/geomapfish-commons-travis:${TRAVIS_BUILD_NUMBER} - - docker build --tag camptocamp/geomapfish-build-travis:${TRAVIS_BUILD_NUMBER} geoportal - - docker login --username ${DOCKER_USERNAME} --password ${DOCKER_PASSWORD} - - docker push camptocamp/geomapfish-build-dev-travis:${TRAVIS_BUILD_NUMBER} - - docker push camptocamp/geomapfish-commons-travis:${TRAVIS_BUILD_NUMBER} - - docker push camptocamp/geomapfish-build-travis:${TRAVIS_BUILD_NUMBER} + - env: [JOB=lint] + if: NOT repo = camptocamp/c2cgeoportal + script: + - ./docker-run make doc + - ./docker-run make geoportal/c2cgeoportal_geoportal/locale/c2cgeoportal_geoportal.pot + - ./docker-run make admin/c2cgeoportal_admin/locale/c2cgeoportal_admin.pot + # lint + - ./docker-run make flake8 + - ./docker-run make git-attributes + - ./docker-run make quote + - ./docker-run make spell + - ./docker-run travis/test-eof-newline + - ./docker-run travis/empty-make.sh build + # Test return code + - ./docker-run true + - | + if ./docker-run false + then + false + fi + - ./docker-compose-run true + - | + if ./docker-compose-run false + then + false + fi + - | + [[ `./docker-run id` =~ uid=[0-9]+\(travis\)\ gid=[0-9]+\(geomapfish\)\ groups=[0-9]+\(geomapfish\) ]] - - env: [JOB=lint] - if: NOT repo = camptocamp/c2cgeoportal - script: - - ./docker-run make doc - - ./docker-run make geoportal/c2cgeoportal_geoportal/locale/c2cgeoportal_geoportal.pot - - ./docker-run make admin/c2cgeoportal_admin/locale/c2cgeoportal_admin.pot - # lint - - ./docker-run make flake8 - - ./docker-run make git-attributes - - ./docker-run make quote - - ./docker-run make spell - - ./docker-run travis/test-eof-newline - - ./docker-run travis/empty-make.sh build - # Test return code - - ./docker-run true - - | - if ./docker-run false - then - false - fi - - ./docker-compose-run true - - | - if ./docker-compose-run false - then - false - fi - - | - [[ `./docker-run id` =~ uid=[0-9]+\(travis\)\ gid=[0-9]+\(geomapfish\)\ groups=[0-9]+\(geomapfish\) ]] + - stage: Tests + if: NOT repo = camptocamp/c2cgeoportal + env: [JOB=test-c2cgeoportal] + before_script: + # Test c2cgeoportal + - if [ ${TRAVIS_PULL_REQUEST} != "false" ] ; then git fetch origin ${TRAVIS_BRANCH}:${TRAVIS_BRANCH}; fi + script: + - ./docker-run make docker-compose.yaml + geoportal/tests/functional/alembic.ini + geoportal/tests/functional/alembic_static.ini + docker/test-mapserver/mapserver.map prepare-tests + - ./docker-compose-run sleep 15 + - ./docker-compose-run alembic --config geoportal/tests/functional/alembic.ini upgrade head + - ./docker-compose-run alembic --config geoportal/tests/functional/alembic_static.ini upgrade head + - ./docker-compose-run make tests - - stage: Tests - if: NOT repo = camptocamp/c2cgeoportal - env: [JOB=test-c2cgeoportal] - before_script: - # Test c2cgeoportal - - if [ ${TRAVIS_PULL_REQUEST} != "false" ] ; then git fetch origin ${TRAVIS_BRANCH}:${TRAVIS_BRANCH}; fi - script: - - ./docker-run make docker-compose.yaml - geoportal/tests/functional/alembic.ini - geoportal/tests/functional/alembic_static.ini - docker/test-mapserver/mapserver.map prepare-tests - - ./docker-compose-run sleep 15 - - ./docker-compose-run alembic --config geoportal/tests/functional/alembic.ini upgrade head - - ./docker-compose-run alembic --config geoportal/tests/functional/alembic_static.ini upgrade head - - ./docker-compose-run make tests + - env: [JOB=test-docker-app] + if: NOT repo = camptocamp/c2cgeoportal + before_script: + - docker build --tag=external-db docker/test-external-db + - travis/create-new-project.sh + - travis/run-on.sh /tmp/travis/testgeomapfish/ ./docker-run travis/empty-make.sh -f travis.mk help + - travis/run-on.sh /tmp/travis/testgeomapfish/ ./docker-run make --makefile=travis.mk build + - travis/run-on.sh /tmp/travis/testgeomapfish/ docker-compose up -d + - travis/waitwsgi http://localhost:8080/ + script: + # Test new Docker project + - travis/run-on.sh /tmp/travis/testgeomapfish/ ./docker-run travis/empty-make.sh -f travis.mk build + - travis/run-on.sh /tmp/travis/testgeomapfish/ ./docker-run make --makefile=travis.mk checks + - find + /tmp/travis/testgeomapfish/geoportal/setup.py + /tmp/travis/testgeomapfish/geoportal/testgeomapfish_geoportal/*.py + /tmp/travis/testgeomapfish/geoportal/testgeomapfish_geoportal/views + /tmp/travis/testgeomapfish/commons/setup.py /tmp/travis/testgeomapfish/commons/testgeomapfish_commons + -name \*.py | xargs travis/squote + - travis/test-new-project http://localhost:8080/c2c/health_check + - travis/test-new-project http://localhost:8080/c2c/health_check?max_level=100 + - travis/test-new-project http://localhost:8080/layers/test/values/type enum + - travis/run-on.sh /tmp/travis/testgeomapfish/ docker-compose logs + - travis/run-on.sh /tmp/travis/testgeomapfish/ docker-compose down + - travis/run-on.sh /tmp/travis/testgeomapfish/ ./docker-run travis/status.sh + - "travis/run-on.sh /tmp/travis/testgeomapfish/ \ + ./docker-run make --makefile=empty-vars.mk geoportal/config.yaml" + - "travis/run-on.sh /tmp/travis/testgeomapfish/ \ + ./docker-run make --makefile=travis.mk geoportal/alembic.ini geoportal/alembic_static.ini" + - travis/run-on.sh /tmp/travis/testgeomapfish/ ./docker-compose-run sleep 15 + - "travis/run-on.sh /tmp/travis/testgeomapfish/ \ + ./docker-compose-run alembic --config geoportal/alembic.ini upgrade head" + - "travis/run-on.sh /tmp/travis/testgeomapfish/ \ + ./docker-compose-run alembic --config geoportal/alembic_static.ini upgrade head" + - "travis/run-on.sh /tmp/travis/testgeomapfish/ \ + ./docker-compose-run alembic --config geoportal/alembic_static.ini downgrade base" + - "travis/run-on.sh /tmp/travis/testgeomapfish/ \ + ./docker-compose-run alembic --config geoportal/alembic.ini downgrade base" - - env: [JOB=test-docker-app] - if: NOT repo = camptocamp/c2cgeoportal - before_script: - - docker build --tag=external-db docker/test-external-db - - travis/create-new-project.sh - - travis/run-on.sh /tmp/travis/testgeomapfish/ ./docker-run travis/empty-make.sh -f travis.mk help - - travis/run-on.sh /tmp/travis/testgeomapfish/ ./docker-run make --makefile=travis.mk build - - travis/run-on.sh /tmp/travis/testgeomapfish/ docker-compose up -d - - travis/waitwsgi http://localhost:8080/ - script: - # Test new Docker project - - travis/run-on.sh /tmp/travis/testgeomapfish/ ./docker-run travis/empty-make.sh -f travis.mk build - - travis/run-on.sh /tmp/travis/testgeomapfish/ ./docker-run make --makefile=travis.mk checks - - find - /tmp/travis/testgeomapfish/geoportal/setup.py - /tmp/travis/testgeomapfish/geoportal/testgeomapfish_geoportal/*.py - /tmp/travis/testgeomapfish/geoportal/testgeomapfish_geoportal/views - /tmp/travis/testgeomapfish/commons/setup.py /tmp/travis/testgeomapfish/commons/testgeomapfish_commons - -name \*.py | xargs travis/squote - - travis/test-new-project http://localhost:8080/c2c/health_check - - travis/test-new-project http://localhost:8080/c2c/health_check?max_level=100 - - travis/test-new-project http://localhost:8080/layers/test/values/type enum - - travis/run-on.sh /tmp/travis/testgeomapfish/ docker-compose logs - - travis/run-on.sh /tmp/travis/testgeomapfish/ docker-compose down - - travis/run-on.sh /tmp/travis/testgeomapfish/ ./docker-run travis/status.sh - - travis/run-on.sh /tmp/travis/testgeomapfish/ ./docker-run make --makefile=empty-vars.mk geoportal/config.yaml - - travis/run-on.sh /tmp/travis/testgeomapfish/ ./docker-run make --makefile=travis.mk geoportal/alembic.ini geoportal/alembic_static.ini - - travis/run-on.sh /tmp/travis/testgeomapfish/ ./docker-compose-run sleep 15 - - travis/run-on.sh /tmp/travis/testgeomapfish/ ./docker-compose-run alembic --config geoportal/alembic.ini upgrade head - - travis/run-on.sh /tmp/travis/testgeomapfish/ ./docker-compose-run alembic --config geoportal/alembic_static.ini upgrade head - - travis/run-on.sh /tmp/travis/testgeomapfish/ ./docker-compose-run alembic --config geoportal/alembic_static.ini downgrade base - - travis/run-on.sh /tmp/travis/testgeomapfish/ ./docker-compose-run alembic --config geoportal/alembic.ini downgrade base + ## FOR NON DOCKER TESTS + - stage: Tests + env: [JOB=test-nondocker-app] + before_script: + - deactivate + - sudo apt-get remove --assume-yes --force-yes python-zope.interface + - "sudo aptitude install --assume-yes tree apache2 apache2-dev libapache2-mod-fcgid tomcat7 cgi-mapserver \ + python3-netifaces python3-pip python3-virtualenv libgdal-dev" + # workaround: https://askubuntu.com/questions/569550/ + # assertionerror-using-apache2-and-libapache2-mod-wsgi-py3-on-ubuntu-14-04-python + - sudo python3 -m pip install mod_wsgi + - sudo mod_wsgi-express install-module + - echo "LoadModule wsgi_module /usr/lib/apache2/modules/mod_wsgi-py34.cpython-34m.so" > /tmp/wsgi_express.load + - echo "WSGIPythonHome /usr/" > /tmp/wsgi_express.conf + - sudo mv /tmp/wsgi_express.load /tmp/wsgi_express.conf /etc/apache2/mods-available/ + - sudo a2enmod wsgi_express + - sudo service apache2 restart + - sudo chmod o+rx /var/log/apache2/ + - sudo chmod o+r /var/log/apache2/*.log + # Database for the GeoMapFish application + - docker build --tag=camptocamp/c2cgeoportal-gis-db docker/gis-db + - "docker run --env=POSTGRES_USER=www-data --env=POSTGRES_PASSWORD=www-data --env=POSTGRES_DB=geomapfish \ + --publish=5432:5432 --detach camptocamp/c2cgeoportal-gis-db" + # - sudo service tomcat7 stop + - docker build --tag=external-db docker/test-external-db + - docker run --publish=5433:5432 --detach external-db ## FOR NON DOCKER TEST + - mkdir /tmp/travis + - travis/create-new-nondocker-project.sh + - travis/run-on.sh /tmp/travis/nondockertestgeomapfish/ ./docker-run travis/empty-make.sh -f travis.mk help + - travis/run-on.sh /tmp/travis/nondockertestgeomapfish/ ./docker-run make --makefile=travis.mk build + - travis/run-on.sh /tmp/travis/nondockertestgeomapfish/ make --makefile=travis-nondocker.mk build + script: + # Test new non Docker project + - travis/run-on.sh /tmp/travis/nondockertestgeomapfish/ ./docker-run travis/empty-make.sh -f travis.mk build + - travis/run-on.sh /tmp/travis/nondockertestgeomapfish/ ./docker-run make --makefile=travis.mk checks + - find + /tmp/travis/testgeomapfish/geoportal/setup.py + /tmp/travis/testgeomapfish/geoportal/testgeomapfish_geoportal/*.py + /tmp/travis/testgeomapfish/geoportal/testgeomapfish_geoportal/views + /tmp/travis/testgeomapfish/commons/setup.py /tmp/travis/testgeomapfish/commons/testgeomapfish_commons + -name \*.py | xargs travis/squote + - travis/test-new-project http://localhost/main/wsgi/c2c/health_check + - travis/test-new-project http://localhost/main/wsgi/c2c/health_check?max_level=100 + - cat /var/log/apache2/error.log + - cat /var/log/apache2/access.log + - sudo cat /var/log/tomcat7/catalina.out + - travis/run-on.sh /tmp/travis/nondockertestgeomapfish/ ./docker-run travis/status.sh + - travis/run-on.sh /tmp/travis/nondockertestgeomapfish/ ./docker-run rm /build/c2ctemplate-cache.json + - "travis/run-on.sh /tmp/travis/nondockertestgeomapfish/ \ + ./docker-run make --makefile=empty-vars.mk geoportal/config.yaml" + - "travis/run-on.sh /tmp/travis/nondockertestgeomapfish/ \ + ./docker-run make --makefile=travis.mk geoportal/alembic.ini geoportal/alembic_static.ini" + - "travis/run-on.sh /tmp/travis/nondockertestgeomapfish/ \ + ./docker-run alembic --config geoportal/alembic.ini upgrade head" + - "travis/run-on.sh /tmp/travis/nondockertestgeomapfish/ \ + ./docker-run alembic --config geoportal/alembic_static.ini upgrade head" + - "travis/run-on.sh /tmp/travis/nondockertestgeomapfish/ \ + ./docker-run alembic --config geoportal/alembic_static.ini downgrade base" + - "travis/run-on.sh /tmp/travis/nondockertestgeomapfish/ \ + ./docker-run alembic --config geoportal/alembic.ini downgrade base" + ## END FOR NON DOCKER TESTS -## FOR NON DOCKER TESTS - - stage: Tests - env: [JOB=test-nondocker-app] - before_script: - - deactivate - - sudo apt-get remove --assume-yes --force-yes python-zope.interface - - sudo aptitude install --assume-yes tree apache2 apache2-dev libapache2-mod-fcgid tomcat7 cgi-mapserver python3-netifaces python3-pip python3-virtualenv libgdal-dev - # workaround: https://askubuntu.com/questions/569550/assertionerror-using-apache2-and-libapache2-mod-wsgi-py3-on-ubuntu-14-04-python - - sudo python3 -m pip install mod_wsgi - - sudo mod_wsgi-express install-module - - echo "LoadModule wsgi_module /usr/lib/apache2/modules/mod_wsgi-py34.cpython-34m.so" > /tmp/wsgi_express.load - - echo "WSGIPythonHome /usr/" > /tmp/wsgi_express.conf - - sudo mv /tmp/wsgi_express.load /tmp/wsgi_express.conf /etc/apache2/mods-available/ - - sudo a2enmod wsgi_express - - sudo service apache2 restart - - sudo chmod o+rx /var/log/apache2/ - - sudo chmod o+r /var/log/apache2/*.log - # Database for the GeoMapFish application - - docker build --tag=camptocamp/c2cgeoportal-gis-db docker/gis-db - - docker run --env=POSTGRES_USER=www-data --env=POSTGRES_PASSWORD=www-data --env=POSTGRES_DB=geomapfish --publish=5432:5432 --detach camptocamp/c2cgeoportal-gis-db -# - sudo service tomcat7 stop - - docker build --tag=external-db docker/test-external-db - - docker run --publish=5433:5432 --detach external-db ## FOR NON DOCKER TEST - - mkdir /tmp/travis - - travis/create-new-nondocker-project.sh - - travis/run-on.sh /tmp/travis/nondockertestgeomapfish/ ./docker-run travis/empty-make.sh -f travis.mk help - - travis/run-on.sh /tmp/travis/nondockertestgeomapfish/ ./docker-run make --makefile=travis.mk build - - travis/run-on.sh /tmp/travis/nondockertestgeomapfish/ make --makefile=travis-nondocker.mk build - script: - # Test new non Docker project - - travis/run-on.sh /tmp/travis/nondockertestgeomapfish/ ./docker-run travis/empty-make.sh -f travis.mk build - - travis/run-on.sh /tmp/travis/nondockertestgeomapfish/ ./docker-run make --makefile=travis.mk checks - - find - /tmp/travis/testgeomapfish/geoportal/setup.py - /tmp/travis/testgeomapfish/geoportal/testgeomapfish_geoportal/*.py - /tmp/travis/testgeomapfish/geoportal/testgeomapfish_geoportal/views - /tmp/travis/testgeomapfish/commons/setup.py /tmp/travis/testgeomapfish/commons/testgeomapfish_commons - -name \*.py | xargs travis/squote - - travis/test-new-project http://localhost/main/wsgi/c2c/health_check - - travis/test-new-project http://localhost/main/wsgi/c2c/health_check?max_level=100 - - cat /var/log/apache2/error.log - - cat /var/log/apache2/access.log - - sudo cat /var/log/tomcat7/catalina.out - - travis/run-on.sh /tmp/travis/nondockertestgeomapfish/ ./docker-run travis/status.sh - - travis/run-on.sh /tmp/travis/nondockertestgeomapfish/ ./docker-run rm /build/c2ctemplate-cache.json - - travis/run-on.sh /tmp/travis/nondockertestgeomapfish/ ./docker-run make --makefile=empty-vars.mk geoportal/config.yaml - - travis/run-on.sh /tmp/travis/nondockertestgeomapfish/ ./docker-run make --makefile=travis.mk geoportal/alembic.ini geoportal/alembic_static.ini - - travis/run-on.sh /tmp/travis/nondockertestgeomapfish/ ./docker-run alembic --config geoportal/alembic.ini upgrade head - - travis/run-on.sh /tmp/travis/nondockertestgeomapfish/ ./docker-run alembic --config geoportal/alembic_static.ini upgrade head - - travis/run-on.sh /tmp/travis/nondockertestgeomapfish/ ./docker-run alembic --config geoportal/alembic_static.ini downgrade base - - travis/run-on.sh /tmp/travis/nondockertestgeomapfish/ ./docker-run alembic --config geoportal/alembic.ini downgrade base -## END FOR NON DOCKER TESTS - - env: [JOB=test-upgrade] - if: NOT repo = camptocamp/c2cgeoportal - before_script: - # database for the GeoMapFish application - - docker build --tag=camptocamp/c2cgeoportal-gis-db docker/gis-db - - docker run --env=POSTGRES_USER=www-data --env=POSTGRES_PASSWORD=www-data --env=POSTGRES_DB=geomapfish --publish=5432:5432 --detach camptocamp/c2cgeoportal-gis-db - - travis/test-upgrade-convert.sh init /tmp/travis - script: - # Test Upgrade an convert project - - travis/test-upgrade-convert.sh docker /tmp/travis - - travis/test-upgrade-convert.sh todocker /tmp/travis - - travis/test-upgrade-convert.sh v220-todocker /tmp/travis - - travis/test-upgrade-convert.sh cleanup /tmp/travis + - env: [JOB=test-upgrade] + if: NOT repo = camptocamp/c2cgeoportal + before_script: + # database for the GeoMapFish application + - docker build --tag=camptocamp/c2cgeoportal-gis-db docker/gis-db + - "docker run --env=POSTGRES_USER=www-data --env=POSTGRES_PASSWORD=www-data --env=POSTGRES_DB=geomapfish \ + --publish=5432:5432 --detach camptocamp/c2cgeoportal-gis-db" + - travis/test-upgrade-convert.sh init /tmp/travis + script: + # Test Upgrade an convert project + - travis/test-upgrade-convert.sh docker /tmp/travis + - travis/test-upgrade-convert.sh todocker /tmp/travis + - travis/test-upgrade-convert.sh v220-todocker /tmp/travis + - travis/test-upgrade-convert.sh cleanup /tmp/travis - - env: [JOB=test-upgrade-nondocker] - if: NOT repo = camptocamp/c2cgeoportal - before_script: - # database for the GeoMapFish application - - docker build --tag=camptocamp/c2cgeoportal-gis-db docker/gis-db - - docker run --env=POSTGRES_USER=www-data --env=POSTGRES_PASSWORD=www-data --env=POSTGRES_DB=geomapfish --publish=5432:5432 --detach camptocamp/c2cgeoportal-gis-db - - travis/test-upgrade-convert.sh init /tmp/travis - script: - # Test Upgrade an convert project - - travis/test-upgrade-convert.sh nondocker /tmp/travis - - travis/test-upgrade-convert.sh tonondocker /tmp/travis - - travis/test-upgrade-convert.sh v220-tonondocker /tmp/travis - - travis/test-upgrade-convert.sh cleanup /tmp/travis + - env: [JOB=test-upgrade-nondocker] + if: NOT repo = camptocamp/c2cgeoportal + before_script: + # database for the GeoMapFish application + - docker build --tag=camptocamp/c2cgeoportal-gis-db docker/gis-db + - "docker run --env=POSTGRES_USER=www-data --env=POSTGRES_PASSWORD=www-data --env=POSTGRES_DB=geomapfish \ + --publish=5432:5432 --detach camptocamp/c2cgeoportal-gis-db" + - travis/test-upgrade-convert.sh init /tmp/travis + script: + # Test Upgrade an convert project + - travis/test-upgrade-convert.sh nondocker /tmp/travis + - travis/test-upgrade-convert.sh tonondocker /tmp/travis + - travis/test-upgrade-convert.sh v220-tonondocker /tmp/travis + - travis/test-upgrade-convert.sh cleanup /tmp/travis - - stage: Publish - env: [JOB=publish-doc] - script: - - ./docker-run make doc - after_success: - - git config --global user.email travis@camptocamp.com - - git config --global user.name Travis - ./docker-run travis/codacy.sh - - openssl aes-256-cbc -K $encrypted_ae821512cabf_key -iv $encrypted_ae821512cabf_iv -in deploy_key.enc -out ~/.ssh/id_rsa -d | true - - chmod 600 ~/.ssh/id_rsa - - git remote set-url origin git@github.com:camptocamp/c2cgeoportal.git - if: NOT type = pull_request AND branch = master - deploy: - - provider: script - script: travis/doc.sh - skip_cleanup: true - on: - repo: camptocamp/c2cgeoportal + - stage: Publish + env: [JOB=publish-doc] + script: + - ./docker-run make doc + after_success: + - git config --global user.email travis@camptocamp.com + - git config --global user.name Travis + ./docker-run travis/codacy.sh + - openssl aes-256-cbc -K $encrypted_ae821512cabf_key -iv $encrypted_ae821512cabf_iv + -in deploy_key.enc -out ~/.ssh/id_rsa -d | true + - chmod 600 ~/.ssh/id_rsa + - git remote set-url origin git@github.com:camptocamp/c2cgeoportal.git + if: NOT type = pull_request AND branch = master + deploy: + - provider: script + script: travis/doc.sh + skip_cleanup: true + on: + repo: camptocamp/c2cgeoportal - - stage: Publish - env: [JOB=publish-transifex] - script: - - | - if [ "${TX_PASS}" != "" ] - then - echo "[https://www.transifex.com]" >> ~/.transifexrc - echo "hostname = https://www.transifex.com" >> ~/.transifexrc - echo "username = stephane.brunner@camptocamp.com" >> ~/.transifexrc - echo "password = ${TX_PASS}" >> ~/.transifexrc - echo "token =" >> ~/.transifexrc - fi - ./docker-run make transifex-send - if: NOT type = pull_request AND branch = master AND repo = camptocamp/c2cgeoportal + - stage: Publish + env: [JOB=publish-transifex] + script: + - | + if [ "${TX_PASS}" != "" ] + then + echo "[https://www.transifex.com]" >> ~/.transifexrc + echo "hostname = https://www.transifex.com" >> ~/.transifexrc + echo "username = stephane.brunner@camptocamp.com" >> ~/.transifexrc + echo "password = ${TX_PASS}" >> ~/.transifexrc + echo "token =" >> ~/.transifexrc + fi + ./docker-run make transifex-send + if: NOT type = pull_request AND branch = master AND repo = camptocamp/c2cgeoportal - - stage: Publish - env: [JOB=publish-pypi] - install: [] - script: - - ./docker-run make build - - if [[ ${TRAVIS_TAG} =~ ^[0-9]+\.[0-9]+\..+$ ]] ; then - sed --expression 's/version="[0-9]\+\.[0-9]\+",/version="'"${TRAVIS_TAG}"'",/g' --in-place setup.py; - git diff; - fi - if: tag =~ ^[0-9]+\.[0-9]+\..+$ AND repo = camptocamp/c2cgeoportal - deploy: - - provider: pypi - user: sbrunner - password: - secure: dT4Z3Zk2SGq1BPl+mX2iI0ubK7veSPb1b0fGrKHpvC3gBxuGUDMhtHw5dgopdWWeUhZLzLoPpEZPyCHtJhE2vunGwZfmJXkrqp/yC1meszZpDgBkpRWzx62u/f1+FmUdGPukvlqTfzgl/vJwertPRzX9Y4hanoFIDQvIKnp37Ls= - skip_cleanup: true - skip_upload_docs: true - distributions: sdist bdist_wheel + - stage: Publish + env: [JOB=publish-pypi] + install: [] + script: + - ./docker-run make build + - if [[ ${TRAVIS_TAG} =~ ^[0-9]+\.[0-9]+\..+$ ]] ; then + sed --expression 's/version="[0-9]\+\.[0-9]\+",/version="'"${TRAVIS_TAG}"'",/g' --in-place setup.py; + git diff; + fi + if: tag =~ ^[0-9]+\.[0-9]+\..+$ AND repo = camptocamp/c2cgeoportal + deploy: + - provider: pypi + user: sbrunner + password: + secure: "dT4Z3Zk2SGq1BPl+mX2iI0ubK7veSPb1b0fGrKHpvC3gBxuGUDMhtHw5dgopdWWeUhZLzLoPpEZPyCHtJhE2vunG\ + wZfmJXkrqp/yC1meszZpDgBkpRWzx62u/f1+FmUdGPukvlqTfzgl/vJwertPRzX9Y4hanoFIDQvIKnp37Ls=" + skip_cleanup: true + skip_upload_docs: true + distributions: sdist bdist_wheel - - stage: Publish - env: [JOB=publish-docker] - script: - - travis/publish-docker - if: NOT type = pull_request AND repo = camptocamp/c2cgeoportal + - stage: Publish + env: [JOB=publish-docker] + script: + - travis/publish-docker + if: NOT type = pull_request AND repo = camptocamp/c2cgeoportal notifications: email: diff --git a/Makefile b/Makefile index b9700f7fea..fd6ad5b80b 100644 --- a/Makefile +++ b/Makefile @@ -93,7 +93,7 @@ build: $(MAKO_FILES:.mako=) \ doc: $(BUILD_DIR)/sphinx.timestamp .PHONY: checks -checks: flake8 git-attributes quote spell +checks: flake8 git-attributes quote spell yamllint .PHONY: clean clean: @@ -181,6 +181,11 @@ quote: spell: @codespell geoportal/setup.py $(shell find geoportal/c2cgeoportal_geoportal -name static -prune -or -name '*.py' -print) +YAML_FILES ?= $(shell find -name ngeo -prune -or \( -name "*.yml" -or -name "*.yaml" \) -print) +.PHONY: yamllint +yamllint: $(YAML_FILES) + yamllint --strict --config-file=yamllint.yaml -s $(YAML_FILES) + # i18n $(HOME_DIR)/.transifexrc: $(PRERULE_CMD) diff --git a/docker-compose.yaml.mako b/docker-compose.yaml.mako index 0ca2235cca..a48469aeff 100644 --- a/docker-compose.yaml.mako +++ b/docker-compose.yaml.mako @@ -1,33 +1,35 @@ +--- + version: '2' volumes: - c2cgpbuild: - external: - name: ${build_volume_name} + c2cgpbuild: + external: + name: ${build_volume_name} services: - db: - build: docker/gis-db - image: camptocamp/c2cgeoportal-gis-db - environment: - - POSTGRES_USER=www-data - - POSTGRES_PASSWORD=www-data - - POSTGRES_DB=geomapfish_test + db: + build: docker/gis-db + image: camptocamp/c2cgeoportal-gis-db + environment: + - POSTGRES_USER=www-data + - POSTGRES_PASSWORD=www-data + - POSTGRES_DB=geomapfish_test - mapserver: - build: docker/test-mapserver - image: camptocamp/c2cgeoportal-test-mapserver + mapserver: + build: docker/test-mapserver + image: camptocamp/c2cgeoportal-test-mapserver - build: - image: camptocamp/geomapfish-build-dev:2.3 - volumes: - - c2cgpbuild:/build - - .:/src - environment: - - USER_NAME - - USER_ID - - GROUP_ID - stdin_open: true - tty: true - command: ${'$'}{RUN} + build: + image: camptocamp/geomapfish-build-dev:2.3 + volumes: + - c2cgpbuild:/build + - .:/src + environment: + - USER_NAME + - USER_ID + - GROUP_ID + stdin_open: true + tty: true + command: ${'$'}{RUN} diff --git a/docker/build/requirements.txt b/docker/build/requirements.txt index 2ce0f243f2..1e3f065705 100644 --- a/docker/build/requirements.txt +++ b/docker/build/requirements.txt @@ -53,4 +53,5 @@ tilecloud-chain==1.4.0.dev9 # Tile generation transifex-client==0.12.4 # Makefile virtualenv==15.1.0 # Makefile waitress==1.1.0 # For pcreate +yamllint==1.9.0 # lint zgitignore==0.8.0 # Makefile diff --git a/geoportal/c2cgeoportal_geoportal/scaffolds/create/+dot+travis.yml b/geoportal/c2cgeoportal_geoportal/scaffolds/create/+dot+travis.yml index f71c6bb43f..fb25eab9aa 100644 --- a/geoportal/c2cgeoportal_geoportal/scaffolds/create/+dot+travis.yml +++ b/geoportal/c2cgeoportal_geoportal/scaffolds/create/+dot+travis.yml @@ -1,17 +1,19 @@ +--- + sudo: false git: - submodules: false + submodules: false language: node_js node_js: -- '6' + - '6' addons: apt: packages: - - python-virtualenv + - python-virtualenv script: -- make checks + - make checks 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 86c58a3c41..dd70e42aa4 100644 --- a/geoportal/c2cgeoportal_geoportal/scaffolds/create/docker-compose-build.yaml.mako +++ b/geoportal/c2cgeoportal_geoportal/scaffolds/create/docker-compose-build.yaml.mako @@ -1,41 +1,43 @@ +--- # A compose file for development. + version: '2' volumes: - build: - external: - name: ${build_volume_name} + build: + external: + name: ${build_volume_name} services: % if dbhost == "db": - db: - image: ${docker_base}-testdb:${docker_tag} - environment: - POSTGRES_USER: ${dbuser} - POSTGRES_DB: ${db} - POSTGRES_PASSWORD: ${dbpassword} + db: + image: ${docker_base}-testdb:${docker_tag} + environment: + POSTGRES_USER: ${dbuser} + POSTGRES_DB: ${db} + POSTGRES_PASSWORD: ${dbpassword} % if development == "TRUE": - ports: - - 15432:5432 + ports: + - 15432:5432 % endif % endif - mapserver: - image: ${docker_base}-mapserver:${docker_tag} + mapserver: + image: ${docker_base}-mapserver:${docker_tag} % if development == "TRUE": - ports: - - 8380:80 + ports: + - 8380:80 % endif - build: - image: camptocamp/geomapfish-build:${geomapfish_version} - volumes: - - build:/build - - .:/src - environment: - - USER_NAME - - USER_ID - - GROUP_ID - stdin_open: true - tty: true - command: ${'$'}{RUN} + build: + image: camptocamp/geomapfish-build:${geomapfish_version} + volumes: + - build:/build + - .:/src + environment: + - USER_NAME + - USER_ID + - GROUP_ID + stdin_open: true + tty: true + command: ${'$'}{RUN} diff --git a/geoportal/c2cgeoportal_geoportal/scaffolds/create/docker-compose.yaml.mako b/geoportal/c2cgeoportal_geoportal/scaffolds/create/docker-compose.yaml.mako index dfc370acbf..15c4d72220 100644 --- a/geoportal/c2cgeoportal_geoportal/scaffolds/create/docker-compose.yaml.mako +++ b/geoportal/c2cgeoportal_geoportal/scaffolds/create/docker-compose.yaml.mako @@ -1,3 +1,4 @@ +--- # A compose file for development. version: '2' services: @@ -10,7 +11,7 @@ services: POSTGRES_PASSWORD: ${dbpassword} % if development == "TRUE": ports: - - 15432:5432 + - 15432:5432 % endif % endif @@ -18,17 +19,17 @@ services: image: ${docker_base}-print:${docker_tag} % if development == "TRUE": ports: - - 8280:8080 + - 8280:8080 % endif mapserver: image: ${docker_base}-mapserver:${docker_tag} % if development == "TRUE": ports: - - 8380:80 + - 8380:80 % endif geoportal: image: ${docker_base}-geoportal:${docker_tag} ports: - - 8080:80 + - 8080:80 diff --git a/geoportal/c2cgeoportal_geoportal/scaffolds/create/print/print-apps/+package+/config.yaml.mako b/geoportal/c2cgeoportal_geoportal/scaffolds/create/print/print-apps/+package+/config.yaml.mako index 0d465cb81c..2d7812a99b 100644 --- a/geoportal/c2cgeoportal_geoportal/scaffolds/create/print/print-apps/+package+/config.yaml.mako +++ b/geoportal/c2cgeoportal_geoportal/scaffolds/create/print/print-apps/+package+/config.yaml.mako @@ -1,133 +1,143 @@ +--- + throwErrorOnExtraParameters: true templates: - 1 A4 portrait: !template - reportTemplate: A4_Portrait.jrxml + 1 A4 portrait: !template + reportTemplate: A4_Portrait.jrxml + attributes: + title: + !string &title + default: "" + comments: + !string &comments + default: "" + debug: + !boolean &debug + default: false + legend: !legend &legend {} + map: + !map &map + maxDpi: 254 + dpiSuggestions: [254] + zoomLevels: + !zoomLevels + scales: [100, 250, 500, 2500, 5000, 10000, 25000, 50000, 100000, 500000] + width: 555 + height: 675 + northArrow: + !northArrow &northArrow + size: 40 + default: + graphic: "file:///north.svg" + scalebar: + !scalebar &scalebar + width: 150 + height: 20 + default: + fontSize: 8 + datasource: + !datasource &datasource attributes: - title: !string &title - default: "" - comments: !string &comments - default: "" - debug: !boolean &debug - default: false - legend: !legend &legend {} - map: !map &map - maxDpi: 254 - dpiSuggestions: [254] - zoomLevels: !zoomLevels - scales: [100, 250, 500, 2500, 5000, 10000, 25000, 50000, 100000, 500000] - width: 555 - height: 675 - northArrow: !northArrow &northArrow - size: 40 - default: - graphic: "file:///north.svg" - scalebar: !scalebar &scalebar - width: 150 - height: 20 - default: - fontSize: 8 - datasource: !datasource &datasource - attributes: - title: !string {} - table: !table {} + title: !string {} + table: !table {} - processors: &processors - - !reportBuilder # compile all reports in current directory - directory: '.' - - !configureHttpRequests &configureHttpRequests - httpProcessors: - - !mapUri - mapping: - (https?)://${__import__('re').escape(host)}/(.*): "http://127.0.0.1/$2" - - !forwardHeaders - matchers: - - !localMatch {} - headers: - - Cookie - - Host - - !forwardHeaders - headers: - - Referer - - !restrictUris - matchers: - - !localMatch - pathRegex: ${entry_point}/mapserv_proxy - - !localMatch - pathRegex: ${entry_point}/tiles/.* - - !localMatch - reject: true - - !ipMatch - ip: 10.0.0.0 - mask: 255.0.0.0 - reject: true - - !ipMatch - ip: 172.16.0.0 - mask: 255.240.0.0 - reject: true - - !ipMatch - ip: 192.168.0.0 - mask: 255.255.0.0 - reject: true - - !acceptAll {} - - !prepareLegend - template: legend.jrxml - - !createMap {} - - !createNorthArrow {} - - !createScalebar {} - - !createDataSource - processors: - - !prepareTable - dynamic: true - columns: - icon: !urlImage - urlExtractor: (.*) - urlGroup: 1 + processors: &processors + - !reportBuilder # compile all reports in current directory + directory: '.' + - !configureHttpRequests &configureHttpRequests + httpProcessors: + - !mapUri + mapping: + (https?)://${__import__('re').escape(host)}/(.*): "http://127.0.0.1/$2" + - !forwardHeaders + matchers: + - !localMatch {} + headers: + - Cookie + - Host + - !forwardHeaders + headers: + - Referer + - !restrictUris + matchers: + - !localMatch + pathRegex: ${entry_point}/mapserv_proxy + - !localMatch + pathRegex: ${entry_point}/tiles/.* + - !localMatch + reject: true + - !ipMatch + ip: 10.0.0.0 + mask: 255.0.0.0 + reject: true + - !ipMatch + ip: 172.16.0.0 + mask: 255.240.0.0 + reject: true + - !ipMatch + ip: 192.168.0.0 + mask: 255.255.0.0 + reject: true + - !acceptAll {} + - !prepareLegend + template: legend.jrxml + - !createMap {} + - !createNorthArrow {} + - !createScalebar {} + - !createDataSource + processors: + - !prepareTable + dynamic: true + columns: + icon: !urlImage + urlExtractor: (.*) + urlGroup: 1 - 2 A4 landscape: !template - reportTemplate: A4_Landscape.jrxml - attributes: - title: *title - comments: *comments - debug: *debug - legend: *legend - map: !map - <<: *map - width: 800 - height: 441 - northArrow: *northArrow - scalebar: *scalebar - datasource: *datasource - processors: *processors + 2 A4 landscape: !template + reportTemplate: A4_Landscape.jrxml + attributes: + title: *title + comments: *comments + debug: *debug + legend: *legend + map: !map + <<: *map + width: 800 + height: 441 + northArrow: *northArrow + scalebar: *scalebar + datasource: *datasource + processors: *processors - 3 A3 portrait: !template - reportTemplate: A3_Portrait.jrxml - attributes: - title: *title - comments: *comments - debug: *debug - legend: *legend - map: !map - <<: *map - width: 800 - height: 1000 - northArrow: *northArrow - scalebar: *scalebar - datasource: *datasource - processors: *processors + 3 A3 portrait: !template + reportTemplate: A3_Portrait.jrxml + attributes: + title: *title + comments: *comments + debug: *debug + legend: *legend + map: !map + <<: *map + width: 800 + height: 1000 + northArrow: *northArrow + scalebar: *scalebar + datasource: *datasource + processors: *processors - 4 A3 landscape: !template - reportTemplate: A3_Landscape.jrxml - attributes: - title: *title - comments: *comments - debug: *debug - legend: *legend - map: !map - <<: *map - width: 1150 - height: 673 - northArrow: *northArrow - scalebar: *scalebar - datasource: *datasource - processors: *processors + 4 A3 landscape: !template + reportTemplate: A3_Landscape.jrxml + attributes: + title: *title + comments: *comments + debug: *debug + legend: *legend + map: !map + <<: *map + width: 1150 + height: 673 + northArrow: *northArrow + scalebar: *scalebar + datasource: *datasource + processors: *processors diff --git a/geoportal/c2cgeoportal_geoportal/scaffolds/create/project.yaml.mako_tmpl b/geoportal/c2cgeoportal_geoportal/scaffolds/create/project.yaml.mako_tmpl index e318e4e32c..0583d0d8e6 100644 --- a/geoportal/c2cgeoportal_geoportal/scaffolds/create/project.yaml.mako_tmpl +++ b/geoportal/c2cgeoportal_geoportal/scaffolds/create/project.yaml.mako_tmpl @@ -1,9 +1,10 @@ +--- project_folder: {{project}} project_package: ${package} host: ${host} checker_path: /c2c/health_check? managed_files: [] template_vars: - package: {{package}} - srid: {{srid}} - extent: {{extent}} + package: {{package}} + srid: {{srid}} + extent: {{extent}} diff --git a/geoportal/c2cgeoportal_geoportal/scaffolds/create/vars.yaml_tmpl b/geoportal/c2cgeoportal_geoportal/scaffolds/create/vars.yaml_tmpl index 3bacdf0188..6ba92d3a06 100644 --- a/geoportal/c2cgeoportal_geoportal/scaffolds/create/vars.yaml_tmpl +++ b/geoportal/c2cgeoportal_geoportal/scaffolds/create/vars.yaml_tmpl @@ -1,157 +1,159 @@ +--- + extends: CONST_vars.yaml vars: - # Database name - db: geomapfish + # Database name + db: geomapfish - srid: {{srid}} + srid: {{srid}} - # The application's default language. This is the language used by - # the application if no specific language is specified in the URLs. - # This also defines the language used for the text search. - default_locale_name: fr + # The application's default language. This is the language used by + # the application if no specific language is specified in the URLs. + # This also defines the language used for the text search. + default_locale_name: fr - # The set of languages supported by the applications. - available_locale_names: + # The set of languages supported by the applications. + available_locale_names: - en - fr - de - default_interface: desktop - - authtkt: - # One day - timeout: 86400 - - admin_interface: - # Default values for the admin interface's maps. - map_x: 740000 - map_y: 5860000 - map_zoom: 10 - - functionalities: - # Functionalities that are accessible to anonymous - # users. - anonymous: - print_template: - - 1 A4 portrait - - 2 A4 landscape - - 3 A3 portrait - - 4 A3 landscape - default_basemap: map - - # The name of the theme to use as the default theme. - # The default theme is the theme loaded when no - # theme name is specified in the mobile app URL. If unset - # then there is no default theme, and no theme information - # will be passed to the config.js template. - default_theme: - - # Functionalities that are accessible to authenticated - # users with no associated functionalities in the - # database. - registered: {} - - # Functionalities that are made available to Mako templates. - available_in_templates: - - default_basemap - - layers: - geometry_validation: True - - # For base layers - tiles_url: + default_interface: desktop + + authtkt: + # One day + timeout: 86400 + + admin_interface: + # Default values for the admin interface's maps. + map_x: 740000 + map_y: 5860000 + map_zoom: 10 + + functionalities: + # Functionalities that are accessible to anonymous + # users. + anonymous: + print_template: + - 1 A4 portrait + - 2 A4 landscape + - 3 A3 portrait + - 4 A3 landscape + default_basemap: map + + # The name of the theme to use as the default theme. + # The default theme is the theme loaded when no + # theme name is specified in the mobile app URL. If unset + # then there is no default theme, and no theme information + # will be passed to the config.js template. + default_theme: + + # Functionalities that are accessible to authenticated + # users with no associated functionalities in the + # database. + registered: {} + + # Functionalities that are made available to Mako templates. + available_in_templates: + - default_basemap + + layers: + geometry_validation: True + + # For base layers + tiles_url: - '{web_protocol}://a.tiles.{host}{entry_point}/tiles' - '{web_protocol}://b.tiles.{host}{entry_point}/tiles' - '{web_protocol}://c.tiles.{host}{entry_point}/tiles' - # The URL template used to generate the sub domain URL - # %(sub)s will be replaced by the sub domain value. - #subdomain_url_template: http://%(sub)s.{host} - # The used sub domain for the static resources - # Do not works with pyramid debug toolbar - #subdomains: [s1, s2, s3] - + # The URL template used to generate the sub domain URL + # %(sub)s will be replaced by the sub domain value. + # subdomain_url_template: http://%(sub)s.{host} + # The used sub domain for the static resources + # Do not works with pyramid debug toolbar + # subdomains: [s1, s2, s3] + + fulltextsearch: + languages: + fr: french + en: english + de: german + + # proxies: + # http: http://someproxy + + shortener: + # Used to send a confirmation email + email_from: info@example.com + email_subject: "Geoportal URL" + email_body: | + Hello, + + Somebody sent you the following link: + %(short_url)s + + With the message: + %(message) + + Sincerely yours + The GeoMapfish team + smtp_server: smtp.example.com + + smtp: + # Used to send email from various feature + host: smtp.example.com + ssl: true + user: + password: + starttls: false + + reset_password: + # Used to send a confirmation email + email_from: info@camptocamp.com + email_subject: New password generated for GeoMapFish + email_body: | + Hello {user}, + + You have asked for an new password, + the newly generated password is: {password} + + Sincerely yours + The GeoMapfish team + + # Checker configuration + checker: fulltextsearch: - languages: - fr: french - en: english - de: german - - #proxies: - # http: http://someproxy - - shortener: - # Used to send a confirmation email - email_from: info@example.com - email_subject: "Geoportal URL" - email_body: | - Hello, - - Somebody sent you the following link: - %(short_url)s - - With the message: - %(message) - - Sincerely yours - The GeoMapfish team - smtp_server: smtp.example.com - - smtp: - # Used to send email from various feature - host: smtp.example.com - ssl: true - user: - password: - starttls: false - - reset_password: - # Used to send a confirmation email - email_from: info@camptocamp.com - email_subject: New password generated for GeoMapFish - email_body: | - Hello {user}, - - You have asked for an new password, - the newly generated password is: {password} - - Sincerely yours - The GeoMapfish team - - # Checker configuration - checker: - fulltextsearch: - search: text to search - print: - spec: - layout: "1 A4 portrait" - outputFormat: "pdf" - attributes: - title: "" - comments: "" - datasource: [] - map: - projection: "EPSG:21781" - dpi: 254 - rotation: 0 - center: [600000, 200000] - scale: 100000 - longitudeFirst: true - layers: [] - legend: {} - - check_collector: - hosts: [] - # - display: Child: - # url: {web_protocol}://{host}/child/wsgi + search: text to search + print: + spec: + layout: "1 A4 portrait" + outputFormat: "pdf" + attributes: + title: "" + comments: "" + datasource: [] + map: + projection: "EPSG:21781" + dpi: 254 + rotation: 0 + center: [600000, 200000] + scale: 100000 + longitudeFirst: true + layers: [] + legend: {} + + check_collector: + hosts: [] + # - display: Child: + # url: {web_protocol}://{host}/child/wsgi update_paths: -- shortener -- fulltextsearch -- authtkt -- admin_interface -- checker.fulltextsearch -- checker.print -- check_collector.disabled -- check_collector.hosts + - shortener + - fulltextsearch + - authtkt + - admin_interface + - checker.fulltextsearch + - checker.print + - check_collector.disabled + - check_collector.hosts diff --git a/geoportal/c2cgeoportal_geoportal/scaffolds/create/yamllint.yaml b/geoportal/c2cgeoportal_geoportal/scaffolds/create/yamllint.yaml new file mode 100644 index 0000000000..62a4e5b622 --- /dev/null +++ b/geoportal/c2cgeoportal_geoportal/scaffolds/create/yamllint.yaml @@ -0,0 +1,9 @@ +--- +extends: default + +rules: + line-length: + max: 110 + indentation: + spaces: 2 + truthy: disable diff --git a/geoportal/c2cgeoportal_geoportal/scaffolds/nondockercreate/docker-compose-build.yaml.mako b/geoportal/c2cgeoportal_geoportal/scaffolds/nondockercreate/docker-compose-build.yaml.mako index 275d4058fb..cbf896c73d 100644 --- a/geoportal/c2cgeoportal_geoportal/scaffolds/nondockercreate/docker-compose-build.yaml.mako +++ b/geoportal/c2cgeoportal_geoportal/scaffolds/nondockercreate/docker-compose-build.yaml.mako @@ -1,34 +1,36 @@ +--- # A compose file for development. + version: '2' volumes: - build: - external: - name: ${build_volume_name} + build: + external: + name: ${build_volume_name} services: % if dbhost == "db": - db: - image: ${docker_base}-testdb:${docker_tag} - environment: - POSTGRES_USER: ${dbuser} - POSTGRES_DB: ${db} - POSTGRES_PASSWORD: ${dbpassword} + db: + image: ${docker_base}-testdb:${docker_tag} + environment: + POSTGRES_USER: ${dbuser} + POSTGRES_DB: ${db} + POSTGRES_PASSWORD: ${dbpassword} % if development == "TRUE": - ports: - - 15432:5432 + ports: + - 15432:5432 % endif % endif - build: - image: camptocamp/geomapfish_build:${geomapfish_version} - volumes: - - build:/build - - .:/src - environment: - - USER_NAME - - USER_ID - - GROUP_ID - stdin_open: true - tty: true - command: ${'$'}{RUN} + build: + image: camptocamp/geomapfish_build:${geomapfish_version} + volumes: + - build:/build + - .:/src + environment: + - USER_NAME + - USER_ID + - GROUP_ID + stdin_open: true + tty: true + command: ${'$'}{RUN} diff --git a/geoportal/c2cgeoportal_geoportal/scaffolds/nondockercreate/print/print-apps/+package+/config.yaml.mako b/geoportal/c2cgeoportal_geoportal/scaffolds/nondockercreate/print/print-apps/+package+/config.yaml.mako index e837cc83e2..d37b50a9bf 100644 --- a/geoportal/c2cgeoportal_geoportal/scaffolds/nondockercreate/print/print-apps/+package+/config.yaml.mako +++ b/geoportal/c2cgeoportal_geoportal/scaffolds/nondockercreate/print/print-apps/+package+/config.yaml.mako @@ -1,133 +1,143 @@ +--- + throwErrorOnExtraParameters: true templates: - 1 A4 portrait: !template - reportTemplate: A4_Portrait.jrxml + 1 A4 portrait: !template + reportTemplate: A4_Portrait.jrxml + attributes: + title: + !string &title + default: "" + comments: + !string &comments + default: "" + debug: + !boolean &debug + default: false + legend: + !legend &legend {} + map: + !map &map + maxDpi: 254 + dpiSuggestions: [254] + zoomLevels: !zoomLevels + scales: [100, 250, 500, 2500, 5000, 10000, 25000, 50000, 100000, 500000] + width: 555 + height: 675 + northArrow: + !northArrow &northArrow + size: 40 + default: + graphic: "file:///north.svg" + scalebar: + !scalebar &scalebar + width: 150 + height: 20 + default: + fontSize: 8 + datasource: + !datasource &datasource attributes: - title: !string &title - default: "" - comments: !string &comments - default: "" - debug: !boolean &debug - default: false - legend: !legend &legend {} - map: !map &map - maxDpi: 254 - dpiSuggestions: [254] - zoomLevels: !zoomLevels - scales: [100, 250, 500, 2500, 5000, 10000, 25000, 50000, 100000, 500000] - width: 555 - height: 675 - northArrow: !northArrow &northArrow - size: 40 - default: - graphic: "file:///north.svg" - scalebar: !scalebar &scalebar - width: 150 - height: 20 - default: - fontSize: 8 - datasource: !datasource &datasource - attributes: - title: !string {} - table: !table {} + title: !string {} + table: !table {} - processors: &processors - - !reportBuilder # compile all reports in current directory - directory: '.' - - !configureHttpRequests &configureHttpRequests - httpProcessors: - - !mapUri - mapping: - (https?)://${__import__('re').escape(host)}/(.*): "http://127.0.0.1/$2" - - !forwardHeaders - matchers: - - !localMatch {} - headers: - - Cookie - - Host - - !forwardHeaders - headers: - - Referer - - !restrictUris - matchers: - - !localMatch - pathRegex: /${__import__('re').escape(instanceid)}/wsgi/mapserv_proxy - - !localMatch - pathRegex: /${__import__('re').escape(instanceid)}/tiles/.* - - !localMatch - reject: true - - !ipMatch - ip: 10.0.0.0 - mask: 255.0.0.0 - reject: true - - !ipMatch - ip: 172.16.0.0 - mask: 255.240.0.0 - reject: true - - !ipMatch - ip: 192.168.0.0 - mask: 255.255.0.0 - reject: true - - !acceptAll {} - - !prepareLegend - template: legend.jrxml - - !createMap {} - - !createNorthArrow {} - - !createScalebar {} - - !createDataSource - processors: - - !prepareTable - dynamic: true - columns: - icon: !urlImage - urlExtractor: (.*) - urlGroup: 1 + processors: &processors + - !reportBuilder # compile all reports in current directory + directory: '.' + - !configureHttpRequests &configureHttpRequests + httpProcessors: + - !mapUri + mapping: + (https?)://${__import__('re').escape(host)}/(.*): "http://127.0.0.1/$2" + - !forwardHeaders + matchers: + - !localMatch {} + headers: + - Cookie + - Host + - !forwardHeaders + headers: + - Referer + - !restrictUris + matchers: + - !localMatch + pathRegex: /${__import__('re').escape(instanceid)}/wsgi/mapserv_proxy + - !localMatch + pathRegex: /${__import__('re').escape(instanceid)}/tiles/.* + - !localMatch + reject: true + - !ipMatch + ip: 10.0.0.0 + mask: 255.0.0.0 + reject: true + - !ipMatch + ip: 172.16.0.0 + mask: 255.240.0.0 + reject: true + - !ipMatch + ip: 192.168.0.0 + mask: 255.255.0.0 + reject: true + - !acceptAll {} + - !prepareLegend + template: legend.jrxml + - !createMap {} + - !createNorthArrow {} + - !createScalebar {} + - !createDataSource + processors: + - !prepareTable + dynamic: true + columns: + icon: !urlImage + urlExtractor: (.*) + urlGroup: 1 - 2 A4 landscape: !template - reportTemplate: A4_Landscape.jrxml - attributes: - title: *title - comments: *comments - debug: *debug - legend: *legend - map: !map - <<: *map - width: 800 - height: 441 - northArrow: *northArrow - scalebar: *scalebar - datasource: *datasource - processors: *processors + 2 A4 landscape: !template + reportTemplate: A4_Landscape.jrxml + attributes: + title: *title + comments: *comments + debug: *debug + legend: *legend + map: !map + <<: *map + width: 800 + height: 441 + northArrow: *northArrow + scalebar: *scalebar + datasource: *datasource + processors: *processors - 3 A3 portrait: !template - reportTemplate: A3_Portrait.jrxml - attributes: - title: *title - comments: *comments - debug: *debug - legend: *legend - map: !map - <<: *map - width: 800 - height: 1000 - northArrow: *northArrow - scalebar: *scalebar - datasource: *datasource - processors: *processors + 3 A3 portrait: !template + reportTemplate: A3_Portrait.jrxml + attributes: + title: *title + comments: *comments + debug: *debug + legend: *legend + map: !map + <<: *map + width: 800 + height: 1000 + northArrow: *northArrow + scalebar: *scalebar + datasource: *datasource + processors: *processors - 4 A3 landscape: !template - reportTemplate: A3_Landscape.jrxml - attributes: - title: *title - comments: *comments - debug: *debug - legend: *legend - map: !map - <<: *map - width: 1150 - height: 673 - northArrow: *northArrow - scalebar: *scalebar - datasource: *datasource - processors: *processors + 4 A3 landscape: !template + reportTemplate: A3_Landscape.jrxml + attributes: + title: *title + comments: *comments + debug: *debug + legend: *legend + map: !map + <<: *map + width: 1150 + height: 673 + northArrow: *northArrow + scalebar: *scalebar + datasource: *datasource + processors: *processors diff --git a/geoportal/c2cgeoportal_geoportal/scaffolds/nondockercreate/project.yaml.mako_tmpl b/geoportal/c2cgeoportal_geoportal/scaffolds/nondockercreate/project.yaml.mako_tmpl index 9fc66dd09b..ac251691fe 100644 --- a/geoportal/c2cgeoportal_geoportal/scaffolds/nondockercreate/project.yaml.mako_tmpl +++ b/geoportal/c2cgeoportal_geoportal/scaffolds/nondockercreate/project.yaml.mako_tmpl @@ -1,10 +1,11 @@ +--- project_folder: {{project}} project_package: ${package} host: ${host} checker_path: /c2c/health_check? managed_files: [] template_vars: - package: {{package}} - srid: {{srid}} - extent: {{extent}} - apache_vhost: {{apache_vhost}} + package: {{package}} + srid: {{srid}} + extent: {{extent}} + apache_vhost: {{apache_vhost}} diff --git a/geoportal/c2cgeoportal_geoportal/scaffolds/nondockercreate/vars_nondocker.yaml_tmpl b/geoportal/c2cgeoportal_geoportal/scaffolds/nondockercreate/vars_nondocker.yaml_tmpl index f6fc0bd809..f03ff90cec 100644 --- a/geoportal/c2cgeoportal_geoportal/scaffolds/nondockercreate/vars_nondocker.yaml_tmpl +++ b/geoportal/c2cgeoportal_geoportal/scaffolds/nondockercreate/vars_nondocker.yaml_tmpl @@ -1,44 +1,46 @@ +--- + extends: vars.yaml vars: - instanceid: '{instance}' - apache_entry_point: '{entry_point}' - modwsgi_user: MODWSGI_USER - dbhost: DOCKER_HOST_ - dbhost_slave: DOCKER_HOST_ - mapserv_allow: | - Allow from 127.0.0.1 ::1 - Require ip 127.0.0.1 ::1 - waitress_port: 5000 - node_modules_path: "{directory}{ps}node_modules" - tinyowsproxy: - tinyows_url: http://localhost/{instanceid}/tinyows + instanceid: '{instance}' + apache_entry_point: '{entry_point}' + modwsgi_user: MODWSGI_USER + dbhost: DOCKER_HOST_ + dbhost_slave: DOCKER_HOST_ + mapserv_allow: | + Allow from 127.0.0.1 ::1 + Require ip 127.0.0.1 ::1 + waitress_port: 5000 + node_modules_path: "{directory}{ps}node_modules" + tinyowsproxy: + tinyows_url: http://localhost/{instanceid}/tinyows + print_url: http://localhost:8080/print-{instanceid}/print/{package} + pdfreport: print_url: http://localhost:8080/print-{instanceid}/print/{package} - pdfreport: - print_url: http://localhost:8080/print-{instanceid}/print/{package} - servers: - internal: http://localhost/{instanceid}/ - local: '{web_protocol}://{host}/{instanceid}/' - mapserver: http://localhost/{instanceid}/mapserv - tiles_url: + servers: + internal: http://localhost/{instanceid}/ + local: '{web_protocol}://{host}/{instanceid}/' + mapserver: http://localhost/{instanceid}/mapserv + tiles_url: - '{web_protocol}:://a.tiles.{host}/{instanceid}/tiles' - '{web_protocol}:://b.tiles.{host}/{instanceid}/tiles' - '{web_protocol}:://c.tiles.{host}/{instanceid}/tiles' - checker: - phantomjs: - routes: [] + checker: + phantomjs: + routes: [] - deploy: - code_source: /var/www/c2cgeoportal_mapfish/private/c2cgeoportal - code_destination: /var/www/c2cgeoportal_mapfish/private/c2cgeoportal + deploy: + code_source: /var/www/c2cgeoportal_mapfish/private/c2cgeoportal + code_destination: /var/www/c2cgeoportal_mapfish/private/c2cgeoportal update_paths: -- checker.phantomjs -- check_collector + - checker.phantomjs + - check_collector interpreted: - environment: + environment: - modwsgi_user - dbhost - dbhost_slave diff --git a/geoportal/c2cgeoportal_geoportal/scaffolds/nondockerupdate/+dot+upgrade.yaml_tmpl b/geoportal/c2cgeoportal_geoportal/scaffolds/nondockerupdate/+dot+upgrade.yaml_tmpl index 3265585675..14d7bc88ea 100644 --- a/geoportal/c2cgeoportal_geoportal/scaffolds/nondockerupdate/+dot+upgrade.yaml_tmpl +++ b/geoportal/c2cgeoportal_geoportal/scaffolds/nondockerupdate/+dot+upgrade.yaml_tmpl @@ -1,111 +1,113 @@ +--- + default_project_file: -- {{package}}_geoportal/templates/.* -- {{package}}_geoportal/locale/.* -- {{package}}_geoportal/static/.* -- {{package}}_geoportal/static-ngeo/.* -- print/print-apps/.* -- mapserver/.* -- project.yaml.mako -- setup.py -- vars.yaml -- {{package}}.mk + - {{package}}_geoportal/templates/.* + - {{package}}_geoportal/locale/.* + - {{package}}_geoportal/static/.* + - {{package}}_geoportal/static-ngeo/.* + - print/print-apps/.* + - mapserver/.* + - project.yaml.mako + - setup.py + - vars.yaml + - {{package}}.mk files_to_move: -- from: testDB - to: testdb - version: 2.3 -- from: testdb/Dockerfile.mako - to: testdb/Dockerfile - version: 2.3 -- from: vars_{{package}}.yaml - to: vars.yaml - version: 2.3 -- from: Dockerfile - to: geoportal/Dockerfile.mako - version: 2.3 -- from: docker-compose.yml.mako - to: docker-compose.yaml.mako - version: 2.3 -- from: CONST_print_url - to: print_url - version: 2.3 -- from: alembic.ini.mako - to: geoportal/alembic.ini.mako - version: 2.3 -- from: alembic_static.ini.mako - to: geoportal/alembic_static.ini.mako - version: 2.3 -- from: .dockerignore - to: geoportal/.dockerignore - version: 2.3 -- from: jsbuild - to: geoportal/jsbuild - version: 2.3 -- from: production.ini.mako - to: geoportal/production.ini.mako - version: 2.3 -- from: development.ini.mako - to: geoportal/development.ini.mako - version: 2.3 -- from: setup.py - to: geoportal/setup.py - version: 2.3 -- from: testgeomapfish/models.py - to: commons/testgeomapfish_commons/models.py - version: 2.3 -- from: testgeomapfish - to: geoportal/testgeomapfish_geoportal - version: 2.3 + - from: testDB + to: testdb + version: 2.3 + - from: testdb/Dockerfile.mako + to: testdb/Dockerfile + version: 2.3 + - from: vars_{{package}}.yaml + to: vars.yaml + version: 2.3 + - from: Dockerfile + to: geoportal/Dockerfile.mako + version: 2.3 + - from: docker-compose.yml.mako + to: docker-compose.yaml.mako + version: 2.3 + - from: CONST_print_url + to: print_url + version: 2.3 + - from: alembic.ini.mako + to: geoportal/alembic.ini.mako + version: 2.3 + - from: alembic_static.ini.mako + to: geoportal/alembic_static.ini.mako + version: 2.3 + - from: .dockerignore + to: geoportal/.dockerignore + version: 2.3 + - from: jsbuild + to: geoportal/jsbuild + version: 2.3 + - from: production.ini.mako + to: geoportal/production.ini.mako + version: 2.3 + - from: development.ini.mako + to: geoportal/development.ini.mako + version: 2.3 + - from: setup.py + to: geoportal/setup.py + version: 2.3 + - from: testgeomapfish/models.py + to: commons/testgeomapfish_commons/models.py + version: 2.3 + - from: testgeomapfish + to: geoportal/testgeomapfish_geoportal + version: 2.3 files_to_remove: -- file: .build - version: 2.3 - from: 2.2 -- file: .tx - version: 2.3 - from: 2.2 -- file: {{package}}/forms.py - version: 2.3 - from: 2.2 -- file: apache - version: 2.3 - from: 2.2 -- file: deploy - version: 2.3 - from: 2.2 -- file: travis.mk - version: 2.3 - from: 2.2 -- file: .whiskey - version: 2.3 - from: 2.2 -- file: CONST_dev-fixversions.txt - version: 2.3 - from: 2.2 -- file: CONST_dev-requirements.txt - version: 2.3 - from: 2.2 -- file: CONST_fixversions.txt - version: 2.3 - from: 2.2 -- file: CONST_optional-requirements.txt - version: 2.3 - from: 2.2 -- file: CONST_packages.yaml - version: 2.3 - from: 2.2 -- file: CONST_requirements.txt - version: 2.3 - from: 2.2 -- file: CONST_requirements_windows.txt - version: 2.3 - from: 2.2 -- file: CONST_versions_requirements.txt - version: 2.3 - from: 2.2 -- file: package.json - version: 2.3 - from: 2.2 -- file: testgeomapfish.egg-info - version: 2.3 - from: 2.2 + - file: .build + version: 2.3 + from: 2.2 + - file: .tx + version: 2.3 + from: 2.2 + - file: {{package}}/forms.py + version: 2.3 + from: 2.2 + - file: apache + version: 2.3 + from: 2.2 + - file: deploy + version: 2.3 + from: 2.2 + - file: travis.mk + version: 2.3 + from: 2.2 + - file: .whiskey + version: 2.3 + from: 2.2 + - file: CONST_dev-fixversions.txt + version: 2.3 + from: 2.2 + - file: CONST_dev-requirements.txt + version: 2.3 + from: 2.2 + - file: CONST_fixversions.txt + version: 2.3 + from: 2.2 + - file: CONST_optional-requirements.txt + version: 2.3 + from: 2.2 + - file: CONST_packages.yaml + version: 2.3 + from: 2.2 + - file: CONST_requirements.txt + version: 2.3 + from: 2.2 + - file: CONST_requirements_windows.txt + version: 2.3 + from: 2.2 + - file: CONST_versions_requirements.txt + version: 2.3 + from: 2.2 + - file: package.json + version: 2.3 + from: 2.2 + - file: testgeomapfish.egg-info + version: 2.3 + from: 2.2 diff --git a/geoportal/c2cgeoportal_geoportal/scaffolds/update/+dot+upgrade.yaml_tmpl b/geoportal/c2cgeoportal_geoportal/scaffolds/update/+dot+upgrade.yaml_tmpl index 06df5e5672..eff233a5b7 100644 --- a/geoportal/c2cgeoportal_geoportal/scaffolds/update/+dot+upgrade.yaml_tmpl +++ b/geoportal/c2cgeoportal_geoportal/scaffolds/update/+dot+upgrade.yaml_tmpl @@ -1,144 +1,146 @@ +--- + default_project_file: -- {{package}}/templates/.* -- {{package}}/locale/.* -- {{package}}/static/.* -- {{package}}/static-ngeo/.* -- print/print-apps/.* -- mapserver/.* -- project.yaml.mako -- setup.py -- vars.yaml -- Makefile + - {{package}}/templates/.* + - {{package}}/locale/.* + - {{package}}/static/.* + - {{package}}/static-ngeo/.* + - print/print-apps/.* + - mapserver/.* + - project.yaml.mako + - setup.py + - vars.yaml + - Makefile files_to_move: -- from: testDB - to: testdb - version: 2.3 -- from: testdb/Dockerfile.mako - to: testdb/Dockerfile - version: 2.3 -- from: vars_{{package}}.yaml - to: vars.yaml - version: 2.3 -- from: {{package}}.mk - to: Makefile - version: 2.3 -- from: Dockerfile - to: geoportal/Dockerfile.mako - version: 2.3 -- from: docker-compose.yml.mako - to: docker-compose.yaml.mako - version: 2.3 -- from: alembic.ini.mako - to: geoportal/alembic.ini.mako - version: 2.3 -- from: alembic_static.ini.mako - to: geoportal/alembic_static.ini.mako - version: 2.3 -- from: .dockerignore - to: geoportal/.dockerignore - version: 2.3 -- from: jsbuild - to: geoportal/jsbuild - version: 2.3 -- from: production.ini.mako - to: geoportal/production.ini.mako - version: 2.3 -- from: setup.py - to: geoportal/setup.py - version: 2.3 -- from: testgeomapfish/models.py - to: commons/testgeomapfish_commons/models.py - version: 2.3 -- from: testgeomapfish - to: geoportal/testgeomapfish_geoportal - version: 2.3 + - from: testDB + to: testdb + version: 2.3 + - from: testdb/Dockerfile.mako + to: testdb/Dockerfile + version: 2.3 + - from: vars_{{package}}.yaml + to: vars.yaml + version: 2.3 + - from: {{package}}.mk + to: Makefile + version: 2.3 + - from: Dockerfile + to: geoportal/Dockerfile.mako + version: 2.3 + - from: docker-compose.yml.mako + to: docker-compose.yaml.mako + version: 2.3 + - from: alembic.ini.mako + to: geoportal/alembic.ini.mako + version: 2.3 + - from: alembic_static.ini.mako + to: geoportal/alembic_static.ini.mako + version: 2.3 + - from: .dockerignore + to: geoportal/.dockerignore + version: 2.3 + - from: jsbuild + to: geoportal/jsbuild + version: 2.3 + - from: production.ini.mako + to: geoportal/production.ini.mako + version: 2.3 + - from: setup.py + to: geoportal/setup.py + version: 2.3 + - from: testgeomapfish/models.py + to: commons/testgeomapfish_commons/models.py + version: 2.3 + - from: testgeomapfish + to: geoportal/testgeomapfish_geoportal + version: 2.3 files_to_remove: -- file: .build - version: 2.3 - from: 2.2 -- file: .tx - version: 2.3 - from: 2.2 -- file: {{package}}/forms.py - version: 2.3 - from: 2.2 -- file: apache - version: 2.3 - from: 2.2 -- file: deploy - version: 2.3 - from: 2.2 -- file: travis.mk - version: 2.3 - from: 2.2 -- file: .whiskey - version: 2.3 - from: 2.2 -- file: CONST_dev-fixversions.txt - version: 2.3 - from: 2.2 -- file: CONST_dev-requirements.txt - version: 2.3 - from: 2.2 -- file: CONST_fixversions.txt - version: 2.3 - from: 2.2 -- file: CONST_optional-requirements.txt - version: 2.3 - from: 2.2 -- file: CONST_packages.yaml - version: 2.3 - from: 2.2 -- file: CONST_print_url - version: 2.3 - from: 2.2 -- file: print_url - version: 2.3 - from: nondocker -- file: CONST_requirements.txt - version: 2.3 - from: 2.2 -- file: CONST_requirements_windows.txt - version: 2.3 - from: 2.2 -- file: CONST_versions_requirements.txt - version: 2.3 - from: 2.2 -- file: package.json - version: 2.3 - from: 2.2 -- file: print/WEB-INF - version: 2.3 - from: 2.2, nondocker -- file: get-pip-dependencies - version: 2.3 - from: nondocker -- file: nondocker.mk - version: 2.3 - from: nondocker -- file: nondocker-override.mk - version: 2.3 - from: nondocker -- file: requirements_windows.txt - version: 2.3 - from: nondocker -- file: vars_nondocker.yaml - version: 2.3 - from: nondocker -- file: CONST_nondocker_CHANGELOG.txt - version: 2.3 - from: nondocker -- file: vars_nondocker.mk - version: 2.3 - from: nondocker -- file: vars_nondocker-override.mk - version: 2.3 - from: nondocker -- file: development.ini.mako - version: 2.3 - from: nondocker -- file: testgeomapfish.egg-info - version: 2.3 - from: 2.2 + - file: .build + version: 2.3 + from: 2.2 + - file: .tx + version: 2.3 + from: 2.2 + - file: {{package}}/forms.py + version: 2.3 + from: 2.2 + - file: apache + version: 2.3 + from: 2.2 + - file: deploy + version: 2.3 + from: 2.2 + - file: travis.mk + version: 2.3 + from: 2.2 + - file: .whiskey + version: 2.3 + from: 2.2 + - file: CONST_dev-fixversions.txt + version: 2.3 + from: 2.2 + - file: CONST_dev-requirements.txt + version: 2.3 + from: 2.2 + - file: CONST_fixversions.txt + version: 2.3 + from: 2.2 + - file: CONST_optional-requirements.txt + version: 2.3 + from: 2.2 + - file: CONST_packages.yaml + version: 2.3 + from: 2.2 + - file: CONST_print_url + version: 2.3 + from: 2.2 + - file: print_url + version: 2.3 + from: nondocker + - file: CONST_requirements.txt + version: 2.3 + from: 2.2 + - file: CONST_requirements_windows.txt + version: 2.3 + from: 2.2 + - file: CONST_versions_requirements.txt + version: 2.3 + from: 2.2 + - file: package.json + version: 2.3 + from: 2.2 + - file: print/WEB-INF + version: 2.3 + from: 2.2, nondocker + - file: get-pip-dependencies + version: 2.3 + from: nondocker + - file: nondocker.mk + version: 2.3 + from: nondocker + - file: nondocker-override.mk + version: 2.3 + from: nondocker + - file: requirements_windows.txt + version: 2.3 + from: nondocker + - file: vars_nondocker.yaml + version: 2.3 + from: nondocker + - file: CONST_nondocker_CHANGELOG.txt + version: 2.3 + from: nondocker + - file: vars_nondocker.mk + version: 2.3 + from: nondocker + - file: vars_nondocker-override.mk + version: 2.3 + from: nondocker + - file: development.ini.mako + version: 2.3 + from: nondocker + - file: testgeomapfish.egg-info + version: 2.3 + from: 2.2 diff --git a/geoportal/c2cgeoportal_geoportal/scaffolds/update/CONST_Makefile_tmpl b/geoportal/c2cgeoportal_geoportal/scaffolds/update/CONST_Makefile_tmpl index 21475e8d82..0e0ec1e27a 100644 --- a/geoportal/c2cgeoportal_geoportal/scaffolds/update/CONST_Makefile_tmpl +++ b/geoportal/c2cgeoportal_geoportal/scaffolds/update/CONST_Makefile_tmpl @@ -365,12 +365,18 @@ endif build: $(BUILD_RULES) .PHONY: checks -checks: flake8 $(CLIENT_CHECK_RULE) $(NGEO_OUTPUT_JS_INTERFACES_FILES) $(NGEO_OUTPUT_CSS_INTERFACES_FILES) git-attributes +checks: flake8 $(CLIENT_CHECK_RULE) $(NGEO_OUTPUT_JS_INTERFACES_FILES) $(NGEO_OUTPUT_CSS_INTERFACES_FILES) \ + git-attributes yamllint .PHONY: git-attributes git-attributes: git --no-pager diff --check `git log --oneline | tail -1 | cut --fields=1 --delimiter=' '` +YAML_FILES ?= $(filter-out ./tilegeneration/config.yaml ./geoportal/config.yaml,$(shell find -name .build -prune -or -name cgxp -prune -or \( -name "*.yml" -or -name "*.yaml" \) -print)) +.PHONY: yamllint +yamllint: $(YAML_FILES) + yamllint --strict --config-file=yamllint.yaml -s $(YAML_FILES) + .PHONY: clean clean: template-clean rm -f /build/*.timestamp diff --git a/geoportal/c2cgeoportal_geoportal/scaffolds/update/CONST_config-schema.yaml b/geoportal/c2cgeoportal_geoportal/scaffolds/update/CONST_config-schema.yaml index c5fba36f9e..8b83c5ed64 100644 --- a/geoportal/c2cgeoportal_geoportal/scaffolds/update/CONST_config-schema.yaml +++ b/geoportal/c2cgeoportal_geoportal/scaffolds/update/CONST_config-schema.yaml @@ -1,461 +1,462 @@ +--- type: map mapping: - environment: - type: seq + environment: + type: seq + required: True + sequence: + - type: str + vars: + type: map + required: True + mapping: + package: + type: str required: True - sequence: - - type: str - vars: + enable_admin_interface: + type: bool + required: True + ogcproxy_enable: + type: bool + required: True + sqlalchemy.url: + type: str + required: True + sqlalchemy_slave.url: + type: str + required: True + default_max_age: + type: int + required: True + srid: + type: int + required: True + schema: + type: str + required: True + + dbsessions: type: map required: True mapping: - package: + regex;([a-z0-9-]+): + type: map + mapping: + url: type: str - required: True - enable_admin_interface: - type: bool - required: True - ogcproxy_enable: - type: bool - required: True - sqlalchemy.url: - type: str - required: True - sqlalchemy_slave.url: - type: str - required: True - default_max_age: - type: int - required: True - srid: - type: int - required: True - schema: - type: str - required: True - - dbsessions: - type: map - required: True - mapping: - regex;([a-z0-9-]+): - type: map - mapping: - url: - type: str - required: true + required: true - jsbuild: - type: map - mapping: - config: - type: str - required: True - root_dir: - type: str - required: True - closure_library_path: - type: str - required: True - node_modules_path: - type: str - required: True - pyramid_closure: - type: map - required: True - mapping: - roots_with_prefix: - type: seq - required: True - sequence: - - type: seq - sequence: - - type: str - default_locale_name: - type: str - pattern: '[a-z][a-z]' - required: True - available_locale_names: - type: seq - required: True + jsbuild: + type: map + mapping: + config: + type: str + required: True + root_dir: + type: str + required: True + closure_library_path: + type: str + required: True + node_modules_path: + type: str + required: True + pyramid_closure: + type: map + required: True + mapping: + roots_with_prefix: + type: seq + required: True + sequence: + - type: seq sequence: - - type: str - pattern: '[a-z][a-z]' - authorized_referers: + - type: str + default_locale_name: + type: str + pattern: '[a-z][a-z]' + required: True + available_locale_names: + type: seq + required: True + sequence: + - type: str + pattern: '[a-z][a-z]' + authorized_referers: + type: seq + sequence: + - type: str + headers: + type: map + required: True + mapping: + login: &header + type: map + required: True + mapping: + access_control_allow_origin: type: seq sequence: - - type: str - headers: - type: map + - type: str + access_control_max_age: required: True - mapping: - login: &header - type: map - required: True - mapping: - access_control_allow_origin: - type: seq - sequence: - - type: str - access_control_max_age: - required: True - type: int - index: *header - config: *header - api: *header - themes: *header - fulltextsearch: *header - mapserver: *header - tinyows: *header - layers: *header - print: *header - profile: *header - raster: *header - shortener: *header - echo: *header - csvecho: *header - exportgpxkml: *header - error: *header + type: int + index: *header + config: *header + api: *header + themes: *header + fulltextsearch: *header + mapserver: *header + tinyows: *header + layers: *header + print: *header + profile: *header + raster: *header + shortener: *header + echo: *header + csvecho: *header + exportgpxkml: *header + error: *header - urllogin: - type: map - required: True - mapping: - aes_key: - type: str + urllogin: + type: map + required: True + mapping: + aes_key: + type: str - cache: - type: map - required: True + cache: + type: map + required: True + mapping: + backend: + required: True + type: str + admin_interface: + type: map + required: True + mapping: + map_x: + type: int + required: True + map_y: + type: int + required: True + map_zoom: + type: int + required: True + available_metadata: + type: seq + required: True + sequence: &types + - type: map mapping: - backend: - required: True - type: str - admin_interface: + name: + type: str + required: True + type: + type: str + available_functionalities: + type: seq + required: True + sequence: + - type: str + layers: + type: map + required: True + mapping: + geometry_validation: + type: bool + required: True + enum: + type: map + mapping: + defaults: &free_dict type: map - required: True mapping: - map_x: - type: int - required: True - map_y: - type: int - required: True - map_zoom: - type: int - required: True - available_metadata: - type: seq - required: True - sequence: &types - - type: map - mapping: - name: - type: str - required: True - type: - type: str - available_functionalities: - type: seq - required: True - sequence: - - type: str - layers: + regex;(.+): + type: any + regex;(.+): type: map - required: True mapping: - geometry_validation: - type: bool - required: True - enum: + defaults: *free_dict + dbsession: + type: str + attributes: + type: map + required: True + mapping: + regex;(.+): type: map mapping: - defaults: &free_dict - type: map - mapping: - regex;(.+): - type: any - regex;(.+): - type: map - mapping: - defaults: *free_dict - dbsession: - type: str - attributes: - type: map - required: True - mapping: - regex;(.+): - type: map - mapping: - table: - type: str - required: True - column_name: - type: str - separator: - type: str - functionalities: + table: + type: str + required: True + column_name: + type: str + separator: + type: str + functionalities: + type: map + required: True + mapping: + anonymous: + <<: *free_dict + required: True + registered: + <<: *free_dict + required: True + available_in_templates: + type: seq + required: True + sequence: + - type: str + mapserverproxy: + type: map + required: True + mapping: + default_ogc_server: + type: str + required: True + default_external_ogc_server: + type: str + tinyowsproxy: + type: map + required: True + mapping: + tinyows_url: + type: str + required: True + proxy_online_resource: + type: str + online_resource: + type: str + tinyows_host: + type: str + fulltextsearch: + type: map + required: True + mapping: + defaultlimit: + type: int + required: True + maxlimit: + type: int + required: True + languages: + type: map + required: True + mapping: + regex;([a-z][a-z]): + type: str + reset_password: + type: map + required: True + mapping: + email_from: + type: str + email_body: + type: str + email_subject: + type: str + smtp_server: + type: str + servers: + <<: *free_dict + required: True + host_forward_host: + type: seq + sequence: + - type: str + raster: + <<: *free_dict + required: True + shortener: + type: map + required: True + mapping: + base_url: + type: str + required: True + allowed_hosts: + type: seq + sequence: + - type: str + email_from: + type: str + email_subject: + type: str + email_body: + type: str + smtp_server: + type: str + length: + type: int + hide_capabilities: + type: bool + required: True + print_url: + type: str + required: True + pdfreport: + type: map + mapping: + print_url: + type: str + layer-defaults: *free_dict + map-defaults: *free_dict + layers: + type: map + mapping: + regex;(.+): type: map - required: True mapping: - anonymous: - <<: *free_dict - required: True - registered: - <<: *free_dict - required: True - available_in_templates: + check_credentials: + type: bool + required: True + srs: + type: int + required: True + spec: + type: any + map: &map + type: map + mapping: + backgroundlayers: type: seq required: True sequence: - - type: str - mapserverproxy: - type: map - required: True - mapping: - default_ogc_server: - type: str - required: True - default_external_ogc_server: - type: str - tinyowsproxy: - type: map - required: True - mapping: - tinyows_url: + - type: str + imageformat: type: str required: True - proxy_online_resource: - type: str - online_resource: + pattern: '[a-z]+/[a-z]+' + zoomType: type: str - tinyows_host: - type: str - fulltextsearch: - type: map - required: True - mapping: - defaultlimit: - type: int required: True - maxlimit: + minScale: type: int required: True - languages: - type: map + style: + type: any required: True - mapping: - regex;([a-z][a-z]): - type: str - reset_password: - type: map + maps: + type: seq + sequence: + - *map + subdomain_url_template: + type: str + subdomains: + type: seq + sequence: + - type: str + checker: + type: map + required: True + mapping: + fulltextsearch: + type: map + required: True + mapping: + level: + type: int required: True - mapping: - email_from: - type: str - email_body: - type: str - email_subject: - type: str - smtp_server: - type: str - servers: - <<: *free_dict + search: + type: str required: True - host_forward_host: + lang: + type: map + required: True + mapping: + level: + type: int + required: True + files: type: seq - sequence: - - type: str - raster: - <<: *free_dict required: True - shortener: - type: map + sequence: + - type: str + print: + type: map + required: True + mapping: + level: + type: int required: True - mapping: - base_url: - type: str - required: True - allowed_hosts: - type: seq - sequence: - - type: str - email_from: - type: str - email_subject: - type: str - email_body: - type: str - smtp_server: - type: str - length: - type: int - hide_capabilities: - type: bool + spec: + type: any required: True - print_url: - type: str + routes: &routes + type: map + required: True + mapping: + disable: + type: seq required: True - pdfreport: - type: map - mapping: - print_url: - type: str - layer-defaults: *free_dict - map-defaults: *free_dict - layers: - type: map - mapping: - regex;(.+): - type: map - mapping: - check_credentials: - type: bool - required: True - srs: - type: int - required: True - spec: - type: any - map: &map - type: map - mapping: - backgroundlayers: - type: seq - required: True - sequence: - - type: str - imageformat: - type: str - required: True - pattern: '[a-z]+/[a-z]+' - zoomType: - type: str - required: True - minScale: - type: int - required: True - style: - type: any - required: True - maps: - type: seq - sequence: - - *map - subdomain_url_template: - type: str - subdomains: + seq: + - type: str + routes: type: seq - sequence: - - type: str - checker: - type: map required: True - mapping: - fulltextsearch: - type: map - required: True - mapping: - level: - type: int - required: True - search: - type: str - required: True - lang: - type: map - required: True - mapping: - level: - type: int - required: True - files: - type: seq - required: True - sequence: - - type: str - print: - type: map - required: True - mapping: - level: - type: int - required: True - spec: - type: any - required: True - routes: &routes - type: map + seq: + - type: map + mapping: + level: + type: int required: True - mapping: - disable: - type: seq - required: True - seq: - - type: str - routes: - type: seq - required: True - seq: - - type: map - mapping: - level: - type: int - required: True - name: - type: str - required: true - display_name: - type: str - params: ¶ms - type: map - mapping: - regex;([a-zA-Z0-9_\-~\.]+): - type: str - pattern: |- - [a-zA-Z0-9_\-~\.]+ - phantomjs: *routes - themes: + name: + type: str + required: true + display_name: + type: str + params: ¶ms type: map - required: True mapping: - level: - type: int - required: True - params: *params - interfaces: - type: map - mapping: - regex;([a-z]+): - type: map - mapping: - params: *params - regex;(.+): - type: any - check_collector: - type: map + regex;([a-zA-Z0-9_\-~\.]+): + type: str + pattern: |- + [a-zA-Z0-9_\-~\.]+ + phantomjs: *routes + themes: + type: map + required: True + mapping: + level: + type: int required: True + params: *params + interfaces: + type: map mapping: - hosts: - type: seq - required: True - sequence: - - type: map - mapping: - display: - type: str - required: True - url: - type: str - required: True - level: - type: int - max_level: - type: int - required: True - level: - type: int - required: True - regex;(.+): - type: any + regex;([a-z]+): + type: map + mapping: + params: *params + regex;(.+): + type: any + check_collector: + type: map + required: True + mapping: + hosts: + type: seq + required: True + sequence: + - type: map + mapping: + display: + type: str + required: True + url: + type: str + required: True + level: + type: int + max_level: + type: int + required: True + level: + type: int + required: True + regex;(.+): + type: any diff --git a/geoportal/c2cgeoportal_geoportal/scaffolds/update/CONST_vars.yaml_tmpl b/geoportal/c2cgeoportal_geoportal/scaffolds/update/CONST_vars.yaml_tmpl index 5bd6996dfb..0cd5a520f3 100644 --- a/geoportal/c2cgeoportal_geoportal/scaffolds/update/CONST_vars.yaml_tmpl +++ b/geoportal/c2cgeoportal_geoportal/scaffolds/update/CONST_vars.yaml_tmpl @@ -1,447 +1,455 @@ +--- + vars: - # is in developement mode - development: DEVELOPMENT - # the package name - package: {{package}} - geomapfish_version: GEOMAPFISH_VERSION - instance: main - build_volume_name: BUILD_VOLUME_NAME - - srid: -1 - - host: VISIBLE_WEB_HOST - web_protocol: VISIBLE_WEB_PROTOCOL - entry_point: VISIBLE_ENTRY_POINT - - # Docker base image name (comes from the makefile). - docker_base: DOCKER_BASE - docker_tag: DOCKER_TAG - # database user - dbuser: www-data - # database password - dbpassword: www-data - # master database host - dbhost: db - # slave database host - dbhost_slave: db - # database port - dbport: 5432 - # database name - db: override_me - # sqlalchemy schema - schema: main - - dbsessions: {} - - # mapserver connexion string - mapserver_connection: user={dbuser} password={dbpassword} dbname={db} host={dbhost} - # mapserver join tables - mapserver_join_tables: '{schema}.restrictionarea AS ra, {schema}.role_restrictionarea AS rra, {schema}.layer_restrictionarea AS lra, {schema}.treeitem AS la' - # mapserver visible area - mapserver_join_area: ra.area - # mapserver join close - mapserver_join_where: 'rra.role_id = %role_id% AND rra.restrictionarea_id = ra.id AND lra.restrictionarea_id = ra.id AND lra.layer_id = la.id AND la.name = ' - # mapserver metadata for validation - mapserver_layer_metadata: "" - mapserver_layer_validation: | - "default_role_id" "-1" - "role_id" "^-?[0-9]*$" - # mapfile data subselect - mapfile_data_subselect: 'SELECT ST_Collect(ra.area) FROM main.restrictionarea AS ra, main.role_restrictionarea AS rra, main.layer_restrictionarea AS lra, main.treeitem AS la WHERE rra.role_id = %role_id% AND rra.restrictionarea_id = ra.id AND lra.restrictionarea_id = ra.id AND lra.layer_id = la.id AND la.name = ' - # mapserver filter on role id only - mapfile_data_noarea_subselect: 'SELECT rra.role_id FROM {mapserver_join_tables} WHERE rra.restrictionarea_id = ra.id AND lra.restrictionarea_id = ra.id AND lra.layer_id = la.id AND la.name = ' - enable_admin_interface: True - - directory: __import__('os').getcwd() - project_directory: PROJECT_DIRECTORY - python_path: PYTHON_PATH - ps: __import__('os').path.sep - - # Authentication settings - authtkt: - # Cookie session secret - secret: __import__('uuid').uuid4().hex - cookie_name: auth_tkt_{instance} - # Database informations - sqlalchemy: - url: postgresql://{dbuser}:{dbpassword}@{dbhost}:{dbport}/{db} - sqlalchemy_slave: - url: postgresql://{dbuser}:{dbpassword}@{dbhost_slave}:{dbport}/{db} - - # 10 days of default cache - default_max_age: 864000 - - # For debug mode - jsbuild: - config: "{directory}/jsbuild/app.cfg" - root_dir: "{directory}" - - # used for the "node_modules" and "closure" static views - closure_library_path: 'process.stdout.write(require("@camptocamp/closure-util").getLibraryPath())' - node_modules_path: "/usr/lib/node_modules" - - # pyramid_closure configuration - # Each item in the roots_with_prefix array is an array with two elements. The - # first element is the path pyramid_closure passed to request.static_url. The - # second element is the file system path where js source files are searched. - # For this to work window.CLOSURE_BASE_PATH being set to the empty string in - # the HTML page. - pyramid_closure: - roots_with_prefix: - - ["{closure_library_path}/closure/goog", "{closure_library_path}/closure/goog"] - - ["{package}_geoportal:static-ngeo/js", "{directory}/{package}/static-ngeo/js"] - - ["{package}_geoportal:static-ngeo/components", "{directory}/{package}/static-ngeo/components"] - - ["{node_modules_path}{ps}openlayers/src", "{node_modules_path}{ps}openlayers/src"] - - ["{node_modules_path}{ps}openlayers/build", "{node_modules_path}{ps}openlayers/build"] - - ["{node_modules_path}{ps}ngeo/src", "{node_modules_path}{ps}ngeo/src"] - - ["{node_modules_path}{ps}ngeo/contribs/gmf/src", "{node_modules_path}{ps}ngeo/contribs/gmf/src"] - - # The application's default language. This is the language used by - # the application if no specific language is specified in the URLs. - # This also defines the language used for the text search. - default_locale_name: fr - - # The set of languages supported by the applications. - available_locale_names: + # is in developement mode + development: DEVELOPMENT + # the package name + package: {{package}} + geomapfish_version: GEOMAPFISH_VERSION + instance: main + build_volume_name: BUILD_VOLUME_NAME + + srid: -1 + + host: VISIBLE_WEB_HOST + web_protocol: VISIBLE_WEB_PROTOCOL + entry_point: VISIBLE_ENTRY_POINT + + # Docker base image name (comes from the makefile). + docker_base: DOCKER_BASE + docker_tag: DOCKER_TAG + # database user + dbuser: www-data + # database password + dbpassword: www-data + # master database host + dbhost: db + # slave database host + dbhost_slave: db + # database port + dbport: 5432 + # database name + db: override_me + # sqlalchemy schema + schema: main + + dbsessions: {} + + # mapserver connexion string + mapserver_connection: user={dbuser} password={dbpassword} dbname={db} host={dbhost} + # mapserver join tables + mapserver_join_tables: "{schema}.restrictionarea AS ra, {schema}.role_restrictionarea AS rra, \ + {schema}.layer_restrictionarea AS lra, {schema}.treeitem AS la" + # mapserver visible area + mapserver_join_area: ra.area + # mapserver join close + mapserver_join_where: "rra.role_id = %role_id% AND rra.restrictionarea_id = ra.id AND \ + lra.restrictionarea_id = ra.id AND lra.layer_id = la.id AND la.name = " + # mapserver metadata for validation + mapserver_layer_metadata: "" + mapserver_layer_validation: | + "default_role_id" "-1" + "role_id" "^-?[0-9]*$" + # mapfile data subselect + mapfile_data_subselect: "SELECT ST_Collect(ra.area) FROM main.restrictionarea AS ra, \ + main.role_restrictionarea AS rra, main.layer_restrictionarea AS lra, main.treeitem AS la \ + WHERE rra.role_id = %role_id% AND rra.restrictionarea_id = ra.id AND lra.restrictionarea_id = ra.id \ + AND lra.layer_id = la.id AND la.name = " + # mapserver filter on role id only + mapfile_data_noarea_subselect: "SELECT rra.role_id FROM {mapserver_join_tables} \ + WHERE rra.restrictionarea_id = ra.id AND lra.restrictionarea_id = ra.id \ + AND lra.layer_id = la.id AND la.name = " + enable_admin_interface: True + + directory: __import__('os').getcwd() + project_directory: PROJECT_DIRECTORY + python_path: PYTHON_PATH + ps: __import__('os').path.sep + + # Authentication settings + authtkt: + # Cookie session secret + secret: __import__('uuid').uuid4().hex + cookie_name: auth_tkt_{instance} + # Database informations + sqlalchemy: + url: postgresql://{dbuser}:{dbpassword}@{dbhost}:{dbport}/{db} + sqlalchemy_slave: + url: postgresql://{dbuser}:{dbpassword}@{dbhost_slave}:{dbport}/{db} + + # 10 days of default cache + default_max_age: 864000 + + # For debug mode + jsbuild: + config: "{directory}/jsbuild/app.cfg" + root_dir: "{directory}" + + # used for the "node_modules" and "closure" static views + closure_library_path: 'process.stdout.write(require("@camptocamp/closure-util").getLibraryPath())' + node_modules_path: "/usr/lib/node_modules" + + # pyramid_closure configuration + # Each item in the roots_with_prefix array is an array with two elements. The + # first element is the path pyramid_closure passed to request.static_url. The + # second element is the file system path where js source files are searched. + # For this to work window.CLOSURE_BASE_PATH being set to the empty string in + # the HTML page. + pyramid_closure: + roots_with_prefix: + - ["{closure_library_path}/closure/goog", "{closure_library_path}/closure/goog"] + - ["{package}_geoportal:static-ngeo/js", "{directory}/{package}/static-ngeo/js"] + - ["{package}_geoportal:static-ngeo/components", "{directory}/{package}/static-ngeo/components"] + - ["{node_modules_path}{ps}openlayers/src", "{node_modules_path}{ps}openlayers/src"] + - ["{node_modules_path}{ps}openlayers/build", "{node_modules_path}{ps}openlayers/build"] + - ["{node_modules_path}{ps}ngeo/src", "{node_modules_path}{ps}ngeo/src"] + - ["{node_modules_path}{ps}ngeo/contribs/gmf/src", "{node_modules_path}{ps}ngeo/contribs/gmf/src"] + + # The application's default language. This is the language used by + # the application if no specific language is specified in the URLs. + # This also defines the language used for the text search. + default_locale_name: fr + + # The set of languages supported by the applications. + available_locale_names: - en - fr - de - # All the application interfaces used to create the apache rewrite rules - interfaces: __import__('os').environ.get("INTERFACES").split(" ") - - default_interface: desktop - - # The dogpile.cache configuration. - # - # Do not touch if unsure. - # - # The cache section below takes three properties: - # - # - backend: the name of the cache backend (ex: dogpile.cache.memory, - # dogpile.cache.memcached, etc.). Mandatory. - # - expiration_time: the cache expiration time. Optional (infinite if not - # specified). - # - arguments: backend-specific arguments. Optional. - # - # Here is a dogpile.cache configuration example for the memcached backend - # (equivalent of http://dogpilecache.readthedocs.org/en/latest/api.html#dogpile.cache.backends.memcached.MemcachedBackend) - # cache: - # backend: dogpile.cache.memcached - # expiration_time: 3600 - # arguments: - # url: 127.0.0.1:11211 - cache: - backend: dogpile.cache.memory - - admin_interface: + # All the application interfaces used to create the apache rewrite rules + interfaces: __import__('os').environ.get("INTERFACES").split(" ") + + default_interface: desktop + + # The dogpile.cache configuration. + # + # Do not touch if unsure. + # + # The cache section below takes three properties: + # + # - backend: the name of the cache backend (ex: dogpile.cache.memory, + # dogpile.cache.memcached, etc.). Mandatory. + # - expiration_time: the cache expiration time. Optional (infinite if not + # specified). + # - arguments: backend-specific arguments. Optional. + # + # Here is a dogpile.cache configuration example for the memcached backend + # (equivalent of + # http://dogpilecache.readthedocs.org/en/latest/api.html#dogpile.cache.backends.memcached.MemcachedBackend) + # cache: + # backend: dogpile.cache.memcached + # expiration_time: 3600 + # arguments: + # url: 127.0.0.1:11211 + cache: + backend: dogpile.cache.memory + + admin_interface: # Default values for the admin interface's maps. - map_x: 740000 - map_y: 5860000 - map_zoom: 10 + map_x: 740000 + map_y: 5860000 + map_zoom: 10 # The list of available variable names for the `Metadatas` form. - available_metadata: - # Layers group - - name: isExpanded - type: boolean - # Layer - - name: copyTo # V1 - - name: copyable - type: boolean - - name: legend - type: boolean - - name: isLegendExpanded - type: boolean - - name: legendRule - - name: legendImage - type: url - - name: iconUrl - type: url - - name: metadataUrl - type: url - - name: disclaimer - - name: isChecked - type: boolean - - name: identifierAttributeField - - name: maxResolution - type: float - - name: minResolution - type: float - - name: opacity - type: float - - name: thumbnail - type: url - - name: timeAttribute - - name: lastUpdateDateColumn - - name: lastUpdateUserColumn - - name: snappingConfig - type: json - - name: geometryValidation # V1 - type: boolean - - name: excludeProperties # not yet used - # WMS - - name: directedFilterAttributes - type: list - - name: enumeratedAttributes - type: list - # WMTS layers - - name: ogcServer - - name: wmsLayers - - name: queryLayers - - name: printLayers + available_metadata: + # Layers group + - name: isExpanded + type: boolean + # Layer + - name: copyTo # V1 + - name: copyable + type: boolean + - name: legend + type: boolean + - name: isLegendExpanded + type: boolean + - name: legendRule + - name: legendImage + type: url + - name: iconUrl + type: url + - name: metadataUrl + type: url + - name: disclaimer + - name: isChecked + type: boolean + - name: identifierAttributeField + - name: maxResolution + type: float + - name: minResolution + type: float + - name: opacity + type: float + - name: thumbnail + type: url + - name: timeAttribute + - name: lastUpdateDateColumn + - name: lastUpdateUserColumn + - name: snappingConfig + type: json + - name: geometryValidation # V1 + type: boolean + - name: excludeProperties # not yet used + # WMS + - name: directedFilterAttributes + type: list + - name: enumeratedAttributes + type: list + # WMTS layers + - name: ogcServer + - name: wmsLayers + - name: queryLayers + - name: printLayers # The list of functionalities that can be configured # through the admin interface. - available_functionalities: - - default_basemap - - default_theme - - print_template - - mapserver_substitution - - filterable_layers - - preset_layer_filter - - open_panel - - functionalities: + available_functionalities: + - default_basemap + - default_theme + - print_template + - mapserver_substitution + - filterable_layers + - preset_layer_filter + - open_panel + + functionalities: # Functionalities that are accessible to anonymous # users. - anonymous: - print_template: - - 1 A4 portrait - - 2 A3 landscape - default_basemap: plan - - # The name of the theme to use as the default theme. - # The default theme is the theme loaded when no - # theme name is specified in the mobile app URL. If unset - # then there is no default theme, and no theme information - # will be passed to the config.js template. - default_theme: + anonymous: + print_template: + - 1 A4 portrait + - 2 A3 landscape + default_basemap: plan + + # The name of the theme to use as the default theme. + # The default theme is the theme loaded when no + # theme name is specified in the mobile app URL. If unset + # then there is no default theme, and no theme information + # will be passed to the config.js template. + default_theme: # Functionalities that are accessible to authenticated # users with no associated functionalities in the # database. - registered: {} + registered: {} # Functionalities that are made available to Mako templates and loginuser. - available_in_templates: - - default_basemap - - default_theme - - filterable_layers - - print_template - - preset_layer_filter - - open_panel - - urllogin: {} - - mapserverproxy: - default_ogc_server: source for image/png - - tinyowsproxy: - # URL to internal TinyOWS instance - tinyows_url: http://tinyows - - # If the `online_resource` url in the TinyOWS configuration is not set - # to the TinyOWS proxy url (e.g. when the service is also used without - # the proxy), the proxy can replace the original `online_resource` - # url with the proxy url. - # proxy_online_resource: http://{host}{entry_point}/tinyows_proxy - # online_resource: http://localhost{entry_point}/tinyows - - # When running a c2cgeoportal appl. in debug mode (with `make serve`) - # the host has to be set explicitly in a vhost environment. - # tinyows_host: {host} - - resourceproxy: - # list of urls from which it is safe to load content - targets: - #exempletargetname: http://www.camptocamp.com/?param1=%s¶m2=%s - - fulltextsearch: - defaultlimit: 30 - maxlimit: 200 - languages: - fr: french - en: english - de: german - - servers: - internal: http://localhost/ - local: '{web_protocol}://{host}{entry_point}' - mapserver: http://mapserver/ - - host_forward_host: + available_in_templates: + - default_basemap + - default_theme + - filterable_layers + - print_template + - preset_layer_filter + - open_panel + + urllogin: {} + + mapserverproxy: + default_ogc_server: source for image/png + + tinyowsproxy: + # URL to internal TinyOWS instance + tinyows_url: http://tinyows + + # If the `online_resource` url in the TinyOWS configuration is not set + # to the TinyOWS proxy url (e.g. when the service is also used without + # the proxy), the proxy can replace the original `online_resource` + # url with the proxy url. + # proxy_online_resource: http://{host}{entry_point}/tinyows_proxy + # online_resource: http://localhost{entry_point}/tinyows + + # When running a c2cgeoportal appl. in debug mode (with `make serve`) + # the host has to be set explicitly in a vhost environment. + # tinyows_host: {host} + + resourceproxy: + # list of urls from which it is safe to load content + targets: + # exempletargetname: http://www.camptocamp.com/?param1=%s¶m2=%s + + fulltextsearch: + defaultlimit: 30 + maxlimit: 200 + languages: + fr: french + en: english + de: german + + servers: + internal: http://localhost/ + local: '{web_protocol}://{host}{entry_point}' + mapserver: http://mapserver/ + + host_forward_host: - localhost - # The "raster web services" configuration. See the "raster" - # chapter in the integrator documentation. - raster: {} + # The "raster web services" configuration. See the "raster" + # chapter in the integrator documentation. + raster: {} - # Used by enumeration in the query builder - layers: - geometry_validation: True + # Used by enumeration in the query builder + layers: + geometry_validation: True - # Used to send an email on password reset - reset_password: {} + # Used to send an email on password reset + reset_password: {} - # The shortener base configuration - shortener: - # The base of created URL - base_url: '{web_protocol}://{host}{entry_point}/s/' - allowed_hosts: - - '{host}' + # The shortener base configuration + shortener: + # The base of created URL + base_url: '{web_protocol}://{host}{entry_point}/s/' + allowed_hosts: + - '{host}' - # Define whether the MapServer proxy should hide the OGC capabilities. - hide_capabilities: false + # Define whether the MapServer proxy should hide the OGC capabilities. + hide_capabilities: false - ogcproxy_enable: false + # For print proxy + print_url: http://print:8080/print/{package} - # For print proxy + pdfreport: print_url: http://print:8080/print/{package} - pdfreport: - print_url: http://print:8080/print/{package} - - # For base layers - tiles_url: + # For base layers + tiles_url: - '{web_protocol}:://a.tiles.{host}/tiles' - '{web_protocol}:://b.tiles.{host}/tiles' - '{web_protocol}:://c.tiles.{host}/tiles' - '{web_protocol}:://d.tiles.{host}/tiles' - wmtscapabilities_path: WMTSCAPABILITIES_PATH - - ogcproxy_enable: False - - # Control the HTTP headers - headers: - index: &header - access_control_max_age: 600 # 10 minutes - access_control_allow_origin: - - "*" - api: *header - profile: *header - raster: *header - echo: *header - csvecho: *header - exportgpxkml: *header - error: *header - themes: &auth_header - access_control_max_age: 600 # 10 minutes - access_control_allow_origin: - - "{web_protocol}:://{host}/" - - "*" - config: *auth_header - print: *auth_header - fulltextsearch: *auth_header - mapserver: *auth_header - tinyows: *auth_header - layers: *auth_header - shortener: *auth_header - login: - access_control_max_age: 600 # 10 minutes - access_control_allow_origin: - - "{web_protocol}:://{host}/" - - # Checker configuration - checker: - fulltextsearch: - level: 1 - search: text to search - lang: + wmtscapabilities_path: WMTSCAPABILITIES_PATH + + ogcproxy_enable: false + + # Control the HTTP headers + headers: + index: &header + access_control_max_age: 600 # 10 minutes + access_control_allow_origin: + - "*" + api: *header + profile: *header + raster: *header + echo: *header + csvecho: *header + exportgpxkml: *header + error: *header + themes: &auth_header + access_control_max_age: 600 # 10 minutes + access_control_allow_origin: + - "{web_protocol}:://{host}/" + - "*" + config: *auth_header + print: *auth_header + fulltextsearch: *auth_header + mapserver: *auth_header + tinyows: *auth_header + layers: *auth_header + shortener: *auth_header + login: + access_control_max_age: 600 # 10 minutes + access_control_allow_origin: + - "{web_protocol}:://{host}/" + + # Checker configuration + checker: + fulltextsearch: + level: 1 + search: text to search + lang: + level: 1 + files: [ngeo, cgxp-api] + phantomjs: + disable: [] + routes: + - name: desktop + params: + no_redirect: "true" level: 1 - files: [ngeo, cgxp-api] - phantomjs: - disable: [] - routes: - - name: desktop - params: - no_redirect: "true" - level: 1 - - name: mobile - params: - no_redirect: "true" - level: 3 -# - name: desktop -# params: -# no_redirect: "true" -# debug: "true" -# level: 3 -# - name: mobile -# params: -# no_redirect: "true" -# debug: "true" -# level: 3 - routes: - disable: [] - routes: -# - name: apijs -# level: 3 -# - name: xapijs -# level: 3 - - name: printproxy_capabilities - level: 3 - - name: mapserverproxy - display_name: mapserverproxy_wms - params: - SERVICE: WMS - VERSION: 1.1.1 - REQUEST: GetCapabilities - level: 3 - - name: mapserverproxy - display_name: mapserverproxy_wfs - params: - SERVICE: WFS - VERSION: 1.1.0 - REQUEST: GetCapabilities - level: 3 - themes: - params: - version: "2" - level: 1 - interfaces: {} - print: - spec: {} - level: 1 - - # Check collector configuration - check_collector: - hosts: [] - max_level: 1 - level: 1 - - # What web page is authorized to use the API - authorized_referers: + - name: mobile + params: + no_redirect: "true" + level: 3 + # - name: desktop + # params: + # no_redirect: "true" + # debug: "true" + # level: 3 + # - name: mobile + # params: + # no_redirect: "true" + # debug: "true" + # level: 3 + routes: + disable: [] + routes: + # - name: apijs + # level: 3 + # - name: xapijs + # level: 3 + - name: printproxy_capabilities + level: 3 + - name: mapserverproxy + display_name: mapserverproxy_wms + params: + SERVICE: WMS + VERSION: 1.1.1 + REQUEST: GetCapabilities + level: 3 + - name: mapserverproxy + display_name: mapserverproxy_wfs + params: + SERVICE: WFS + VERSION: 1.1.0 + REQUEST: GetCapabilities + level: 3 + themes: + params: + version: "2" + level: 1 + interfaces: {} + print: + spec: {} + level: 1 + + # Check collector configuration + check_collector: + hosts: [] + max_level: 1 + level: 1 + + # What web page is authorized to use the API + authorized_referers: - '{web_protocol}://{host}{entry_point}' - # Hooks that can be called at different moments in the life of the - # application. The value is the full python name - # (full.module.path.function_name) of the function to call - hooks: {} - # after_settings: {{package}}.after_settings_hook - # Called just after the settings have been loaded. Allows to modify - # the settings at runtime (they are constructed at build time). - # The function receives one parameter: the settings object. - - # Statistics are disabled by default - stats: {} - - db_chooser: - # List of {method path} regexes to force the usage of the master, even for GET and OPTIONS - # This supersedes the slave list. - master: + # Hooks that can be called at different moments in the life of the + # application. The value is the full python name + # (full.module.path.function_name) of the function to call + hooks: {} + # after_settings: {{package}}.after_settings_hook + # Called just after the settings have been loaded. Allows to modify + # the settings at runtime (they are constructed at build time). + # The function receives one parameter: the settings object. + + # Statistics are disabled by default + stats: {} + + db_chooser: + # List of {method path} regexes to force the usage of the master, even for GET and OPTIONS + # This supersedes the slave list. + master: - GET /short/.* # The shortener updates the last_hit column on GET - # List of {method path} regexes to force the usage of the slave - slave: + # List of {method path} regexes to force the usage of the slave + slave: - \w+ /printproxy/.* # The print proxy is never writing to the DB interpreted: - python: + python: - authtkt.secret - ps - directory - interfaces - environment: + environment: - geomapfish_version - docker_base - docker_tag @@ -453,8 +461,8 @@ interpreted: - build_volume_name - project_directory - python_path - node: - vars: - - closure_library_path - cmd: ["node", "-e"] - ignore_error: true + node: + vars: + - closure_library_path + cmd: ["node", "-e"] + ignore_error: true diff --git a/geoportal/tests/config.yaml b/geoportal/tests/config.yaml index a9a28454a6..d80b01aac3 100644 --- a/geoportal/tests/config.yaml +++ b/geoportal/tests/config.yaml @@ -1,6 +1,7 @@ +--- # A minimal application config file. # # This is required for test_init.py. vars: - cache: - backend: dogpile.cache.memory + cache: + backend: dogpile.cache.memory diff --git a/travis/docker-compose.yaml b/travis/docker-compose.yaml index 7d12cabf99..3aa436ee80 100644 --- a/travis/docker-compose.yaml +++ b/travis/docker-compose.yaml @@ -1,3 +1,4 @@ +--- # A compose file for development. version: '2' services: @@ -24,4 +25,4 @@ services: geoportal: image: camptocamp/testgeomapfish-geoportal:latest ports: - - 8080:80 + - 8080:80 diff --git a/travis/v22-project.yaml b/travis/v22-project.yaml index 494a3f2122..e973f006f1 100644 --- a/travis/v22-project.yaml +++ b/travis/v22-project.yaml @@ -1,28 +1,29 @@ +--- project_folder: testgeomapfish project_package: ${package} host: ${host} checker_path: /${instanceid}/wsgi/check_collector? managed_files: [] unmanaged_files: -- setup.py -- Makefile -- testgeomapfish.mk -- project.yaml.mako -- vars.yaml -- mapserver/Dockerfile -- mapserver/c2cgeoportal.map.mako -- mapserver/tinyows.xml.mako -- print/print-apps/testgeomapfish/config.yaml.mako -- testgeomapfish/locale/fr/LC_MESSAGES/testgeomapfish-client.po -- testgeomapfish/locale/de/LC_MESSAGES/testgeomapfish-client.po -- testgeomapfish/static-ngeo/js/desktop.js -- testgeomapfish/static-ngeo/js/mobile.js -- testgeomapfish/static-ngeo/less/desktop.less -- testgeomapfish/static-ngeo/less/mobile.less -- testgeomapfish/templates/desktop.html -- testgeomapfish/templates/mobile.html + - setup.py + - Makefile + - testgeomapfish.mk + - project.yaml.mako + - vars.yaml + - mapserver/Dockerfile + - mapserver/c2cgeoportal.map.mako + - mapserver/tinyows.xml.mako + - print/print-apps/testgeomapfish/config.yaml.mako + - testgeomapfish/locale/fr/LC_MESSAGES/testgeomapfish-client.po + - testgeomapfish/locale/de/LC_MESSAGES/testgeomapfish-client.po + - testgeomapfish/static-ngeo/js/desktop.js + - testgeomapfish/static-ngeo/js/mobile.js + - testgeomapfish/static-ngeo/less/desktop.less + - testgeomapfish/static-ngeo/less/mobile.less + - testgeomapfish/templates/desktop.html + - testgeomapfish/templates/mobile.html template_vars: - package: testgeomapfish - srid: 21781 - extent: 489246.36,78873.44,837119.76,296543.14 - apache_vhost: test + package: testgeomapfish + srid: 21781 + extent: 489246.36,78873.44,837119.76,296543.14 + apache_vhost: test diff --git a/travis/vars-nondocker.yaml b/travis/vars-nondocker.yaml index 2eb1ecfc81..9406bc6775 100644 --- a/travis/vars-nondocker.yaml +++ b/travis/vars-nondocker.yaml @@ -1,14 +1,16 @@ +--- + extends: vars_nondocker.yaml vars: - checker: - lang: - files: [ngeo] - routes: - disable: [printproxy_capabilities] + checker: + lang: + files: [ngeo] + routes: + disable: [printproxy_capabilities] update_paths: -- layers -- checker.lang -- checker.routes -- check_collector.disabled + - layers + - checker.lang + - checker.routes + - check_collector.disabled diff --git a/travis/vars.yaml b/travis/vars.yaml index 53dbaab54d..17757d0c92 100644 --- a/travis/vars.yaml +++ b/travis/vars.yaml @@ -1,25 +1,27 @@ +--- + extends: vars.yaml vars: - dbsessions: - travis_test: - url: postgresql://{dbuser}:{dbpassword}@external-db:5432/test + dbsessions: + travis_test: + url: postgresql://{dbuser}:{dbpassword}@external-db:5432/test - layers: - enum: - test: - dbsession: travis_test - attributes: - type: - table: main.test + layers: + enum: + test: + dbsession: travis_test + attributes: + type: + table: main.test - checker: - lang: - files: [ngeo] - routes: - disable: [printproxy_capabilities] + checker: + lang: + files: [ngeo] + routes: + disable: [printproxy_capabilities] update_paths: -- layers -- checker.lang -- checker.routes + - layers + - checker.lang + - checker.routes diff --git a/vars.yaml b/vars.yaml index 12923ecc76..e8f84634f8 100644 --- a/vars.yaml +++ b/vars.yaml @@ -1,28 +1,36 @@ +--- vars: - build_volume_name: BUILD_VOLUME_NAME - main_version: "'.'.join(__import__('pkg_resources').get_distribution('c2cgeoportal_commons').version.split('.')[0:2])" - dbuser: www-data - dbpassword: www-data - dbhost: db - dbport: 5432 - db: geomapfish_test - mapserver_join_tables: main.restrictionarea AS ra, main.role_restrictionarea AS rra, main.layer_restrictionarea AS lra, main.treeitem AS la - mapserver_join_area: ra.area - mapserver_join_where: "rra.role_id = %role_id% AND rra.restrictionarea_id = ra.id AND lra.restrictionarea_id = ra.id AND lra.layer_id = la.id AND la.name =" - mapserver_layer_metadata: "" - mapserver_layer_validation: - '"default_role_id" "-1" - "role_id" "^-?[0-9]*$"' - mapfile_data_subselect: "SELECT ST_Collect(ra.area) FROM main.restrictionarea AS ra, main.role_restrictionarea AS rra, main.layer_restrictionarea AS lra, main.treeitem AS la WHERE rra.role_id = %role_id% AND rra.restrictionarea_id = ra.id AND lra.restrictionarea_id = ra.id AND lra.layer_id = la.id AND la.name =" - git_branch: GIT_BRANCH - tx_version: TX_VERSION - tx_languages: LANGUAGES + build_volume_name: BUILD_VOLUME_NAME + main_version: + "'.'.join(__import__('pkg_resources').get_distribution('c2cgeoportal_commons') + .version.split('.')[0:2])" + dbuser: www-data + dbpassword: www-data + dbhost: db + dbport: 5432 + db: geomapfish_test + mapserver_join_tables: main.restrictionarea AS ra, main.role_restrictionarea AS rra, + main.layer_restrictionarea AS lra, main.treeitem AS la + mapserver_join_area: ra.area + mapserver_join_where: "rra.role_id = %role_id% AND rra.restrictionarea_id = ra.id \ + AND lra.restrictionarea_id = ra.id AND lra.layer_id = la.id AND la.name =" + mapserver_layer_metadata: "" + mapserver_layer_validation: + '"default_role_id" "-1" + "role_id" "^-?[0-9]*$"' + mapfile_data_subselect: "SELECT ST_Collect(ra.area) FROM main.restrictionarea AS ra, \ + main.role_restrictionarea AS rra, main.layer_restrictionarea AS lra, main.treeitem AS la \ + WHERE rra.role_id = %role_id% AND rra.restrictionarea_id = ra.id AND lra.restrictionarea_id = ra.id \ + AND lra.layer_id = la.id AND la.name =" + git_branch: GIT_BRANCH + tx_version: TX_VERSION + tx_languages: LANGUAGES interpreted: - environment: + environment: - build_volume_name - tx_version - tx_languages - git_branch - python: + python: - main_version diff --git a/yamllint.yaml b/yamllint.yaml new file mode 100644 index 0000000000..62a4e5b622 --- /dev/null +++ b/yamllint.yaml @@ -0,0 +1,9 @@ +--- +extends: default + +rules: + line-length: + max: 110 + indentation: + spaces: 2 + truthy: disable