shipitjs / shipit-deploy

Set of deployment tasks for Shipit based on git and rsync commands.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how to know if the process is a deploy or rollback inside a task ?

opened this issue · comments

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

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...

@Erwin16 you should use the "rollback" event