1
1
param (
2
2
[string ]$buildNumber = " 0" ,
3
3
[string ]$extensionVersion = " 2.0.$buildNumber " ,
4
- [string ]$suffix
4
+ [string ]$suffix ,
5
+ [string ]$hashesForHardlinksFile = " hashesForHardlinks.txt"
5
6
)
6
7
7
8
$extensionVersion += $suffix
@@ -25,6 +26,16 @@ function ZipContent([string] $sourceDirectory, [string] $target)
25
26
[IO.Compression.ZipFile ]::CreateFromDirectory($sourceDirectory , $target )
26
27
}
27
28
29
+ function WriteHashesFile ([string ] $directoryPath ) {
30
+ New-Item - Path " $directoryPath /../temp_hashes" - ItemType Directory | Out-Null
31
+ $temp_current = (Get-Location )
32
+ Set-Location $directoryPath
33
+ Get-ChildItem - Recurse $directoryPath | Where-Object { $_.PsIsContainer -eq $false } | Foreach-Object { " Hash:" + [System.Convert ]::ToBase64String([System.Text.Encoding ]::UTF8.GetBytes((Get-FileHash - Algorithm MD5 $_.FullName ).Hash)) + " FileName:" + (Resolve-Path - Relative - Path $_.FullName ) } | Out-File - FilePath " $directoryPath \..\temp_hashes\$hashesForHardlinksFile "
34
+ Move-Item - Path " $directoryPath /../temp_hashes/$hashesForHardlinksFile " - Destination " $directoryPath " - Force
35
+ Set-Location $temp_current
36
+ Remove-Item " $directoryPath /../temp_hashes" - Recurse - Force > $null
37
+ }
38
+
28
39
function CrossGen ([string ] $runtime , [string ] $publishTarget , [string ] $privateSiteExtensionPath )
29
40
{
30
41
Write-Host " publishTarget: " $publishTarget
@@ -243,6 +254,14 @@ function CreateZips([string] $runtimeSuffix) {
243
254
Write-Host " privateSiteExtensionPath: " $privateSiteExtensionPath
244
255
Rename-Item " $privateSiteExtensionPath " " $siteExtensionPath \$extensionVersion "
245
256
Copy-Item .\src\WebJobs.Script.WebHost\extension.xml " $siteExtensionPath "
257
+
258
+ Write-Host " Generating $hashesForHardlinksFile "
259
+ Write-Host " ---------------------------------------------------"
260
+ WriteHashesFile $siteExtensionPath / $extensionVersionNoSuffix
261
+ Write-Host " Generated $hashesForHardlinksFile "
262
+ Write-Host " ---------------------------------------------------"
263
+
264
+
246
265
ZipContent $siteExtensionPath " $buildOutput \Functions.$extensionVersion$runtimeSuffix .zip"
247
266
}
248
267
0 commit comments