Skip to content

Commit

Permalink
Upgrade to GeoMapFish 2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Jan 15, 2020
1 parent dcd85fb commit e82b1f2
Show file tree
Hide file tree
Showing 8 changed files with 96 additions and 36 deletions.
2 changes: 1 addition & 1 deletion CONST_create_template/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ENV VARS_FILE=vars.yaml
ENV CONFIG_VARS sqlalchemy.url sqlalchemy.pool_recycle sqlalchemy.pool_size sqlalchemy.max_overflow \
sqlalchemy.use_batch_mode sqlalchemy_slave.url sqlalchemy_slave.pool_recycle sqlalchemy_slave.pool_size \
sqlalchemy_slave.max_overflow sqlalchemy_slave.use_batch_mode schema schema_static enable_admin_interface \
default_locale_name servers layers available_locale_names cache admin_interface functionalities \
default_locale_name servers layers available_locale_names cache admin_interface getitfixed functionalities \
raster shortener hide_capabilities tinyowsproxy resourceproxy print_url print_get_redirect \
checker check_collector default_max_age package srid \
reset_password fulltextsearch global_headers headers authorized_referers hooks stats db_chooser \
Expand Down
7 changes: 4 additions & 3 deletions CONST_create_template/build
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,20 @@ for env_file in args.env_files:
# Ignore lines that don't have a '='
pass

base = env['DOCKER_BASE'] if 'DOCKER_BASE' in env else "camptocamp/geomapfish"
tag = ":" + env['DOCKER_TAG'] if 'DOCKER_TAG' in env else ""

if auto or args.config:
subprocess.check_call(
["docker", "build", "--tag=camptocamp/geomapfish-config" + tag, "--build-arg=PGSCHEMA=" + args.pgschema, "."]
["docker", "build", "--tag={}-config{}".format(base, tag), "--build-arg=PGSCHEMA=" + args.pgschema, "."]
)
if auto or args.geoportal:
git_hash = subprocess.check_output(["git", "rev-parse", "HEAD"]).strip().decode()
subprocess.check_call(
[
"docker",
"build",
"--tag=camptocamp/geomapfish-geoportal" + tag,
"--tag={}-geoportal{}".format(base, tag),
"--build-arg=PGSCHEMA=" + args.pgschema,
"--build-arg=GIT_HASH=" + git_hash,
"geoportal",
Expand All @@ -75,7 +76,7 @@ if auto or args.geoportal:
"docker",
"build",
"--target=builder",
"--tag=camptocamp/geomapfish-geoportal-dev" + tag,
"--tag={}-geoportal-dev{}".format(base, tag),
"--build-arg=PGSCHEMA=" + args.pgschema,
"--build-arg=GIT_HASH=" + git_hash,
"geoportal",
Expand Down
14 changes: 10 additions & 4 deletions CONST_create_template/geoportal/vars.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,18 @@ vars:
params:
ogcserver: QGIS server


admin_interface:
# Default values for the admin interface's maps.
map_x: 740000
map_y: 5860000
map_zoom: 10
map:
baseLayers:
- type_: "OSM"
view:
projection: 'EPSG:3857'
center: [829170, 5933942]
zoom: 7
fitSource: false
fitMaxZoom: 14
focusOnly: false

functionalities:
# Functionalities that are made available to Mako templates.
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ENV VARS_FILE=vars.yaml
ENV CONFIG_VARS sqlalchemy.url sqlalchemy.pool_recycle sqlalchemy.pool_size sqlalchemy.max_overflow \
sqlalchemy.use_batch_mode sqlalchemy_slave.url sqlalchemy_slave.pool_recycle sqlalchemy_slave.pool_size \
sqlalchemy_slave.max_overflow sqlalchemy_slave.use_batch_mode schema schema_static enable_admin_interface \
default_locale_name servers layers available_locale_names cache admin_interface functionalities \
default_locale_name servers layers available_locale_names cache admin_interface getitfixed functionalities \
raster shortener hide_capabilities tinyowsproxy resourceproxy print_url print_get_redirect \
checker check_collector default_max_age package srid \
reset_password fulltextsearch global_headers headers authorized_referers hooks stats db_chooser \
Expand Down
15 changes: 8 additions & 7 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import os
import re
import stat
import subprocess
import sys
import urllib.request

parser = argparse.ArgumentParser(description="Build the project,")
Expand All @@ -30,14 +31,14 @@ if args.upgrade:
if result.code != 200:
print("ERROR:")
print(result.read())
exit(1)
sys.exit(1)
f.write(result.read().decode())
os.chmod("upgrade", os.stat("upgrade").st_mode | stat.S_IXUSR)
try:
subprocess.check_call(["./upgrade", full_version])
except subprocess.CalledProcessError:
exit(1)
exit(0)
sys.exit(1)
sys.exit(0)

auto = not (args.config or args.geoportal or args.env)
env = {}
Expand All @@ -52,20 +53,20 @@ for env_file in args.env_files:
# Ignore lines that don't have a '='
pass

base = env['DOCKER_BASE'] if 'DOCKER_BASE' in env else "camptocamp/geomapfish-config"
base = env['DOCKER_BASE'] if 'DOCKER_BASE' in env else "camptocamp/geomapfish"
tag = ":" + env['DOCKER_TAG'] if 'DOCKER_TAG' in env else ""

if auto or args.config:
subprocess.check_call(
["docker", "build", "--tag=" + base + "-config" + tag, "--build-arg=PGSCHEMA=" + args.pgschema, "."]
["docker", "build", "--tag={}-config{}".format(base, tag), "--build-arg=PGSCHEMA=" + args.pgschema, "."]
)
if auto or args.geoportal:
git_hash = subprocess.check_output(["git", "rev-parse", "HEAD"]).strip().decode()
subprocess.check_call(
[
"docker",
"build",
"--tag=" + base + "-geoportal" + tag,
"--tag={}-geoportal{}".format(base, tag),
"--build-arg=PGSCHEMA=" + args.pgschema,
"--build-arg=GIT_HASH=" + git_hash,
"geoportal",
Expand All @@ -76,7 +77,7 @@ if auto or args.geoportal:
"docker",
"build",
"--target=builder",
"--tag=" + base + "-geoportal-dev" + tag,
"--tag={}-geoportal-dev{}".format(base, tag),
"--build-arg=PGSCHEMA=" + args.pgschema,
"--build-arg=GIT_HASH=" + git_hash,
"geoportal",
Expand Down
72 changes: 59 additions & 13 deletions geoportal/CONST_config-schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -284,19 +284,52 @@ mapping:
mapping:
layer_tree_max_nodes:
type: int
map_base_layer:
type: str
map_x:
type: int
required: True
map_y:
type: int
required: True
map_zoom:
type: int
required: True
map_fit_max_zoom:
type: int
map: &map_config
type: map
mapping:
baseLayers:
type: seq
sequence:
- type: map
mapping:
regex;.+:
type: any
fitSource:
type: bool
fitMaxZoom:
type: int
focusOnly:
type: bool
projections:
type: seq
sequence:
- type: map
mapping:
code:
type: str
required: True
definition:
type: str
required: True
srid:
type: int
view:
type: map
mapping:
center:
type: seq
sequence:
- type: int
initialExtent:
type: seq
sequence:
- type: int
projection:
type: str
zoom:
type: int
regex;.+:
type: any
available_metadata:
type: seq
required: True
Expand Down Expand Up @@ -331,6 +364,19 @@ mapping:
type: str
single:
type: bool

getitfixed:
type: map
required: True
mapping:
enabled:
type: bool
required: True
map:
<<: *map_config
regex;.+:
type: any

layers:
type: map
required: True
Expand Down
7 changes: 3 additions & 4 deletions geoportal/CONST_vars.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,6 @@ vars:
backend: dogpile.cache.memory

admin_interface:
# Default values for the admin interface's maps.
map_x: 740000
map_y: 5860000
map_zoom: 10

layer_tree_max_nodes: 1000

Expand Down Expand Up @@ -288,6 +284,9 @@ vars:
- name: open_panel
single: true

getitfixed:
enabled: false

functionalities:
# Functionalities that are made available to Mako templates and loginuser.
available_in_templates:
Expand Down
13 changes: 10 additions & 3 deletions geoportal/vars.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,16 @@ vars:

admin_interface:
# Default values for the admin interface's maps.
map_x: 740000
map_y: 5860000
map_zoom: 10
map:
baseLayers:
- type_: "OSM"
view:
projection: 'EPSG:3857'
center: [740000, 5860000]
zoom: 10
fitSource: false
fitMaxZoom: 14
focusOnly: false

# The list of functionalities that can be configured
# through the admin interface.
Expand Down

0 comments on commit e82b1f2

Please sign in to comment.