Comparing version 0.3.20 to 0.4.0
@@ -65,6 +65,7 @@ "use strict"; | ||
.option( '--sshUser <sshUser>', 'The SSH user to use for remote operations. This user must be able to run sudo commands without a password prompt.' ) | ||
.option( '--loggingMode <loggingMode>', 'The mode for logging. By default, the mode is \'pipe\', which means stdout and stderr are piped into the log file. You can also set \'file\' which means that the NODE_LOG env var will be set to the file name, and it is up to the application to log to it.' ) | ||
.description( 'Add a target deployment environment for an application already in the repository.' ) | ||
.action( function( appName, envName, program ) { | ||
self.addEnv( appName, envName, program.user || null, program.daemon || null, program.sshKey || null, program.sshUser || null, function( err ) { | ||
self.addEnv( appName, envName, program.user || null, program.daemon || null, program.sshKey || null, program.sshUser || null, program.loggingMode || null, function( err ) { | ||
if ( err ) { | ||
@@ -204,3 +205,4 @@ console.error( err ); | ||
'sshKey', | ||
'sshUser' | ||
'sshUser', | ||
'loggingMode' | ||
]; | ||
@@ -335,3 +337,3 @@ | ||
DaemonixCli.prototype.addEnv = function( appName, envName, user, daemon, sshKey, sshUser, done ) { | ||
DaemonixCli.prototype.addEnv = function( appName, envName, user, daemon, sshKey, sshUser, loggingMode, done ) { | ||
@@ -378,2 +380,8 @@ var self = this; | ||
if ( loggingMode ) { | ||
app.env[envName].loggingMode = loggingMode; | ||
} else if ( app.env[envName].hasOwnProperty( 'loggingMode' ) ) { | ||
delete app.env[envName].loggingMode; | ||
} | ||
if ( !Array.isArray( app.env[envName].nodes ) ) { | ||
@@ -380,0 +388,0 @@ app.env[envName].nodes = []; |
@@ -256,2 +256,8 @@ "use strict"; | ||
if ( self._config.hasOwnProperty( 'loggingMode' ) && self._config.loggingMode === 'file' ) { | ||
self._config.stdout = '/dev/null'; | ||
} else { | ||
self._config.stdout = '$NODE_LOG_FILE'; | ||
} | ||
for ( var field in self._config ) { | ||
@@ -258,0 +264,0 @@ if ( self._config.hasOwnProperty( field ) ) { |
@@ -19,2 +19,3 @@ # | ||
env NODE_LOG_DIR="/opt/var/log/{{daemon}}" | ||
env NODE_LOG_FILE="/opt/var/log/{{daemon}}/app.log" | ||
env NODE_EXEC="server.js" | ||
@@ -38,2 +39,2 @@ env NODE_BIN="/opt/apps/{{daemon}}/current/nvm/vCurrent/bin/node" | ||
exec $NODE_BIN $NODE_EXEC >> $NODE_LOG_DIR/app.log 2>&1 | ||
exec $NODE_BIN $NODE_EXEC >> {{stdout}} 2>&1 |
{ | ||
"name": "daemonix", | ||
"description": "Daemonix is a tool for deploying and managing NodeJS systems as a daemon in Linux/Unix environments.", | ||
"version": "0.3.20", | ||
"version": "0.4.0", | ||
"author": "Anthony Hildoer <anthony@bluerival.com>", | ||
@@ -6,0 +6,0 @@ "repository": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
52117
1564