问题描述
我在EKS上部署了Jenkins,我的管道是:
pipeline {
stage("build") {
//start a agent "agent_label"
}
//Now,end that agent,for the reason of waiting for user input.
stage("deploy") {
//start the agent "agent_label"
}
}
在“构建”阶段,我获得了git commit版本,我想在“部署”阶段中使用它。由于代理终止,因此在“构建”阶段的环境变量将不可用。那么如何解决呢?
我已经搜索了。它说我应该使用“ Persistent Parameter”。但是,在我使用的“ AWS Code commit”的Jenkins项目类型上没有“ Persistent Parameter”配置。我只在“ Pipeline”的Jenkins项目类型上看到该配置。
另一种方法可能是将Jenkins BUILD_NUMBER更改为git commit版本。但是我不知道该怎么做。
谢谢!