diff --git a/.travis.yml b/.travis.yml index 0bd3b1f334..c00f276713 100644 --- a/.travis.yml +++ b/.travis.yml @@ -101,7 +101,6 @@ jobs: - env: [JOB=test-docker-app] before_script: - - mkdir /tmp/travis - 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 @@ -118,9 +117,8 @@ jobs: /tmp/travis/testgeomapfish/geoportal/testgeomapfish_geoportal/views /tmp/travis/testgeomapfish/commons/setup.py /tmp/travis/testgeomapfish/commons/testgeomapfish_commons -name \*.py | xargs travis/squote - # FIXME re-enhable them - #- 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/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 diff --git a/geoportal/Dockerfile b/geoportal/Dockerfile index f58875a51b..50676dd4cd 100644 --- a/geoportal/Dockerfile +++ b/geoportal/Dockerfile @@ -42,6 +42,7 @@ COPY . /opt/c2cgeoportal_geoportal RUN chmod go+r -R /opt/c2cgeoportal_geoportal && \ pip install --disable-pip-version-check --no-cache-dir --no-deps --editable=/opt/c2cgeoportal_geoportal -ENV LOG_LEVEL=INFO \ +ENV NODE_PATH=/usr/lib/node_modules \ + LOG_LEVEL=INFO \ GUNICORN_ACCESS_LOG_LEVEL=INFO \ C2CGEOPORTAL_LOG_LEVEL=WARN diff --git a/geoportal/c2cgeoportal_geoportal/lib/check_collector.py b/geoportal/c2cgeoportal_geoportal/lib/check_collector.py index 8d70e807f6..8b97480660 100644 --- a/geoportal/c2cgeoportal_geoportal/lib/check_collector.py +++ b/geoportal/c2cgeoportal_geoportal/lib/check_collector.py @@ -26,11 +26,14 @@ # The views and conclusions contained in the software and documentation are those # of the authors and should not be interpreted as representing official policies, # either expressed or implied, of the FreeBSD Project. +import logging import requests from c2cgeoportal_geoportal.lib.checker import build_url +LOG = logging.getLogger(__name__) + def init(config, health_check): global_settings = config.get_settings() @@ -47,9 +50,13 @@ def check(request): display = host["display"] if "host" not in params or display == params["host"]: url_headers = build_url( - "check_collector", "%s%s/health_check" % (host["url"], c2c_base), request) + "check_collector", "%s%s/health_check" % (host["url"], c2c_base), request + ) r = requests.get(params={"max_level": str(host.get("max_level", max_level))}, **url_headers) r.raise_for_status() - health_check.add_custom_check(name="check_collector_" + host["display"], check_cb=check, - level=settings["level"]) + health_check.add_custom_check( + name="check_collector_" + host["display"], + check_cb=check, + level=settings["level"] + ) diff --git a/geoportal/c2cgeoportal_geoportal/lib/checker.py b/geoportal/c2cgeoportal_geoportal/lib/checker.py index 898417dd45..740df55171 100644 --- a/geoportal/c2cgeoportal_geoportal/lib/checker.py +++ b/geoportal/c2cgeoportal_geoportal/lib/checker.py @@ -48,7 +48,7 @@ def build_url(name, url, request, headers=None): else: url_ = url - log.error("{}, URL: {} => {}".format(name, url, url_)) + log.error("%s, URL: %s => %s", name, url, url_) return {"url": url_, "headers": headers} @@ -207,7 +207,8 @@ def check(request): cmd = [ "phantomjs", "--local-to-remote-url-access=true", - "/usr/lib/node_modules/ngeo/buildtools/check-example.js", url] + "/usr/lib/node_modules/ngeo/buildtools/check-example.js", url + ] # check_output throws a CalledProcessError if return code is > 0 try: diff --git a/geoportal/c2cgeoportal_geoportal/scaffolds/update/CONST_vars.yaml_tmpl b/geoportal/c2cgeoportal_geoportal/scaffolds/update/CONST_vars.yaml_tmpl index 2766523d6b..5bd6996dfb 100644 --- a/geoportal/c2cgeoportal_geoportal/scaffolds/update/CONST_vars.yaml_tmpl +++ b/geoportal/c2cgeoportal_geoportal/scaffolds/update/CONST_vars.yaml_tmpl @@ -77,7 +77,7 @@ vars: root_dir: "{directory}" # used for the "node_modules" and "closure" static views - closure_library_path: 'process.stdout.write(require("closure-util").getLibraryPath())' + closure_library_path: 'process.stdout.write(require("@camptocamp/closure-util").getLibraryPath())' node_modules_path: "/usr/lib/node_modules" # pyramid_closure configuration diff --git a/geoportal/c2cgeoportal_geoportal/scripts/import_ngeo_apps.py b/geoportal/c2cgeoportal_geoportal/scripts/import_ngeo_apps.py index 11e275d2de..aaecfe8e70 100644 --- a/geoportal/c2cgeoportal_geoportal/scripts/import_ngeo_apps.py +++ b/geoportal/c2cgeoportal_geoportal/scripts/import_ngeo_apps.py @@ -143,7 +143,6 @@ def main(): for package in [ "angular-jsdoc", "angular-mocks", - "console-control-strings", "coveralls", "gaze", "jsdoc", diff --git a/travis/create-new-project.sh b/travis/create-new-project.sh index 1cbd424afa..56ef56cd32 100755 --- a/travis/create-new-project.sh +++ b/travis/create-new-project.sh @@ -27,7 +27,6 @@ git remote add origin . # add a fake remote ./docker-run make --makefile=travis.mk \ docker-compose-build.yaml \ geoportal-docker mapserver-docker print-docker testdb-docker -cat docker-compose-build.yaml # Wait DB ./docker-compose-run sleep 15 # Create default theme