From 3fe2854bf137a396442548d47504a32f134dddee Mon Sep 17 00:00:00 2001 From: Ruben Reusser Date: Tue, 3 Mar 2020 09:12:42 -0800 Subject: [PATCH] #10: fix for missing port management when installing a publisher --- bin/percli-server-install | 4 ++-- lib/tasks.js | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/percli-server-install b/bin/percli-server-install index 78647c9..2f6c2d9 100755 --- a/bin/percli-server-install +++ b/bin/percli-server-install @@ -94,7 +94,7 @@ async function serverInstall() { slingproperties = `sling.run.modes=publish,notshared\norg.osgi.service.http.port=${port}` } else if(args.author) { name = 'author-'+port - slingproperties = `sling.run.modes=authir,notshared\norg.osgi.service.http.port=${port}` + slingproperties = `sling.run.modes=author,notshared\norg.osgi.service.http.port=${port}` } else { slingproperties = `org.osgi.service.http.port=${port}` } @@ -110,7 +110,7 @@ async function serverInstall() { var packagesList = await getPackageList() // step 6 - await installPackages(packagesList) + await installPackages(packagesList, port) } } catch (err) { diff --git a/lib/tasks.js b/lib/tasks.js index 4075e30..77b77e5 100644 --- a/lib/tasks.js +++ b/lib/tasks.js @@ -380,7 +380,7 @@ module.exports = { * @param {string} line - the line * @return {string} the maven execution */ - installFile: async function(mvn, line) { + installFile: async function(mvn, line, port) { // return mvn.execute( // ['io.wcm.maven.plugins:wcmio-content-package-maven-plugin:install'], // { @@ -389,7 +389,7 @@ module.exports = { // "vault.serviceURL": "http://localhost:"+port+"/bin/cpm/package.service.html" // } // ) - return spawnSync( 'node', [__dirname+'/../node_modules/@peregrinecms/slingpackager/bin/slingpackager', 'upload','-i', 'out/'+line] ,{ + return spawnSync( 'node', [__dirname+'/../node_modules/@peregrinecms/slingpackager/bin/slingpackager', 'upload','-i', '--server', 'http://localhost:'+port, 'out/'+line] ,{ shell: true, stdio: 'inherit' }) @@ -399,10 +399,10 @@ module.exports = { * Installs the packages * @param {array} packages - the packages */ - installPackages: async function(packages){ + installPackages: async function(packages, port){ let mvn = maven.create() for(let i = 0; i < packages.length; i++) { - await module.exports.installFile(mvn, packages[i]) + await module.exports.installFile(mvn, packages[i], port) } },