2017-06-19 22 views
1

在上AppVeyor我的部署脚本我使用ps: >-命令取决于回购分公司部署在appveyor用麻线:上传使用PS

​​

这将创建在AppVeyor的错误信息建立类似如下:

twine : 
At line:2 char:5 
+  twine upload --skip-existing dist/* 
+  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    + CategoryInfo   : NotSpecified: (:String) [], RemoteException 
    + FullyQualifiedErrorId : NativeCommandError 

构建显示失败。奇怪的是,软件包被上传到pypi并可供下载。因此,该命令实际上执行得很好,但由于此异常,构建显示失败。如果只有错误信息会更丰富......

下面有一个简单的脚本和完整的输出另一个运行作为AppVeyor(https://ci.appveyor.com/project/mzwiessele/gpy/build/1.0.361/job/baimi4og179tk3p8

if ($env:APPVEYOR_REPO_BRANCH -eq 'deploy') { 
    twine upload --skip-existing dist/* 
} else { 
    echo not deploying on other branches 
} 
twine : 
At line:2 char:5 
+  twine upload --skip-existing dist/* 
+  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    + CategoryInfo   : NotSpecified: (:String) [], RemoteException 
    + FullyQualifiedErrorId : NativeCommandError 

    0%|   | 0.00/1.21M [00:00<?, ?bytes/s] 
    1%|   | 8.19K/1.21M [00:00<00:21, 56.1Kbytes/s] 
    8%|8   | 98.3K/1.21M [00:00<00:14, 77.6Kbytes/s] 
33%|###3  | 401K/1.21M [00:00<00:07, 109Kbytes/s] 

    0%|   | 0.00/1.43M [00:00<?, ?bytes/s] 

Uploading distributions to https://upload.pypi.org/legacy/ 
Uploading GPy-1.7.6-cp27-cp27m-win_amd64.whl 
Uploading GPy-1.7.6.win-amd64-py2.7.exe 
Command executed with exception: 

回答

1

这是因为twine输出写入标准错误,看到任何输出到StdErr被PowerShell主机视为RemoteException。尝试将该PS命令重新写入批处理文件。