From ee9bd6b5d97dfc5f1b6e8805295f04c3dc25142c Mon Sep 17 00:00:00 2001 From: Lorenzo Natali Date: Fri, 23 Oct 2026 15:26:56 +0200 Subject: [PATCH] Fix release workflows not updating project template version and more (#13040) * Fix project template mapstore-services version and document INITIAL_ADMIN_PASSWORD for projects Release workflows updated the property in templates/web/pom.xml, but it lives in templates/pom.xml. * Keep project template version out of the backportable change (cherry picked from commit 459dd8ed4930ae42d3229ef224f58da025f9c0ca) --- .github/workflows/cut_major_branch.yml | 2 +- .github/workflows/post_release.yml | 2 +- .github/workflows/pre_release.yml | 2 +- docs/developer-guide/developing.md | 2 ++ .../developer-guide/initial-admin-password.md | 22 ++++++++++++++++++- .../project-creation-script.md | 2 +- 6 files changed, 27 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cut_major_branch.yml b/.github/workflows/cut_major_branch.yml index a10f1d0a6c4..6d38623a6d9 100644 --- a/.github/workflows/cut_major_branch.yml +++ b/.github/workflows/cut_major_branch.yml @@ -58,7 +58,7 @@ jobs: echo "Java packages versions updated from $OLD_JAVA_VERSION to $NEXT_JAVA_VERSION" ### increase dependency of project to new version echo "Updating project dependency to new version" - mvn versions:set-property -f project/standard/templates/web/pom.xml -Dproperty=mapstore-services.version -DnewVersion=$NEXT_JAVA_VERSION -DgenerateBackupPoms=false -DautoVersionSubmodules=true -Pprinting + mvn versions:set-property -f project/standard/templates/pom.xml -Dproperty=mapstore-services.version -DnewVersion=$NEXT_JAVA_VERSION -DgenerateBackupPoms=false -DautoVersionSubmodules=true -Pprinting # Increase release minor version echo "Updating project version to new version in package.json" npm version minor --git-tag-version=false diff --git a/.github/workflows/post_release.yml b/.github/workflows/post_release.yml index d70bf51cc42..6cfd8cc06a8 100644 --- a/.github/workflows/post_release.yml +++ b/.github/workflows/post_release.yml @@ -45,7 +45,7 @@ jobs: echo echo "Restoring snapshot version tp $SNAPSHOT_VERSION" mvn versions:set -DnewVersion=$SNAPSHOT_VERSION -DprocessAllModules -DgenerateBackupPoms=false -Pprinting,binary,printingbundle - mvn versions:set-property -f project/standard/templates/web/pom.xml -Dproperty=mapstore-services.version -DnewVersion=$SNAPSHOT_VERSION -DgenerateBackupPoms=false -DautoVersionSubmodules=true -Pprinting + mvn versions:set-property -f project/standard/templates/pom.xml -Dproperty=mapstore-services.version -DnewVersion=$SNAPSHOT_VERSION -DgenerateBackupPoms=false -DautoVersionSubmodules=true -Pprinting npm version patch --git-tag-version=false echo "Committing changes" find . -name 'pom.xml' | xargs git add diff --git a/.github/workflows/pre_release.yml b/.github/workflows/pre_release.yml index 97b36e09ce2..e9e3d2fb965 100644 --- a/.github/workflows/pre_release.yml +++ b/.github/workflows/pre_release.yml @@ -84,7 +84,7 @@ jobs: # Update project dependency echo "updating project pom.xml dependency from mapstore packages to version: $JAVA_MODULES_NEW_VERSION" - mvn versions:set-property -f project/standard/templates/web/pom.xml -Dproperty=mapstore-services.version -DnewVersion=$JAVA_MODULES_NEW_VERSION -DgenerateBackupPoms=false -DautoVersionSubmodules=true -Pprinting + mvn versions:set-property -f project/standard/templates/pom.xml -Dproperty=mapstore-services.version -DnewVersion=$JAVA_MODULES_NEW_VERSION -DgenerateBackupPoms=false -DautoVersionSubmodules=true -Pprinting # Update changelog echo "Updating changelog" update_changelog $LAST_MS_VERSION $NEW_MS_VERSION diff --git a/docs/developer-guide/developing.md b/docs/developer-guide/developing.md index 69afc3d9089..8322f429c17 100644 --- a/docs/developer-guide/developing.md +++ b/docs/developer-guide/developing.md @@ -206,6 +206,8 @@ export INITIAL_ADMIN_PASSWORD='' npm start ``` +On Windows use `set INITIAL_ADMIN_PASSWORD=` (`cmd`) or `$env:INITIAL_ADMIN_PASSWORD=''` (PowerShell) instead of `export`. + You can login as `admin` to set-up new users and access to all the features reserved to `ADMIN` users. See [Initial Administrator Password](initial-admin-password.md) for details. The database used by default in this mode is H2 on disk. You can find the files of the database in the directory `webapps/mapstore/` starting from your execution context. Check how to set-up database in the dedicated section of the documentation. diff --git a/docs/developer-guide/initial-admin-password.md b/docs/developer-guide/initial-admin-password.md index bb2ede7b60d..d620f6864ee 100644 --- a/docs/developer-guide/initial-admin-password.md +++ b/docs/developer-guide/initial-admin-password.md @@ -45,13 +45,33 @@ The variable must be available in the environment of the Java process running Ma INITIAL_ADMIN_PASSWORD: "${INITIAL_ADMIN_PASSWORD}" ``` -- Local development (`npm start` runs the backend too, which inherits the shell environment): +- Tomcat on Windows (e.g. in `bin\setenv.bat`): + + ```bat + set INITIAL_ADMIN_PASSWORD= + ``` + +- Local development (`npm start` runs the backend too, which inherits the shell environment). The same applies to MapStore projects created with the [project creation script](project-creation-script.md): ```sh export INITIAL_ADMIN_PASSWORD='' npm start ``` + On Windows, set the variable in the same terminal before running `npm start`. In `cmd`: + + ```bat + set INITIAL_ADMIN_PASSWORD= + npm start + ``` + + In PowerShell: + + ```powershell + $env:INITIAL_ADMIN_PASSWORD='' + npm start + ``` + Then log in with the user `admin` and the password you set. ## Security checks logged at start-up diff --git a/docs/developer-guide/project-creation-script.md b/docs/developer-guide/project-creation-script.md index ac5cb9b0fd1..437a45f07d7 100644 --- a/docs/developer-guide/project-creation-script.md +++ b/docs/developer-guide/project-creation-script.md @@ -72,7 +72,7 @@ If you create a *standard* project, you can customize it editing **js/app.jsx**: The following steps are: * `npm install` to download dependencies -* `npm start` to test the project +* `npm start` to test the project. Set the `INITIAL_ADMIN_PASSWORD` environment variable first, otherwise no `admin` account is created and you cannot log in (see [Initial Administrator Password](initial-admin-password.md)) * `./build.sh` to build the full .war ## Create a new project type