当我从构建脚本调用art.exe (工件CLI接口)时,我将在powershell 2.0中从他们的关于主题的页面中重写bash脚本。我使用这段代码来生成校验和:
$sha1 = New-Object System.Security.Cryptography.SHA1CryptoServiceProvider
$path = Resolve-Path "CatVideos.zip"
$bytes = [System.IO.File]::ReadAllBytes($path.Path)
$sha1.ComputeHash($bytes) | foreach { $hash = $hash + $_.ToString("X2") }
$wc=new-object System.Net.WebClient
$wc.Credentials= new-object System.Net.NetworkCredential("svnintegration","orange#5")
$wc.Headers.Add("X-Checksum-Deploy", "true")
$wc.Headers.Add("X-Checksum-Sha1", $hash)问题在于,它在本地生成的校验和与工件生成的校验和一致。这不是“传输过程中的损坏”错误,因为我在本地生成校验和,并且手动部署了几次。
如何以与工件(2.6.5)相同的方式生成校验和,以便我们的校验和在发送我的校验和时匹配,并且部署不会失败?在生成校验和时,我做了什么明显的错误吗?
谢谢!
发布于 2016-02-05 15:02:32
你必须用
$wc.Headers.Add("X-Checksum-Sha1", $hash.ToLower())https://stackoverflow.com/questions/35227104
复制相似问题