how to know if the process is a deploy or rollback inside a task ?
opened this issue · comments
Deleted user commented
I need to start the pm2 task only if I am in a rollback
` shipit.on('cleaned', function () {
# if 'rollback'
shipit.start('pm2-startOrReload');
# end
});`
thanks for feedback
Deleted user commented
I found a fix , but maybe there is some variable that could be set ?
` var deploymentFlag = false;
...
shipit.on('deploy', function() {
deploymentFlag = true;
});
...
shipit.on('cleaned', function () {
if (!deploymentFlag) {
shipit.start('pm2-startOrReload');
}
});
`
This is useful when a rollback process doesn't involve rebuilding the bundle.js file w Angular2/Webpack. Just rolling back to the already deployed release...
Greg Bergé commented
@Erwin16 you should use the "rollback" event