forked from Azure/azure-functions-java-worker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpackage-pipeline.ps1
29 lines (27 loc) · 927 Bytes
/
package-pipeline.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
param (
[string]$buildNumber = $env:APPVEYOR_BUILD_NUMBER
)
# A function that checks exit codes and fails script if an error is found
function StopOnFailedExecution {
if ($LastExitCode)
{
exit $LastExitCode
}
}
Write-Host "Building azure-functions-java-worker"
cmd.exe /c '.\mvnBuild.bat'
StopOnFailedExecution
Write-Host "Creating nuget package Microsoft.Azure.Functions.JavaWorker"
Write-Host "buildNumber: " $buildNumber
Get-Command nuget
StopOnFailedExecution
remove-item pkg -Recurse -ErrorAction Ignore
mkdir pkg
Get-ChildItem -Path .\target\* -Include 'azure*' -Exclude '*shaded.jar','*tests.jar' | %{ Copy-Item $_.FullName .\pkg\azure-functions-java-worker.jar }
StopOnFailedExecution
copy-item ./worker.config.json pkg
copy-item ./tools/AzureFunctionsJavaWorker.nuspec pkg/
Copy-Item ".\lib_worker_1.6.2" pkg\lib -Recurse
set-location pkg
nuget pack -Properties version=$buildNumber
set-location ..