diff --git a/c2cgeoportal/scaffolds/update/CONST_Makefile_tmpl b/c2cgeoportal/scaffolds/update/CONST_Makefile_tmpl index 25f18e31809..b72f824643c 100644 --- a/c2cgeoportal/scaffolds/update/CONST_Makefile_tmpl +++ b/c2cgeoportal/scaffolds/update/CONST_Makefile_tmpl @@ -14,6 +14,7 @@ MOBILE ?= TRUE NGEO ?= FALSE # Use TileCloud chain TILECLOUD_CHAIN ?= TRUE +TILECLOUD_CHAIN_LOCAL ?= FALSE # Used print version PRINT_VERSION ?= 3 @@ -36,12 +37,19 @@ CLIENT_CHECK_RULE ?= lint-ngeo endif WEB_RULE ?= $(DEFAULT_WEB_RULE) -# Make rules - -DEFAULT_BUILD_RULES ?= test-packages .build/requirements.timestamp $(WEB_RULE) build-server apache +# TileCloud-chain +WMTSCAPABILITIES_PATH ?= 1.0.0/WMTSCapabilities-$(INSTANCE_ID).xml +ENVIRONMENT_VARS += WMTSCAPABILITIES_PATH=${WMTSCAPABILITIES_PATH} ifeq ($(TILECLOUD_CHAIN), TRUE) -DEFAULT_BUILD_RULES += test-packages-tilecloud-chain apache/tiles.conf +WMTSCAPABILITIES_FILE ?= /var/sig/tiles/$(WMTSCAPABILITIES_PATH) +DEFAULT_BUILD_RULES += test-packages-tilecloud-chain apache/tiles.conf tilegeneration/config.yaml +ifeq ($(TILECLOUD_CHAIN_LOCAL), TRUE) +DEFAULT_BUILD_RULES += $(WMTSCAPABILITIES_FILE) endif +endif + +# Make rules +DEFAULT_BUILD_RULES ?= test-packages .build/requirements.timestamp $(WEB_RULE) build-server apache ifeq ($(MOBILE), TRUE) DEFAULT_BUILD_RULES += test-packages-mobile endif @@ -364,6 +372,9 @@ clean: template-clean $(TOMCAT_OUTPUT_CMD_PREFIX) rm -f $(PRINT_OUTPUT)/$(PRINT_WAR) $(TOMCAT_OUTPUT_CMD_PREFIX) rm -rf $(PRINT_OUTPUT)/$(PRINT_WAR:.war=) rm -f $(APACHE_CONF_DIR)/$(INSTANCE_ID).conf +ifeq ($(TILECLOUD_CHAIN_LOCAL), TRUE) + rm -f $(WMTSCAPABILITIES_FILE) +endif .PHONY: cleanall cleanall: clean @@ -813,3 +824,7 @@ upgrade3: .build/requirements.timestamp project.yaml .PHONY: upgrade4 upgrade4: .build/requirements.timestamp project.yaml $(VENV_BIN)/c2ctool upgrade $(UPGRADE_MAKE_FILE) ${UPGRADE_ARGS} ${VERSION} --step 4 + +# Tilecloud chain +$(WMTSCAPABILITIES_FILE): tilegeneration/config.yaml .build/dev-requirements.timestamp + $(VENV_BIN)/generate_controller --capabilities diff --git a/c2cgeoportal/scaffolds/update/CONST_vars.yaml_tmpl b/c2cgeoportal/scaffolds/update/CONST_vars.yaml_tmpl index 2677f1142ec..801272d57fd 100644 --- a/c2cgeoportal/scaffolds/update/CONST_vars.yaml_tmpl +++ b/c2cgeoportal/scaffolds/update/CONST_vars.yaml_tmpl @@ -241,6 +241,7 @@ vars: - http://b.tiles.{host}/{instanceid}/tiles - http://c.tiles.{host}/{instanceid}/tiles - http://d.tiles.{host}/{instanceid}/tiles + wmtscapabilities_path: WMTSCAPABILITIES_PATH # The URL template used to generate the sub domain URL # %(sub)s will be replaced by the sub domain value. @@ -324,3 +325,4 @@ interpreted: - instanceid - apache_entry_point - development + - wmtscapabilities_path diff --git a/doc/integrator/make.rst b/doc/integrator/make.rst index 72264bb55d9..f79c459c0a1 100644 --- a/doc/integrator/make.rst +++ b/doc/integrator/make.rst @@ -82,34 +82,24 @@ Custom rules ------------ In the ``.mk`` file we can create some other rules. -Here is a simple example that creates the -`/var/sig/tiles/1.0.0/WMTSCapabilities.xml` file -and removes it on the `clean` rule: +Here is a simple example: .. code:: makefile - WMTSCAPABILITIES_FILE ?= /var/sig/tiles/1.0.0/WMTSCapabilities-$(INSTANCE_ID).xml + MY_FILE ?= - PRE_RULES = $(WMTSCAPABILITIES_FILE) + PRE_RULES = $(MY_FILE) - $(WMTSCAPABILITIES_FILE): tilegeneration/config.yaml .build/dev-requirements.timestamp - $(VENV_BIN)/generate_controller --capabilities + $(MY_FILE): + cp $(MY_FILE) + # Short version: + # cp $< $@ clean: project-clean .PHONY: project-clean project-clean: - rm -f $(WMTSCAPABILITIES_FILE) + rm -f $(MY_FILE) -``tilegeneration/config.yaml`` and ``.build/dev-requirements.timestamp`` are the files -that must be built to run the current rule. - -``$(VENV_BIN)/generate_controller --capabilities`` is the command that generates the wanted file. - -And if you don't want the instance id in the production file you can put in your production mk file: - -.. code:: makefile - - WMTSCAPABILITIES_FILE = /var/sig/tiles/1.0.0/WMTSCapabilities.xml Note ---- diff --git a/doc/integrator/tilegeneration.rst b/doc/integrator/tilegeneration.rst index cc97f9f6c91..de7f2127d5d 100644 --- a/doc/integrator/tilegeneration.rst +++ b/doc/integrator/tilegeneration.rst @@ -85,6 +85,27 @@ Initialization .build/venv/bin/pcreate --interactive -s tilecloud_chain ../ package= +* In the ``.mk`` activate the tile generation: + + .. code:: + + TILECLOUD_CHAIN ?= TRUE + +* If you use local cache activate the capabilities generation with: + + .. code:: + + TILECLOUD_CHAIN_LOCAL ?= TRUE + + and set the ``wmtscapabilities_file`` to ``${wmtscapabilities_path}`` in your + ``tilegeneration/config.yaml.mako`` file. + +* In your ``.mk`` you can also set the capabilities file name with: + + .. code:: + + WMTSCAPABILITIES_PATH = 1.0.0/WMTSCapabilities.xml + * Add configuration to Git: .. prompt:: bash