git - 如何确定使用 NX 运行增量构建所需的提交范围
问题描述
在 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 上的构建,那么我如何确定构建运行的最后一次提交以确定--head
arg 使用的某些提交范围?
解决方案
答案很晚,但我想最好的办法是在每次提交时触发 CI,然后只有在有任何影响更改的情况下才继续。
这也将减少构建、测试和部署所需的时间,因为它们只进行较小的更改。
但我也猜你已经找到了一个可行的解决方案。
推荐阅读
- spring-boot - 如何使 Spring Boot 应用程序发送电子邮件并支持配置任何电子邮件服务,如 mailchimp、sendgrid、
- python - 修改字典python中的值
- sql - Hive 查询可以从哪些子句开始
- snowflake-schema - 一个月内重新激活
- vue.js - vscode中的符号链接
- python - Pandas to_csv 默认添加额外的行终止符 - winpython 3.8.5.0,Pandas 1.1.0。这是预期的行为吗?
- laravel - laravel 7将对象数组插入数据库
- python - 将python dict转换为字符串
- linux - 将内容从 Jenkins 从站复制到 S3 存储桶时,“文件/目录不可读”
- rest - 是否有 dapr.io 设计模式来获取状态存储中的所有键