-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Continuous integration
committed
Jan 20, 2025
1 parent
fdc0c92
commit 7a579e7
Showing
18 changed files
with
397 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
Oops, something went wrong.