Browse Source

Merge branch 'master' of http://git.bbh/chess/elxr

master
pb 2 years ago
parent
commit
4b7f6f4f0f
1 changed files with 23 additions and 49 deletions
  1. 23
    49
      index.js

+ 23
- 49
index.js View File

@@ -1895,6 +1895,7 @@ var op = {

}
, 'start': (args) => {
// Usage : elxr start {{instanceName=elixir}} {{all||server||client||{{microserviceName=elixir||express}}}}

var label = clioverrides.cmd
var env = Object.assign({}, process.env); // Shallow clone it.
@@ -1948,56 +1949,29 @@ var op = {
if(clioverrides.node_env === 'development') {
env.DEBUG = 'loopback:connector:' + dbForLabel(label)
startFn( { debugport : 9228, script : 'elixir/server.js', name : 'Elixir Loopback Server', path : '/' + 'elixir-server'
, pidstore : '.express.server.pid'
} )
startFn( { debugport : 9227, script : 'bin/www', name : 'Express Server', path : '/' + 'chess-server-lib/server'
, pidstore : '.elixir-server.elixir.server.pid'
} )
if(!processedArgs._[2]) processedArgs._[2] = 'all'
if(processedArgs._[2] === 'server' || processedArgs._[2] === 'all'
|| processedArgs._[2] === 'elixir' // specific microservice name.
) {
startFn( { debugport : 9228, script : 'elixir/server.js', name : 'Elixir Loopback Server', path : '/' + 'elixir-server'
, pidstore : '.elixir-server.elixir.server.pid'
} )
}
if(processedArgs._[2] === 'server' || processedArgs._[2] === 'all'
|| processedArgs._[2] === 'express' // specific microservice name.
) {
startFn( { debugport : 9227, script : 'bin/www', name : 'Express Server', path : '/' + 'chess-server-lib/server'
, pidstore : '.express.server.pid'
} )
}
// cmd = 'node'()

// nodeShellExec('node', ['--inspect=9226', ' bin/www'], {
// inherit : true,
// shell: true, detached: true,
// cwd : 'qms/server',
// env: env,
// shell : true
// })

// nodeShellExec('ember', ['s'], {
// // inherit : true,
// shell: true, detached: true,
// cwd : 'client/',
// env: env
// })
startFn( {
name : 'Elixir Ember Client', path : '/' + 'client'
, cmd : ['node_modules/ember-cli/bin/ember', ['s']]
, pidstore : '.client.server.pid'
} )

// console.log('Starting Elixir Ember Client');
// var cmd = ['ember', ['s']]
// var childPromise = nodeShellExec(...cmd, {
// // var childPromise = nodeShellExec('node', ['--inspect=9227', './node_modules/.bin/ember', 's'], {
// // PB : TODO -- ember debugging.
// // inherit : true,
// shell: true,
// detached: true,
// stdio: 'ignore',
// cwd: instanceroot + '/' + 'client'
// , env: env
// })
// // .catch(e=>console.error(e))

// child = childPromise.process;
// if (typeof child.pid !== 'undefined') {
// console.log(`started Elixir Client Host PID(${child.pid}) : NODE_ENV=${process.NODE_ENV} ${cmd}`);
// fs.writeFileSync('.client.server.pid', '' + child.pid, {
// encoding: 'utf8'
// })
// }
if(processedArgs._[2] === 'client' || processedArgs._[2] === 'all') {
startFn( {
name : 'Elixir Ember Client', path : '/' + 'client'
, cmd : ['node_modules/ember-cli/bin/ember', ['s']]
, pidstore : '.client.server.pid'
} )
}
}

}

Loading…
Cancel
Save