mirror of
https://github.com/Febbweiss/ProjectDeployer.git
synced 2026-03-04 22:25:38 +00:00
Fix: managing deployment failure
This commit is contained in:
@@ -24,3 +24,4 @@ zenorocha:clipboard
|
|||||||
simple:reactive-method
|
simple:reactive-method
|
||||||
vsivsi:job-collection
|
vsivsi:job-collection
|
||||||
ogamedia:timer
|
ogamedia:timer
|
||||||
|
less
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ iron:router@1.0.12
|
|||||||
iron:url@1.0.11
|
iron:url@1.0.11
|
||||||
jquery@1.11.4
|
jquery@1.11.4
|
||||||
launch-screen@1.0.4
|
launch-screen@1.0.4
|
||||||
|
less@2.5.1
|
||||||
livedata@1.0.15
|
livedata@1.0.15
|
||||||
logging@1.0.8
|
logging@1.0.8
|
||||||
meteor@1.1.10
|
meteor@1.1.10
|
||||||
|
|||||||
41
client/custom.less
Normal file
41
client/custom.less
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
// http://codepen.io/quickstep25/pen/BNOJXK
|
||||||
|
// OPTIONAL WELL STYLES
|
||||||
|
// VARS
|
||||||
|
@state-primary-bg: darken(#428bca, 6.5%);
|
||||||
|
@state-success-bg: #dff0d8;
|
||||||
|
@state-info-bg: #d9edf7;
|
||||||
|
@state-warning-bg: #fcf8e3;
|
||||||
|
@state-danger-bg: #f2dede;
|
||||||
|
// MIXINS - SHADOWS
|
||||||
|
.box-shadow(@arguments: none) {
|
||||||
|
-webkit-box-shadow: @arguments;
|
||||||
|
-moz-box-shadow: @arguments;
|
||||||
|
box-shadow: @arguments;
|
||||||
|
}
|
||||||
|
// MIXINS - GRADIENT BACKGROUND
|
||||||
|
.vertical(@start-color: #555; @end-color: #333; @start-percent: 0%; @end-percent: 100%) {
|
||||||
|
background: @start-color;
|
||||||
|
background-image: -moz-linear-gradient(left, @start-color @start-percent, @end-color @end-percent);
|
||||||
|
background-image: -webkit-linear-gradient(top, @start-color @start-percent, @end-color @end-percent);
|
||||||
|
background-image: -ms-linear-gradient(top, @start-color @start-percent, @end-color @end-percent);
|
||||||
|
background-image: -o-linear-gradient(top, @start-color @start-percent, @end-color @end-percent);
|
||||||
|
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(@start-percent, @start-color), color-stop(@end-percent, @end-color));
|
||||||
|
background-image: linear-gradient(to bottom, @start-color @start-percent, @end-color @end-percent);
|
||||||
|
}
|
||||||
|
// MIXINS - BOOTSTRAP - WELL VARIANT OVERRIDE
|
||||||
|
.well-variant(@state; @bg) {
|
||||||
|
.well.bg-@{state} {
|
||||||
|
color: darken(@bg, 65%);
|
||||||
|
background-color: @bg;
|
||||||
|
.vertical(@start-color: darken(@bg, 5%); @end-color: @bg);
|
||||||
|
border-color: darken(@bg, 10%);
|
||||||
|
@shadow: inset 0 1px 3px rgba(0,0,0,.05), 0 1px 0 rgba(255,255,255,.1);
|
||||||
|
.box-shadow(@shadow);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// WELLS - CONTEXTUAL BACKGROUNDS
|
||||||
|
.well-variant(primary; @state-primary-bg);
|
||||||
|
.well-variant(success; @state-success-bg);
|
||||||
|
.well-variant(info; @state-info-bg);
|
||||||
|
.well-variant(warning; @state-warning-bg);
|
||||||
|
.well-variant(danger; @state-danger-bg);
|
||||||
@@ -10,7 +10,20 @@ Template.deploymentDetails.helpers({
|
|||||||
},
|
},
|
||||||
running: function() {
|
running: function() {
|
||||||
var string = this.status;
|
var string = this.status;
|
||||||
|
if( !string ) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
return string.charAt(0).toUpperCase() + string.slice(1);
|
return string.charAt(0).toUpperCase() + string.slice(1);
|
||||||
|
},
|
||||||
|
deployment_status: function() {
|
||||||
|
switch( this.status ) {
|
||||||
|
case 'closed' :
|
||||||
|
return this.output[this.output.length - 1].error ? 'bg-danger' : 'bg-success';
|
||||||
|
case 'pending' :
|
||||||
|
return 'bg-info';
|
||||||
|
default :
|
||||||
|
return 'bg-default';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -39,10 +39,10 @@
|
|||||||
|
|
||||||
<template name="deploymentDetails">
|
<template name="deploymentDetails">
|
||||||
<div role="tabpanel" class="tab-pane" id="collapseDeployment{{index}}">
|
<div role="tabpanel" class="tab-pane" id="collapseDeployment{{index}}">
|
||||||
<div class="well">
|
<div class="well well-sm {{deployment_status}}">
|
||||||
<h4>Deployment # {{index}} - {{tm_cal timestamp}}</h4>
|
<h4>Deployment # {{index}} - {{tm_cal timestamp}}</h4>
|
||||||
{{#each output}}
|
{{#each output}}
|
||||||
<p>
|
<p class="{{error}}">
|
||||||
<samp>{{{format}}}</samp>
|
<samp>{{{format}}}</samp>
|
||||||
</p>
|
</p>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
|||||||
@@ -17,8 +17,9 @@ Job.processJobs('projectDeployerJobQueue', 'create_repository',
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
function() {
|
function() {
|
||||||
|
DeploymentService.update_status(deployment._id, 'closed', callback);
|
||||||
if( callback ) {
|
if( callback ) {
|
||||||
callback();
|
callback();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -61,8 +62,9 @@ Job.processJobs('projectDeployerJobQueue', 'update_repository',
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
function() {
|
function() {
|
||||||
|
DeploymentService.update_status(deployment._id, 'closed', callback);
|
||||||
if( callback ) {
|
if( callback ) {
|
||||||
callback();
|
callback();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -5,14 +5,16 @@ var exec = Npm.require('child_process').exec,
|
|||||||
exec(cmd,
|
exec(cmd,
|
||||||
options,
|
options,
|
||||||
Meteor.bindEnvironment(
|
Meteor.bindEnvironment(
|
||||||
function(error, stdout, stderr) {
|
function(errors, stdout, stderr) {
|
||||||
if( stdout !== '' ) {
|
if( stdout !== '' ) {
|
||||||
stdoutHandler(stdout);
|
stdoutHandler(stdout);
|
||||||
}
|
}
|
||||||
if( stderr != '' ) {
|
if( stderr != '' ) {
|
||||||
stderrHandler(stderr);
|
stderrHandler(stderr);
|
||||||
|
} else if( errors ) {
|
||||||
|
stderrHandler('Internal error');
|
||||||
}
|
}
|
||||||
callback();
|
callback(errors);
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@@ -40,7 +42,15 @@ CommandRunner = {
|
|||||||
|
|
||||||
options.cwd = replace(options.cwd, customs);
|
options.cwd = replace(options.cwd, customs);
|
||||||
|
|
||||||
execSync(command, options, bundle.stdout, bundle.stderr, function() {
|
execSync(command, options, bundle.stdout, bundle.stderr, function(errors) {
|
||||||
|
if( errors ) {
|
||||||
|
if( callback ) {
|
||||||
|
return callback();
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bundle.counter++;
|
bundle.counter++;
|
||||||
if( bundle.counter >= bundle.script.length ) {
|
if( bundle.counter >= bundle.script.length ) {
|
||||||
if( bundle.deploy_script && bundle.project.commands ) {
|
if( bundle.deploy_script && bundle.project.commands ) {
|
||||||
@@ -49,11 +59,7 @@ CommandRunner = {
|
|||||||
bundle.counter = 0;
|
bundle.counter = 0;
|
||||||
CommandRunner.commands(bundle, callback);
|
CommandRunner.commands(bundle, callback);
|
||||||
} else if( callback ) {
|
} else if( callback ) {
|
||||||
if( bundle.deployment ) {
|
callback();
|
||||||
DeploymentService.update_status(bundle.deployment._id, 'closed', callback);
|
|
||||||
} else {
|
|
||||||
callback();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
CommandRunner.run(bundle, callback);
|
CommandRunner.run(bundle, callback);
|
||||||
@@ -68,14 +74,18 @@ CommandRunner = {
|
|||||||
cwd: replace('%ROOT_CWD%/%CWD%', customs)
|
cwd: replace('%ROOT_CWD%/%CWD%', customs)
|
||||||
};
|
};
|
||||||
|
|
||||||
execSync(command, options, bundle.stdout, bundle.stderr, function() {
|
execSync(command, options, bundle.stdout, bundle.stderr, function(errors) {
|
||||||
|
if( errors ) {
|
||||||
|
if( callback ) {
|
||||||
|
return callback();
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bundle.counter++;
|
bundle.counter++;
|
||||||
if( bundle.counter >= bundle.script.length ) {
|
if( bundle.counter >= bundle.script.length ) {
|
||||||
if( bundle.deployment ) {
|
callback();
|
||||||
DeploymentService.update_status(bundle.deployment._id, 'closed', callback);
|
|
||||||
} else {
|
|
||||||
callback();
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
CommandRunner.commands(bundle, callback);
|
CommandRunner.commands(bundle, callback);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user