【发布时间】:2016-02-05 14:57:11
【问题描述】:
由于art.exe(人工 CLI 接口)在我从构建脚本中调用它时挂起,因此我在 powershell 2.0 中从他们的page on the topic 重写 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)
问题是它在我的本地生成的校验和始终与工件生成的校验和不同。这不是“传输期间损坏”错误,因为我在本地生成校验和,并且我已经手动部署了几次。
如何以与 artifactory (2.6.5) 相同的方式生成校验和,以便我们的校验和在我发送时匹配并且部署不会失败?生成校验和时我做错了什么吗?
谢谢!
【问题讨论】:
标签: powershell powershell-2.0 sha1 checksum artifactory