shipitjs/shipit

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

开放

#271 创建于 2020年6月12日

 (1 条评论) (0 个反应) (0 位负责人)JavaScript (194 个派生)batch import
help wanted

仓库指标

星标
 (5,331 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

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

贡献者指南