New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update node images #37

Merged
merged 2 commits into from Apr 6, 2018
Jump to file or symbol
Failed to load files and symbols.
+360 −105
Diff settings

Always

Just for now

@@ -30,30 +30,47 @@ if (!startupCommand) {
}
}

var finalCommand = null;

// No scripts.start; can we autodetect an app?
if (!startupCommand) {
var autos = ['bin/www', 'server.js', 'app.js', 'index.js', 'hostingstart.js'];
for (var i = 0; i < autos.length; i++) {
var filename = "/home/site/wwwroot/" + autos[i];
if (fs.existsSync(filename)) {
console.log("No startup command entered, but found " + filename);
startupCommand = "pm2 start " + filename+ " --no-daemon";
finalCommand = filename;
break;
}
}
}

// Still nothing, run the default static site
if (!startupCommand) {
if (!startupCommand && !finalCommand) {
console.log("No startup command or autodetected startup script " +
"found. Running default static site.");
startupCommand = "pm2 start " + DEFAULTAPP + " --no-daemon";
finalCommand = DEFAULTAPP;
}

if (startupCommand && fs.existsSync(startupCommand)) {
// Run with pm2
startupCommand = "pm2 start " + startupCommand + " --no-daemon";
if (finalCommand && fs.existsSync(finalCommand)) {
if (process.env.APPSVC_REMOTE_DEBUGGING == "TRUE")
{
if (process.env.APPSVC_REMOTE_DEBUGGING_BREAK == "TRUE")
{
startupCommand = "node --inspect=0.0.0.0:" + process.env.APPSVC_TUNNEL_PORT + " --debug-brk " + finalCommand;
}
else
{
startupCommand = "node --inspect=0.0.0.0:" + process.env.APPSVC_TUNNEL_PORT + " " + finalCommand;
}
}
else
{
// Run with pm2
startupCommand = "pm2 start " + finalCommand + " --no-daemon";
}
}


// Write to file
fs.writeFileSync(CMDFILE, startupCommand);
fs.writeFileSync(CMDFILE, startupCommand);
@@ -30,30 +30,47 @@ if (!startupCommand) {
}
}

var finalCommand = null;

// No scripts.start; can we autodetect an app?
if (!startupCommand) {
var autos = ['bin/www', 'server.js', 'app.js', 'index.js', 'hostingstart.js'];
for (var i = 0; i < autos.length; i++) {
var filename = "/home/site/wwwroot/" + autos[i];
if (fs.existsSync(filename)) {
console.log("No startup command entered, but found " + filename);
startupCommand = "pm2 start " + filename+ " --no-daemon";
finalCommand = filename;
break;
}
}
}

// Still nothing, run the default static site
if (!startupCommand) {
if (!startupCommand && !finalCommand) {
console.log("No startup command or autodetected startup script " +
"found. Running default static site.");
startupCommand = "pm2 start " + DEFAULTAPP + " --no-daemon";
finalCommand = DEFAULTAPP;
}

if (startupCommand && fs.existsSync(startupCommand)) {
// Run with pm2
startupCommand = "pm2 start " + startupCommand + " --no-daemon";
if (finalCommand && fs.existsSync(finalCommand)) {
if (process.env.APPSVC_REMOTE_DEBUGGING == "TRUE")
{
if (process.env.APPSVC_REMOTE_DEBUGGING_BREAK == "TRUE")
{
startupCommand = "node --inspect=0.0.0.0:" + process.env.APPSVC_TUNNEL_PORT + " --debug-brk " + finalCommand;
}
else
{
startupCommand = "node --inspect=0.0.0.0:" + process.env.APPSVC_TUNNEL_PORT + " " + finalCommand;
}
}
else
{
// Run with pm2
startupCommand = "pm2 start " + finalCommand + " --no-daemon";
}
}


// Write to file
fs.writeFileSync(CMDFILE, startupCommand);
fs.writeFileSync(CMDFILE, startupCommand);
@@ -30,30 +30,47 @@ if (!startupCommand) {
}
}

var finalCommand = null;

// No scripts.start; can we autodetect an app?
if (!startupCommand) {
var autos = ['bin/www', 'server.js', 'app.js', 'index.js', 'hostingstart.js'];
for (var i = 0; i < autos.length; i++) {
var filename = "/home/site/wwwroot/" + autos[i];
if (fs.existsSync(filename)) {
console.log("No startup command entered, but found " + filename);
startupCommand = "pm2 start " + filename+ " --no-daemon";
finalCommand = filename;
break;
}
}
}

// Still nothing, run the default static site
if (!startupCommand) {
if (!startupCommand && !finalCommand) {
console.log("No startup command or autodetected startup script " +
"found. Running default static site.");
startupCommand = "pm2 start " + DEFAULTAPP + " --no-daemon";
finalCommand = DEFAULTAPP;
}

if (startupCommand && fs.existsSync(startupCommand)) {
// Run with pm2
startupCommand = "pm2 start " + startupCommand + " --no-daemon";
if (finalCommand && fs.existsSync(finalCommand)) {
if (process.env.APPSVC_REMOTE_DEBUGGING == "TRUE")
{
if (process.env.APPSVC_REMOTE_DEBUGGING_BREAK == "TRUE")
{
startupCommand = "node --inspect=0.0.0.0:" + process.env.APPSVC_TUNNEL_PORT + " --debug-brk " + finalCommand;
}
else
{
startupCommand = "node --inspect=0.0.0.0:" + process.env.APPSVC_TUNNEL_PORT + " " + finalCommand;
}
}
else
{
// Run with pm2
startupCommand = "pm2 start " + finalCommand + " --no-daemon";
}
}


// Write to file
fs.writeFileSync(CMDFILE, startupCommand);
fs.writeFileSync(CMDFILE, startupCommand);
@@ -30,30 +30,47 @@ if (!startupCommand) {
}
}

var finalCommand = null;

// No scripts.start; can we autodetect an app?
if (!startupCommand) {
var autos = ['bin/www', 'server.js', 'app.js', 'index.js', 'hostingstart.js'];
for (var i = 0; i < autos.length; i++) {
var filename = "/home/site/wwwroot/" + autos[i];
if (fs.existsSync(filename)) {
console.log("No startup command entered, but found " + filename);
startupCommand = "pm2 start " + filename+ " --no-daemon";
finalCommand = filename;
break;
}
}
}

// Still nothing, run the default static site
if (!startupCommand) {
if (!startupCommand && !finalCommand) {
console.log("No startup command or autodetected startup script " +
"found. Running default static site.");
startupCommand = "pm2 start " + DEFAULTAPP + " --no-daemon";
finalCommand = DEFAULTAPP;
}

if (startupCommand && fs.existsSync(startupCommand)) {
// Run with pm2
startupCommand = "pm2 start " + startupCommand + " --no-daemon";
if (finalCommand && fs.existsSync(finalCommand)) {
if (process.env.APPSVC_REMOTE_DEBUGGING == "TRUE")
{
if (process.env.APPSVC_REMOTE_DEBUGGING_BREAK == "TRUE")
{
startupCommand = "node --inspect=0.0.0.0:" + process.env.APPSVC_TUNNEL_PORT + " --debug-brk " + finalCommand;
}
else
{
startupCommand = "node --inspect=0.0.0.0:" + process.env.APPSVC_TUNNEL_PORT + " " + finalCommand;
}
}
else
{
// Run with pm2
startupCommand = "pm2 start " + finalCommand + " --no-daemon";
}
}


// Write to file
fs.writeFileSync(CMDFILE, startupCommand);
fs.writeFileSync(CMDFILE, startupCommand);
@@ -30,30 +30,47 @@ if (!startupCommand) {
}
}

var finalCommand = null;

// No scripts.start; can we autodetect an app?
if (!startupCommand) {
var autos = ['bin/www', 'server.js', 'app.js', 'index.js', 'hostingstart.js'];
for (var i = 0; i < autos.length; i++) {
var filename = "/home/site/wwwroot/" + autos[i];
if (fs.existsSync(filename)) {
console.log("No startup command entered, but found " + filename);
startupCommand = "pm2 start " + filename+ " --no-daemon";
finalCommand = filename;
break;
}
}
}

// Still nothing, run the default static site
if (!startupCommand) {
if (!startupCommand && !finalCommand) {
console.log("No startup command or autodetected startup script " +
"found. Running default static site.");
startupCommand = "pm2 start " + DEFAULTAPP + " --no-daemon";
finalCommand = DEFAULTAPP;
}

if (startupCommand && fs.existsSync(startupCommand)) {
// Run with pm2
startupCommand = "pm2 start " + startupCommand + " --no-daemon";
if (finalCommand && fs.existsSync(finalCommand)) {
if (process.env.APPSVC_REMOTE_DEBUGGING == "TRUE")
{
if (process.env.APPSVC_REMOTE_DEBUGGING_BREAK == "TRUE")
{
startupCommand = "node --inspect=0.0.0.0:" + process.env.APPSVC_TUNNEL_PORT + " --debug-brk " + finalCommand;
}
else
{
startupCommand = "node --inspect=0.0.0.0:" + process.env.APPSVC_TUNNEL_PORT + " " + finalCommand;
}
}
else
{
// Run with pm2
startupCommand = "pm2 start " + finalCommand + " --no-daemon";
}
}


// Write to file
fs.writeFileSync(CMDFILE, startupCommand);
fs.writeFileSync(CMDFILE, startupCommand);
@@ -30,30 +30,47 @@ if (!startupCommand) {
}
}

var finalCommand = null;

// No scripts.start; can we autodetect an app?
if (!startupCommand) {
var autos = ['bin/www', 'server.js', 'app.js', 'index.js', 'hostingstart.js'];
for (var i = 0; i < autos.length; i++) {
var filename = "/home/site/wwwroot/" + autos[i];
if (fs.existsSync(filename)) {
console.log("No startup command entered, but found " + filename);
startupCommand = "pm2 start " + filename+ " --no-daemon";
finalCommand = filename;
break;
}
}
}

// Still nothing, run the default static site
if (!startupCommand) {
if (!startupCommand && !finalCommand) {
console.log("No startup command or autodetected startup script " +
"found. Running default static site.");
startupCommand = "pm2 start " + DEFAULTAPP + " --no-daemon";
finalCommand = DEFAULTAPP;
}

if (startupCommand && fs.existsSync(startupCommand)) {
// Run with pm2
startupCommand = "pm2 start " + startupCommand + " --no-daemon";
if (finalCommand && fs.existsSync(finalCommand)) {
if (process.env.APPSVC_REMOTE_DEBUGGING == "TRUE")
{
if (process.env.APPSVC_REMOTE_DEBUGGING_BREAK == "TRUE")
{
startupCommand = "node --inspect=0.0.0.0:" + process.env.APPSVC_TUNNEL_PORT + " --debug-brk " + finalCommand;
}
else
{
startupCommand = "node --inspect=0.0.0.0:" + process.env.APPSVC_TUNNEL_PORT + " " + finalCommand;
}
}
else
{
// Run with pm2
startupCommand = "pm2 start " + finalCommand + " --no-daemon";
}
}


// Write to file
fs.writeFileSync(CMDFILE, startupCommand);
fs.writeFileSync(CMDFILE, startupCommand);
@@ -30,30 +30,47 @@ if (!startupCommand) {
}
}

var finalCommand = null;

// No scripts.start; can we autodetect an app?
if (!startupCommand) {
var autos = ['bin/www', 'server.js', 'app.js', 'index.js', 'hostingstart.js'];
for (var i = 0; i < autos.length; i++) {
var filename = "/home/site/wwwroot/" + autos[i];
if (fs.existsSync(filename)) {
console.log("No startup command entered, but found " + filename);
startupCommand = "pm2 start " + filename+ " --no-daemon";
finalCommand = filename;
break;
}
}
}

// Still nothing, run the default static site
if (!startupCommand) {
if (!startupCommand && !finalCommand) {
console.log("No startup command or autodetected startup script " +
"found. Running default static site.");
startupCommand = "pm2 start " + DEFAULTAPP + " --no-daemon";
finalCommand = DEFAULTAPP;
}

if (startupCommand && fs.existsSync(startupCommand)) {
// Run with pm2
startupCommand = "pm2 start " + startupCommand + " --no-daemon";
if (finalCommand && fs.existsSync(finalCommand)) {
if (process.env.APPSVC_REMOTE_DEBUGGING == "TRUE")
{
if (process.env.APPSVC_REMOTE_DEBUGGING_BREAK == "TRUE")
{
startupCommand = "node --inspect-brk=0.0.0.0:" + process.env.APPSVC_TUNNEL_PORT + " " + finalCommand;
}
else
{
startupCommand = "node --inspect=0.0.0.0:" + process.env.APPSVC_TUNNEL_PORT + " " + finalCommand;
}
}
else
{
// Run with pm2
startupCommand = "pm2 start " + finalCommand + " --no-daemon";
}
}


// Write to file
fs.writeFileSync(CMDFILE, startupCommand);
fs.writeFileSync(CMDFILE, startupCommand);
Oops, something went wrong.
ProTip! Use n and p to navigate between commits in a pull request.