shipitjs/shipit

How to listen an event and run a remote command (blocking)?

Open

#271 opened on Jun 12, 2020

View on GitHub
 (1 comment) (0 reactions) (0 assignees)JavaScript (194 forks)batch import
help wanted

Repository metrics

Stars
 (5,331 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

The suggested solution is this:

  shipit.blTask('app:build', async () => {
    await shipit.remote(`cd ${shipit.releasePath} && yarn install && yarn build`);
  });

  shipit.on('updated', () => {
    shipit.start('app:build');
  });

But how to avoid the app:build task (which make sense only during deploy or rollback, using releasePath)?

  // Not blocking - NOT WORKING
  shipit.on('updated', async () => {
    await shipit.remote(`cd ${shipit.releasePath} && yarn install && yarn build`);
  });

  // Not blocking - NOT WORKING
  shipit.on('updated', () => {
    return shipit.remote(`cd ${shipit.releasePath} && yarn install && yarn build`);
  });

Contributor guide