shipitjs/shipit

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

Aperta

#271 aperta il 12 giu 2020

 (1 commento) (0 reazioni) (0 assegnatari)JavaScript (194 fork)batch import
help wanted

Metriche repository

Star
 (5331 stelle)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

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`);
  });

Guida contributor