Skip to content

Commit a00d669

Browse files
authored
geosolutions-it#9001 Made project branch parametric (geosolutions-it#9002)
* Made project branch parametric * Updated doc for createProject script
1 parent 68fb6d0 commit a00d669

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

createProject.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ const paramsDesc = [{
1313
name: 'projectType',
1414
"default": 'standard',
1515
validate: () => true
16+
}, {
17+
label: 'MapStore base branch (master):',
18+
name: 'branch',
19+
"default": 'master',
20+
validate: () => true
1621
}, {
1722
label: 'Project Name: ',
1823
name: 'projectName',
@@ -95,7 +100,7 @@ function doWork(params) {
95100
})
96101
.then(() => {
97102
process.stdout.write('git init\n');
98-
return project.updateSubmoduleBranch(params.outFolder);
103+
return project.updateSubmoduleBranch(params.outFolder, params.branch);
99104
})
100105
.then(() => {
101106
return project.createFirstCommit(params.outFolder);

docs/developer-guide/project-creation-script.md

+12-3
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,13 @@ npm install
3737
Finally, to create the project, use the following command:
3838

3939
```sh
40-
node ./createProject.js <projectType> <projectName> <projectVersion> <projectDescription> <gitRepositoryUrl> <outputFolder>
40+
node ./createProject.js
4141
```
4242

43-
Note that projectName and outputFolder are mandatory:
43+
The command line will ask some questions about the project to create. (You can press enter to accept the default value, indicated between parenthesis, or type a new one):
4444

4545
* **projectName**: short project name that will be used as the repository name on github, webapp path and name in package.json
46+
* **branch/tag**: the base branch/tag to use for the project (e.g. v2022.02.02, or master)
4647
* **projectType**: type of project to create, currently one type of projects is supported:
4748
* **standard**: is a copy of the standard MapStore project, ready to be used and customized
4849
* **projectVersion**: project version in package.json (X.Y.Z)
@@ -53,7 +54,15 @@ Note that projectName and outputFolder are mandatory:
5354
Usage:
5455

5556
```sh
56-
node ./createProject.js standard MyProject "1.0.0" "this is my awesome project" "" ../MY_PROJECT_NAME
57+
node ./createProject.js
58+
59+
Project Type (standard):
60+
MapStore base branch (master):v2023.01.01
61+
Project Name: my_project
62+
Project Version (1.0.0):
63+
Project Description (Project Name):
64+
Repository URL:
65+
Output folder: ../my_project
5766
```
5867

5968
At the end of the script execution, the given outputFolder will be populated by all the configuration files needed to start working on the project. Moreover, the local git repository will be initialized and the MapStore sub-module added and downloaded.

utility/projects/projectLib.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ const createFirstCommit = (outFolder) => {
6464
* @param {string} outFolder the folder where to apply the checkout
6565
* @return {Promise} the promise to continue the flow of project creation
6666
*/
67-
const updateSubmoduleBranch = (outFolder) => {
67+
const updateSubmoduleBranch = (outFolder, branch) => {
6868
const git = require('simple-git')();
6969
const gitProjectMs2 = require('simple-git')(`${outFolder}/MapStore2`);
7070

71-
const stableBranch = "2022.02.xx";
71+
const stableBranch = branch || "2023.01.xx";
7272

7373
return new Promise((resolve, reject) => {
7474
try {

0 commit comments

Comments
 (0)