我有一个带有凭证参数(用户名和密码)的管道作业,还有一个运行触发python文件的shell脚本的常规文件。 如何将这些参数传递给env,以便python脚本可以将其与os.getenv一起使用? Groovy文件代码:
def call() {
final fileContent = libraryResource('com/amdocs/python_distribution_util/main.py')
writeFile file: 'main.py',text: fileContent
sh "python main.py"}
我知道管道语法应类似于以下内容:
withCredentials([usernamePassword(credentialsId: '*****',passwordVariable: 'ARTIFactORY_SERVICE_ID_PW',usernameVariable: 'ARTIFactORY_SERVICE_ID_UN')]) {
// some block
}
什么是正确的方法?