Skip to content

Commit

Permalink
Merge branch 'gmf2.5_amn' into upgrade_c2cgeoportal_GSLUX-333
Browse files Browse the repository at this point in the history
  • Loading branch information
tonio committed Nov 3, 2020
2 parents f7c0038 + 74fcf66 commit e2a6ada
Show file tree
Hide file tree
Showing 225 changed files with 11,965 additions and 2,674 deletions.
11 changes: 11 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
*
!bin/
!mapserver/
!qgisserver/
!tilegeneration/
!print/print-apps/
!geoportal/vars*.yaml
!geoportal/CONST_vars.yaml
!geoportal/CONST_config-schema.yaml
!geoportal/geoportailv3_geoportal/static
!geoportal/geoportailv3_geoportal/locale
6 changes: 6 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,11 @@ trim_trailing_whitespace = true
[*.js]
indent_size = 2

[*.yaml]
indent_size = 2

[*.yml]
indent_size = 2

[Makefile]
indent_style = tab
24 changes: 7 additions & 17 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,25 +1,15 @@
*~
*.pyc
*.pyo
__pycache__/
/.env
/geoportal/.venv/
/geoportal/dist/
/geoportal/build/
/geoportal/geoportailv3_geoportal/static-ngeo/build/
/geoportal/geoportailv3_geoportal.egg-info/
/geoportal/geoportailv3_geoportal/locale/*/LC_MESSAGES/*.mo
/geoportal/c2cgeoportal/
/geoportal/node_modules/
/docker-compose.override.yaml
/upgrade
/.upgrade.yaml
/.UPGRADE*
/geoportal/geoportailv3_geoportal/locale/geoportailv3_geoportal-client.pot
/geoportal/geoportailv3_geoportal/locale/geoportailv3_geoportal-server.pot
/geoportal/geoportailv3_geoportal/locale/geoportailv3_geoportal-tooltips.pot
/geoportal/geoportailv3_geoportal/locale/ngeo.pot
/.build/
node_modules/
/geoportailv3/
/apache/
/print/WEB-INF/
/geoportailv3.egg-info/
/geoportal/jsapi/node_modules/
/ios_bundle/

# Generated with dev mode
/geoportal/geoportailv3_geoportal/static/apihelp/index.html
22 changes: 22 additions & 0 deletions .prospector.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
strictness: veryhigh

pep8:
options:
max-line-length: 110
disable:
- E203

pylint:
options:
max-line-length: 110
disable:
- too-many-locals
- too-many-statements
- too-many-branches

mccabe:
run: false

mypy:
run: true
59 changes: 59 additions & 0 deletions CONST_CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
This file includes migration steps for each release of c2cgeoportal.


Version 2.5.0
=============

Information
-----------

1. Basic authentication is disabled by default from this version onward.
To enable basic auth see:
https://camptocamp.github.io/c2cgeoportal/2.5/integrator/security.html#basic-auth

Changes to apply
----------------

1. Now we need to have PyYAML python package installed in the home,
see the documentation for more information:
https://camptocamp.github.io/c2cgeoportal/2.5/integrator/requirements.html

2. The configuration vars `vars/functionalities/anonymous` and `vars/functionalities/registered` should
be moved to the new roles `anonymous` and `registered` that will be created once the database has been upgraded.

3. The 'INSTANCE' configuration variable is removed, it should be in the '.env' files, and also the
environment makefiles, these contents should also be moved to the '.env' files. In a multi-organisation
project you can have a chain of multiple '.env' files see the build configuration documentation.

4. A new PostgreSQL extension is required, install it by running in psql:
`CREATE EXTENSION IF NOT EXISTS hstore;`

5. The static files will be moved, therefore you should replace:
`request.static_url('geoportailv3_geoportal:static/` by:
`request.static_url('/etc/geomapfish/static/`.

6. Optional, change your mapfiles according the documentation:
https://camptocamp.github.io/c2cgeoportal/2.5/administrator/mapfile.html


Version 2.4.2
=============

Information
-----------

1. The SVG inclusion through Webpack has changed, See ngeo SVG example for more information:
https://camptocamp.github.io/ngeo/master/examples/svg.html

2. The WMTS capabilities is now generated on runtime.

3. If not already done the 'edit' and 'routing' interfaces and their relations will be removed from the
database, If you don't want that, you should rename the interfaces before applying the alembic scripts.

4. If not already done the 'api' and 'iframe_api' will be created. After the database upgrade you can run
the following request to fill e.-g. the api's interfaces with the desktop interface:

INSERT INTO main.interface_layer (interface_id, layer_id)
SELECT <api_interface_id>, layer_id FROM main.interface_layer WHERE interface_id = <other_interface_id>;
INSERT INTO main.interface_theme (interface_id, theme_id)
SELECT <api_interface_id>, theme_id FROM main.interface_theme WHERE interface_id = <other_interface_id>;
11 changes: 11 additions & 0 deletions CONST_create_template/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
*
!bin/
!mapserver/
!qgisserver/
!tilegeneration/
!print/print-apps/
!geoportal/vars*.yaml
!geoportal/CONST_vars.yaml
!geoportal/CONST_config-schema.yaml
!geoportal/geoportailv3_geoportal/static
!geoportal/geoportailv3_geoportal/locale
21 changes: 21 additions & 0 deletions CONST_create_template/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_style = space
indent_size = 4
trim_trailing_whitespace = true

[*.js]
indent_size = 2

[*.yaml]
indent_size = 2

[*.yml]
indent_size = 2

[Makefile]
indent_style = tab
56 changes: 56 additions & 0 deletions CONST_create_template/.github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
name: Continuous integration

on:
push:

env:
PROJECT: geoportailv3
# Requires CI_GPG_PRIVATE_KEY and GITHUB_GOPASS_CI_TOKEN secrets.
# OPENSHIFT_PROJECT: gs-gmf-geoportailv3
# HELM_RELEASE_NAMES: # List of branch that should be deployed on helm
PATH: /bin:/usr/bin:/usr/local/bin:/home/runner/.local/bin
SUMMON_PROVIDER: /usr/local/bin/gopass

jobs:
config:
runs-on: ubuntu-18.04
name: Config
timeout-minutes: 10

steps:
- uses: actions/checkout@v1

- name: Build config
run: ./build --config

- uses: camptocamp/initialise-gopass-summon-action@v1
with:
ci-gpg-private-key: ${{secrets.CI_GPG_PRIVATE_KEY}}
github-gopass-ci-token: ${{secrets.GITHUB_GOPASS_CI_TOKEN}}
if: "env.HELM_RELEASE_NAMES != ''"
- run: scripts/publish-docker --image=config --no-trigger
if: "env.HELM_RELEASE_NAMES != ''"
- run: scripts/publish-docker --image=config --service=github
if: "env.HELM_RELEASE_NAMES != ''"

geoportal:
runs-on: ubuntu-18.04
name: Geoportal
timeout-minutes: 10

steps:
- uses: actions/checkout@v1

- name: Build geoportal
run: ./build --geoportal

- uses: camptocamp/initialise-gopass-summon-action@v1
with:
ci-gpg-private-key: ${{secrets.CI_GPG_PRIVATE_KEY}}
github-gopass-ci-token: ${{secrets.GITHUB_GOPASS_CI_TOKEN}}
if: "env.HELM_RELEASE_NAMES != ''"
- run: scripts/publish-docker --image=geoportal --no-trigger
if: "env.HELM_RELEASE_NAMES != ''"
- run: scripts/publish-docker --image=geoportal --service=github
if: "env.HELM_RELEASE_NAMES != ''"
12 changes: 12 additions & 0 deletions CONST_create_template/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
*.pyc
*.pyo
__pycache__/
/.env
/docker-compose.override.yaml
/upgrade
/.upgrade.yaml
/.UPGRADE*
/geoportal/geoportailv3_geoportal/locale/geoportailv3_geoportal-client.pot

# Generated with dev mode
/geoportal/geoportailv3_geoportal/static/apihelp/index.html
22 changes: 22 additions & 0 deletions CONST_create_template/.prospector.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
strictness: veryhigh

pep8:
options:
max-line-length: 110
disable:
- E203

pylint:
options:
max-line-length: 110
disable:
- too-many-locals
- too-many-statements
- too-many-branches

mccabe:
run: false

mypy:
run: true
66 changes: 66 additions & 0 deletions CONST_create_template/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
FROM camptocamp/geomapfish-tools:2.5.0.88 as builder

ENV LANGUAGES="en fr de"
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 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 \
dbsessions urllogin host_forward_host smtp c2c.base_path welcome_email \
lingua_extractor interfaces_config interfaces devserver_url api authentication intranet metrics pdfreport

COPY . /tmp/config/

RUN \
for lang in ${LANGUAGES}; \
do \
node /usr/bin/compile-catalog \
/opt/c2cgeoportal/geoportal/c2cgeoportal_geoportal/locale/${lang}/LC_MESSAGES/ngeo.po \
/opt/c2cgeoportal/geoportal/c2cgeoportal_geoportal/locale/${lang}/LC_MESSAGES/gmf.po \
/tmp/config/geoportal/geoportailv3_geoportal/locale/${lang}/LC_MESSAGES/geoportailv3_geoportal-client.po \
> /tmp/config/geoportal/geoportailv3_geoportal/static/${lang}.json; \
done && \
rm -rf /tmp/config/geoportal/geoportailv3_geoportal/locale

RUN \
cd /tmp/config/geoportal/ && \
c2c-template --vars ${VARS_FILE} \
--get-config geoportailv3_geoportal/config.yaml \
${CONFIG_VARS} && \
pykwalify --data-file geoportailv3_geoportal/config.yaml \
--schema-file CONST_config-schema.yaml && \
rm CONST_* vars.yaml

###############################################################################

FROM camptocamp/geomapfish-config:2.5.0.88

ARG PGSCHEMA
ENV PGSCHEMA=$PGSCHEMA

COPY --from=builder /tmp/config/ /tmp/config/

RUN \
if [ -e /tmp/config/mapserver ]; then mv /tmp/config/mapserver /etc/; fi && \
if [ -e /tmp/config/tilegeneration ]; then mv /tmp/config/tilegeneration /etc/; fi && \
if [ -e /tmp/config/qgisserver ]; then mv /tmp/config/qgisserver /etc/qgisserver; fi && \
mkdir --parent /usr/local/tomcat/webapps/ROOT/ && \
if [ -e /tmp/config/print ]; then mv /tmp/config/print/print-apps /usr/local/tomcat/webapps/ROOT/; fi && \
mv /tmp/config/geoportal/geoportailv3_geoportal/ /etc/geomapfish/ && \
chmod g+w -R /etc /usr/local/tomcat/webapps && \
adduser www-data root && \
sed 's#bind :80#bind *:443 ssl crt /etc/haproxy_dev/localhost.pem#g' /etc/haproxy/haproxy.cfg.tmpl \
> /etc/haproxy_dev/haproxy.cfg.tmpl && \
echo ' http-request set-header X-Forwarded-Proto https' >> /etc/haproxy_dev/haproxy.cfg.tmpl

VOLUME /etc/geomapfish \
/etc/mapserver \
/etc/qgisserver \
/etc/tilegeneration \
/usr/local/tomcat/webapps/ROOT/print-apps \
/etc/gunicorn \
/etc/haproxy_dev \
/etc/haproxy
29 changes: 29 additions & 0 deletions CONST_create_template/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
geoportailv3 project
===================

Read the `Documentation <https://camptocamp.github.io/c2cgeoportal/2.5/>`_

Checkout
--------

.. code::
git clone [email protected]:camptocamp/geoportailv3.git
cd geoportailv3
Build
-----

.. code::
./build
Run
---

.. code::
docker-compose up -d
.. Feel free to add project-specific things.
Loading

0 comments on commit e2a6ada

Please sign in to comment.