点网还原无法从Jenkinsfile运行

时间:2019-11-25 20:37:36

标签: jenkins .net-core jenkins-pipeline

我有一个Jenkinsfile,它会克隆Git(dotnet代码)回购并尝试构建它。

执行dotnet restore

时失败

错误:

dotnet\sdk\3.0.100\NuGet.targets(123,5): error : Unable to load the service index for source https://api.nuget.org/v3/index.json.

作品:

但是克隆回购后(由Jenkinsfile完成)

直接在Windows计算机的命令行上执行的

perl Build.pl(具有dotnet restore)效果很好

Jenkinsfile:


stage('pre-build') {
    cleanWs()
    checkout scm
}

stage('build') {
    bat '''
        echo "Build starting..."'
        perl Build.pl     //this perl script has `dotnet restore`command
    '''              
}

我不认为这是代理问题,因为使用相同的设置,我可以直接在Windows计算机上成功运行dotnet restore

0 个答案:

没有答案