Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the print for the Docker compose environment #3788

Merged
merged 1 commit into from
Jun 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion geoportal/c2cgeoportal_geoportal/lib/lingua_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ class GeoMapfishConfigExtractor(Extractor): # pragma: no cover
GeoMapfish config extractor (raster layers, and print templates)
"""

extensions = [".yaml"]
extensions = [".yaml", ".tmpl"]

def __call__(self, filename, options):
init_region({"backend": "dogpile.cache.memory"})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ __pycache__/
/testdb/13-alembic-static.sql
/mapcache/
/tilegeneration/config.yaml
/print/print-apps/{{package}}/config.yaml
/print/print-apps/{{package}}/config.yaml.mako
/mapserver/mapserver.map.tmpl
/mapserver/*.map.tmpl
/mapserver/tinyows.xml
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/bin/bash -e

find /etc /mapcache -name '*.tmpl' -print | while read file
export VISIBLE_WEB_HOST_RE_ESCAPED=`python -c "print(__import__('re').escape('${VISIBLE_WEB_HOST}'))"`
export VISIBLE_ENTRY_POINT_RE_ESCAPED=`python -c "print(__import__('re').escape('${VISIBLE_ENTRY_POINT}'))"`

find /etc /mapcache /usr/local/tomcat/webapps/ -name '*.tmpl' -print | while read file
do
envsubst < ${file} > ${file%.tmpl}
done
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ templates:
httpProcessors:
- !mapUri
mapping:
(https?)://${__import__('re').escape(host)}/(.*): "http://127.0.0.1/$2"
(https?)://${VISIBLE_WEB_HOST_RE_ESCAPED}/(.*): "http://${GEOPORTAL_INTERNAL_URL}/$2"
- !forwardHeaders
matchers:
- !localMatch {}
Expand All @@ -63,9 +63,9 @@ templates:
- !restrictUris
matchers:
- !localMatch
pathRegex: '${entry_point}mapserv_proxy'
pathRegex: '${VISIBLE_ENTRY_POINT_RE_ESCAPED}mapserv_proxy'
- !localMatch
pathRegex: '${entry_point}tiles/.*'
pathRegex: '${VISIBLE_ENTRY_POINT_RE_ESCAPED}tiles/.*'
- !localMatch
reject: true
- !ipMatch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ __pycache__/
/print/WEB-INF/lib/*.jar
/print/WEB-INF/classes/logback.xml
/print/print-apps/{{package}}/config.yaml
/print/print-apps/{{package}}/config.yaml.tmpl
/mapserver/*.map
/mapserver/*.map.tmpl.mako
/mapserver/tinyows.xml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ MAPSERVER_URL ?= http://mapserver/
export MAPSERVER_URL
PRINT_URL ?= http://print:8080/print/
export PRINT_URL
PRINT_CONFIG_FILE ?= print/print-apps/$(PACKAGE)/config.yaml

VISIBLE_WEB_PROTOCOL ?= https
VISIBLE_WEB_PORT ?= 443
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,6 @@ files_to_move:
- from: geoportal/{{package}}_geoportal/static-ngeo/components/contextualdata/contextualdata.html
to: geoportal/{{package}}_geoportal/static-ngeo/js/apps/contextualdata.html
version: 2.3
- from: print/print-apps/{{package}}/config.yaml.tmpl
to: print/print-apps/{{package}}/config.yaml.mako
version: 2.3
Original file line number Diff line number Diff line change
Expand Up @@ -195,3 +195,6 @@ files_to_move:
- from: geoportal/{{package}}_geoportal/static-ngeo/components/contextualdata/contextualdata.html
to: geoportal/{{package}}_geoportal/static-ngeo/js/apps/contextualdata.html
version: 2.3
- from: print/print-apps/{{package}}/config.yaml.mako
to: print/print-apps/{{package}}/config.yaml.tmpl
version: 2.3
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,8 @@ endif

# Print
PRINT_BASE_DIR ?= print
I18N_SOURCE_FILES += print/print-apps/$(PACKAGE)/config.yaml
PRINT_CONFIG_FILE ?= print/print-apps/$(PACKAGE)/config.yaml.tmpl
I18N_SOURCE_FILES += $(PRINT_CONFIG_FILE)

PY_FILES = $(shell find $(PACKAGE) -type f -name '*.py' -print)

Expand Down Expand Up @@ -685,7 +686,7 @@ docker-compose-build.yaml: /build/requirements.timestamp

.PHONY: docker-build-config
docker-build-config: $(shell docker-required --path .) \
print/print-apps/$(PACKAGE)/config.yaml \
$(PRINT_CONFIG_FILE) \
$(MAPCACHE_FILE)
docker build -t $(DOCKER_BASE)-config:$(DOCKER_TAG) .

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ vars:
PGUSER: www-data
PGPASSWORD: www-data
PGDATABASE: geomapfish
GEOPORTAL_INTERNAL_URL: 'http://geoportal/'
db:
environment:
POSTGRES_DB: geomapfish
Expand Down
2 changes: 1 addition & 1 deletion travis/test-upgrade-convert.sh
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ then
cp {CONST_create_template/,}project.yaml.mako
cp {CONST_create_template/,}vars.yaml
cp {CONST_create_template/,}mapserver/tinyows.xml.mako
cp {CONST_create_template/,}print/print-apps/testgeomapfish/config.yaml.mako
cp {CONST_create_template/,}print/print-apps/testgeomapfish/config.yaml.tmpl
./docker-run --env=NODE_ENV make upgrade11
if [ ! -e .UPGRADE_SUCCESS ]
then
Expand Down
1 change: 1 addition & 0 deletions travis/v22-project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ unmanaged_files:
- mapserver/mapserver\.map\.mako
- mapserver/mapserver\.map\.tmpl\.mako
- print/print-apps/testgeomapfish/config\.yaml\.mako
- print/print-apps/testgeomapfish/config\.yaml\.tmpl
- print/print-apps/testgeomapfish/.*\.jrxml
- geoportal/testgeomapfish_geoportal/locale/fr/LC_MESSAGES/testgeomapfish-client\.po
- geoportal/testgeomapfish_geoportal/locale/de/LC_MESSAGES/testgeomapfish-client\.po
Expand Down