1

在 CI/CD 服务器中,如何确定要包含在nx affected:build --base=master~1 --head=master命令中的提交范围?

https://nx.dev/react/api/workspace/npmscripts/affected-build

nx affected

Run task for affected projects

Run command using --base=[SHA1] --head=[SHA2] (affected by the committed changes):
  --base  Base of the current branch (usually master)                   [string]
  --head  Latest commit of the current branch (usually HEAD)            [string]

例如,对于只有 1 次提交到 master 触发构建的用例来说,这将是微不足道的。但是,如果是 2 次或更多次提交触发了 CI/CD 上的构建,那么我如何确定构建运行的最后一次提交以确定--headarg 使用的某些提交范围?

4

1 回答 1

0

答案很晚,但我想最好的办法是在每次提交时触发 CI,然后只有在有任何影响更改的情况下才继续。

这也将减少构建、测试和部署所需的时间,因为它们只进行较小的更改。

但我也猜你已经找到了一个可行的解决方案。

于 2020-04-30T10:00:18.560 回答