【发布时间】:2022-01-01 07:57:15
【问题描述】:
我使用这个Link 在 Jenkins 中配置 http 代理,但是在使用 printenv 之后只设置了这些变量。
HTTP_PROXY=http://127.0.0.1:3128
https_proxy=http://127.0.0.1:3128
我预计 http_proxy 和 HTTPS_PROXY 也会设置。
我在构建阶段添加了以下步骤来设置这些环境变量,但 http_proxy 和 HTTPS_PROXY 没有设置。
stage('build') {
steps {
echo "************ Before exporting ***************************"
sh 'printenv | sort'
sh "export http_proxy='http://127.0.0.1:3128'"
sh "export https_proxy='http://127.0.0.1:3128'"
sh "export HTTP_PROXY='http://127.0.0.1:3128'"
sh "export HTTPS_PROXY='http://127.0.0.1:3128'"
echo "************ After exporting ***************************"
sh 'printenv | sort'
echo "**************************************************"
sh './myScript'
}
}
您能否帮我弄清楚问题出在哪里并让myScript 运行,现在它只是失败了,因为这些变量设置不正确?
【问题讨论】:
标签: jenkins environment-variables