如何用全局变量替换云构建中的多个触发器?

How to substitute a global variable for multiple triggers on cloud build?

云构建允许对单个触发器进行用户定义的替换,但我需要为多个触发器分配全局用户定义的替换变量。

提前致谢。

如果替换是关于在项目 ID 或位置等触发器中保持相当恒定的环境变量,您可以使用 'substitution: build.projectId'

其他环境变量也是如此。

如果我很好地理解了您的问题,那么您是在询问有关跨不同 Cloud Build 构建共享用户定义的替代变量值的问题。

这目前不可能,因为 gcloud 命令的 user-defined substitutions are related to an specific build either by being specified in the cloudbuild.yaml config file or in the --substitutions argument 标志。