Skip to content

Commit

Permalink
Interrupted upgrade to 2.8.1.181
Browse files Browse the repository at this point in the history
  • Loading branch information
Continuous integration committed Jan 20, 2025
1 parent fdc0c92 commit 7a579e7
Show file tree
Hide file tree
Showing 18 changed files with 397 additions and 6 deletions.
6 changes: 6 additions & 0 deletions .UPGRADE_INSTRUCTIONS
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
The `create.diff` file is a recommendation of the changes that you should apply to your project.
You should apply the changes shown in the diff file on `CONST_create_template/<file>` on your project's `<file>`.
Some advice to be more efficient: if the changes on a file concern a file that you never customize, you can simply copy the new file from `CONST_create_template` (`cp CONST_create_template/<file> <file>`).You can furthermore add this file to the `unmanaged_files` section of the `project.yaml` file, to avoid its contents appearing in the diff file for the next upgrade.
Note that you can also apply them using: git apply --3way create.diff
To continue, type:
./upgrade 2.8.1.181 11
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,14 @@
!geoportal/geomapfish_geoportal/static
!geoportal/geomapfish_geoportal/locale
geoportal/geomapfish_geoportal/locale/*.pot
<<<<<<< ours
!webcomponents
!package.json
!package-lock.json
!tsconfig.json
!vite.config.ts
=======
!geoportal/geomapfish_geoportal/authentication.py
!geoportal/geomapfish_geoportal/multi_tenant.py
!geoportal/geomapfish_geoportal/dev.py
>>>>>>> theirs
61 changes: 61 additions & 0 deletions .upgrade.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
# The list (by include, exclude) of default files that will not be overwritten by the upgrade.
# That that can be extended with managed_files or reduced with unmanaged_files from the
# project.yaml file in the project root directory.
default_project_file:
include:
- geoportal/setup\.py
- geoportal/vars\.yaml
- geoportal/Makefile
- geoportal/geomapfish_geoportal/__init__\.py
- geoportal/geomapfish_geoportal/templates/.*
- geoportal/geomapfish_geoportal/locale/.*
- geoportal/geomapfish_geoportal/static/.*
- geoportal/geomapfish_geoportal/static-ngeo/.*
- print/print-apps/.*
- mapserver/.*
- tilegeneration/config\.yaml\.tmpl
- project\.yaml
- docker-compose\.yaml
- env\.project
- README\.rst
- \.github/workflows/main\.yaml
- \.github/workflows/rebuild\.yaml
exclude:
- mapserver/demo\.map\.tmpl
- geoportal/geomapfish_geoportal/static-ngeo/js/apps/image/favicon\.ico

# Files ignored when creating the diff files => will just be left untouched.
no_diff:
- .*\.po
- CONST_.+
- .*/CONST_.+

# Files that will be present in the CONST_create_template but will not be considered in the upgrade.
# Used to provide the alt applications => does not disturb the user during upgrade.
extra:
- geoportal/geomapfish_geoportal/static-ngeo/js/apps/mobile_alt\.html\.ejs
- geoportal/geomapfish_geoportal/static-ngeo/js/apps/oeedit\.html\.ejs
- geoportal/geomapfish_geoportal/static-ngeo/js/apps/Controllermobile_alt\.js
- geoportal/geomapfish_geoportal/static-ngeo/js/apps/Controlleroeedit\.js
- geoportal/geomapfish_geoportal/static-ngeo/js/apps/sass/mobile_alt\.scss
- geoportal/geomapfish_geoportal/static-ngeo/js/apps/sass/vars_mobile_alt\.scss
- geoportal/geomapfish_geoportal/static-ngeo/js/apps/sass/oeedit\.scss
- geoportal/geomapfish_geoportal/static-ngeo/js/apps/sass/vars_oeedit\.scss
- geoportal/interfaces/desktop_alt\.html\.mako
- geoportal/geomapfish_geoportal/static/images/background-layer-button\.png
- tests/test_testapp.py

# Automated file system operations:
# Remove some files or directories:
# - action: remove
# paths:
# - <one file or directory>
# Move a file:
# - action: move
# from: <src file>
# to: <dst file>
upgrade_files:
- action: remove
paths:
- geoportal/tools/extract-messages.js
3 changes: 3 additions & 0 deletions CONST_create_template/.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@
!geoportal/geomapfish_geoportal/static
!geoportal/geomapfish_geoportal/locale
geoportal/geomapfish_geoportal/locale/*.pot
!geoportal/geomapfish_geoportal/authentication.py
!geoportal/geomapfish_geoportal/multi_tenant.py
!geoportal/geomapfish_geoportal/dev.py
1 change: 1 addition & 0 deletions CONST_create_template/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ ENV PGSCHEMA=$PGSCHEMA

RUN \
cd /tmp/config/geoportal/ \
&& [ "${SIMPLE}" == "TRUE" ] || rm -f geomapfish_geoportal/*.py \
&& c2c-template --vars ${VARS_FILE} \
--get-config geomapfish_geoportal/config.yaml \
${CONFIG_VARS} \
Expand Down
6 changes: 3 additions & 3 deletions CONST_create_template/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PROJECT_PUBLIC_URL=https://example.camptocamp.com/
PROJECT_PUBLIC_URL?=https://example.camptocamp.com/
DUMP_FILE=dump.backup
PACKAGE=geomapfish
LANGUAGES=en fr de it
Expand All @@ -13,10 +13,10 @@ help: ## Display this help message

.PHONY: update-po-from-url
update-po-from-url: ## Update the po files from the URL provide by PROJECT_PUBLIC_URL
curl --fail --retry 5 --retry-delay 1 \
curl ${CURL_ARGS} --fail --retry 5 --retry-delay 1 \
$(PROJECT_PUBLIC_URL)locale.pot > geoportal/${PACKAGE}_geoportal/locale/${PACKAGE}_geoportal-client${SUFFIX}.pot
sed -i '/^"POT-Creation-Date: /d' geoportal/${PACKAGE}_geoportal/locale/${PACKAGE}_geoportal-client${SUFFIX}.pot
docker-compose run --rm -T tools update-po-only `id --user` `id --group` $(LANGUAGES)
docker-compose run --rm -T --env=SUFFIX=${SUFFIX} tools update-po-only `id --user` `id --group` $(LANGUAGES)

.PHONY: update-po
update-po: ## Update the po files from the running composition
Expand Down
2 changes: 2 additions & 0 deletions CONST_create_template/docker-compose-lib.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,8 @@ services:
- C2CWSGIUTILS_LOG_LEVEL
- LOG_TYPE
- C2CGEOPORTAL_THEME_TIMEOUT=300
# For multi tenant
- DEFAULT_PREFIX

geoportal-advance:
image: ${DOCKER_BASE}-geoportal:${DOCKER_TAG}
Expand Down
2 changes: 1 addition & 1 deletion CONST_create_template/env.default
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Default values for c2cgeoportal
GEOMAPFISH_VERSION=2.8.1.180
GEOMAPFISH_VERSION=2.8.1.181
GEOMAPFISH_MAIN_VERSION=2.8
GEOMAPFISH_MAIN_MINOR_VERSION=2.8.1
COMPOSE_PROJECT_NAME=geomapfish
Expand Down
3 changes: 3 additions & 0 deletions CONST_create_template/env.project
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,6 @@ C2C_AUTH_GITHUB_SCOPE=repo
#C2C_AUTH_GITHUB_SECRET=<secret>
#C2C_AUTH_GITHUB_PROXY_URL=https://geoservicies.camptocamp.com/redirect
C2C_USE_SESSION=true

# For multi-tenant
DEFAULT_PREFIX=unknown
44 changes: 44 additions & 0 deletions CONST_create_template/scripts/multi-tenant-update-po
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/usr/bin/env python3

import argparse
import os
import subprocess

import yaml


def _main() -> None:
parser = argparse.ArgumentParser(
description="\n".join(
[
"Update the po files in multi tenants mode",
"",
"Using the information available in the tenants.yaml file.",
]
),
formatter_class=argparse.RawDescriptionHelpFormatter,
)
parser.parse_args()

with open("tenants.yaml", "r") as tenants_file:
tenants = yaml.safe_load(tenants_file.read())

for name, tenant in tenants.get("tenants", {}).items():
print(f"Update localization for tenant {name}.")
subprocess.run(
[
"make",
"update-po-from-url",
],
check=True,
env={
**os.environ,
"PROJECT_PUBLIC_URL": tenant["public_url"],
"SUFFIX": tenant["suffix"],
"CURL_ARGS": tenant.get("curl_args", ""),
},
)


if __name__ == "__main__":
_main()
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ ENV PGSCHEMA=$PGSCHEMA

RUN \
cd /tmp/config/geoportal/ \
&& [ "${SIMPLE}" == "TRUE" ] || rm -f geomapfish_geoportal/*.py \
&& c2c-template --vars ${VARS_FILE} \
--get-config geomapfish_geoportal/config.yaml \
${CONFIG_VARS} \
Expand Down
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<<<<<<< ours
PROJECT_PUBLIC_URL=https://geomapfish-demo-2-8.camptocamp.com/
DUMP_FILE=data/prod-2-7.dump
=======
PROJECT_PUBLIC_URL?=https://example.camptocamp.com/
DUMP_FILE=dump.backup
>>>>>>> theirs
PACKAGE=geomapfish
LANGUAGES=en fr de it

Expand All @@ -13,10 +18,14 @@ help: ## Display this help message

.PHONY: update-po-from-url
update-po-from-url: ## Update the po files from the URL provide by PROJECT_PUBLIC_URL
curl --fail --retry 5 --retry-delay 1 \
curl ${CURL_ARGS} --fail --retry 5 --retry-delay 1 \
$(PROJECT_PUBLIC_URL)locale.pot > geoportal/${PACKAGE}_geoportal/locale/${PACKAGE}_geoportal-client${SUFFIX}.pot
sed -i '/^"POT-Creation-Date: /d' geoportal/${PACKAGE}_geoportal/locale/${PACKAGE}_geoportal-client${SUFFIX}.pot
<<<<<<< ours
docker compose run --rm -T tools update-po-only `id --user` `id --group` $(LANGUAGES)
=======
docker-compose run --rm -T --env=SUFFIX=${SUFFIX} tools update-po-only `id --user` `id --group` $(LANGUAGES)
>>>>>>> theirs

.PHONY: update-po
update-po: ## Update the po files from the running composition
Expand Down
57 changes: 57 additions & 0 deletions create.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
diff --git a/.dockerignore b/.dockerignore
index 589f696..e0bfe2c 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -12,3 +12,6 @@
!geoportal/geomapfish_geoportal/static
!geoportal/geomapfish_geoportal/locale
geoportal/geomapfish_geoportal/locale/*.pot
+!geoportal/geomapfish_geoportal/authentication.py
+!geoportal/geomapfish_geoportal/multi_tenant.py
+!geoportal/geomapfish_geoportal/dev.py
diff --git a/Dockerfile b/Dockerfile
index a16720e..67fb5ba 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -28,6 +28,7 @@ ENV PGSCHEMA=$PGSCHEMA

RUN \
cd /tmp/config/geoportal/ \
+ && [ "${SIMPLE}" == "TRUE" ] || rm -f geomapfish_geoportal/*.py \
&& c2c-template --vars ${VARS_FILE} \
--get-config geomapfish_geoportal/config.yaml \
${CONFIG_VARS} \
diff --git a/Makefile b/Makefile
index bfdcbb7..5c47f4f 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-PROJECT_PUBLIC_URL=https://example.camptocamp.com/
+PROJECT_PUBLIC_URL?=https://example.camptocamp.com/
DUMP_FILE=dump.backup
PACKAGE=geomapfish
LANGUAGES=en fr de it
@@ -13,10 +13,10 @@ help: ## Display this help message

.PHONY: update-po-from-url
update-po-from-url: ## Update the po files from the URL provide by PROJECT_PUBLIC_URL
- curl --fail --retry 5 --retry-delay 1 \
+ curl ${CURL_ARGS} --fail --retry 5 --retry-delay 1 \
$(PROJECT_PUBLIC_URL)locale.pot > geoportal/${PACKAGE}_geoportal/locale/${PACKAGE}_geoportal-client${SUFFIX}.pot
sed -i '/^"POT-Creation-Date: /d' geoportal/${PACKAGE}_geoportal/locale/${PACKAGE}_geoportal-client${SUFFIX}.pot
- docker-compose run --rm -T tools update-po-only `id --user` `id --group` $(LANGUAGES)
+ docker-compose run --rm -T --env=SUFFIX=${SUFFIX} tools update-po-only `id --user` `id --group` $(LANGUAGES)

.PHONY: update-po
update-po: ## Update the po files from the running composition
diff --git a/env.project b/env.project
index d3ef889..701c176 100644
--- a/env.project
+++ b/env.project
@@ -67,3 +67,6 @@ C2C_AUTH_GITHUB_SCOPE=repo
#C2C_AUTH_GITHUB_SECRET=<secret>
#C2C_AUTH_GITHUB_PROXY_URL=https://geoservicies.camptocamp.com/redirect
C2C_USE_SESSION=true
+
+# For multi-tenant
+DEFAULT_PREFIX=unknown
2 changes: 2 additions & 0 deletions docker-compose-lib.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,8 @@ services:
- C2CWSGIUTILS_LOG_LEVEL
- LOG_TYPE
- C2CGEOPORTAL_THEME_TIMEOUT=300
# For multi tenant
- DEFAULT_PREFIX

geoportal-advance:
image: ${DOCKER_BASE}-geoportal:${DOCKER_TAG}
Expand Down
2 changes: 1 addition & 1 deletion env.default
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Default values for c2cgeoportal
GEOMAPFISH_VERSION=2.8.1.180
GEOMAPFISH_VERSION=2.8.1.181
GEOMAPFISH_MAIN_VERSION=2.8
GEOMAPFISH_MAIN_MINOR_VERSION=2.8.1
COMPOSE_PROJECT_NAME=geomapfish
Expand Down
5 changes: 5 additions & 0 deletions env.project
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ C2C_AUTH_GITHUB_SCOPE=repo
C2C_AUTH_GITHUB_PROXY_URL=https://geoservicies.camptocamp.com/redirect
C2C_USE_SESSION=true

<<<<<<< ours
C2C_LOG_VIEW_ENABLED=TRUE
C2C_SQL_PROFILER_ENABLED=TRUE
C2C_DEBUG_VIEW_ENABLED=TRUE
Expand All @@ -86,3 +87,7 @@ BASICAUTH=True
# Custom Swisscom heatmap plugin
SWISSCOM_CLIENT_ID=setme
SWISSCOM_CLIENT_SECRET=setme
=======
# For multi-tenant
DEFAULT_PREFIX=unknown
>>>>>>> theirs
44 changes: 44 additions & 0 deletions scripts/multi-tenant-update-po
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/usr/bin/env python3

import argparse
import os
import subprocess

import yaml


def _main() -> None:
parser = argparse.ArgumentParser(
description="\n".join(
[
"Update the po files in multi tenants mode",
"",
"Using the information available in the tenants.yaml file.",
]
),
formatter_class=argparse.RawDescriptionHelpFormatter,
)
parser.parse_args()

with open("tenants.yaml", "r") as tenants_file:
tenants = yaml.safe_load(tenants_file.read())

for name, tenant in tenants.get("tenants", {}).items():
print(f"Update localization for tenant {name}.")
subprocess.run(
[
"make",
"update-po-from-url",
],
check=True,
env={
**os.environ,
"PROJECT_PUBLIC_URL": tenant["public_url"],
"SUFFIX": tenant["suffix"],
"CURL_ARGS": tenant.get("curl_args", ""),
},
)


if __name__ == "__main__":
_main()
Loading

0 comments on commit 7a579e7

Please sign in to comment.