# publishFolder
|
$publishFolder= $args[0]
|
|
# Paths
|
$rootFolder = (Get-Item -Path "./" -Verbose).FullName
|
if ([String]::IsNullOrEmpty($publishFolder)) {
|
$publishFolder = Join-Path $rootFolder "output/publish"
|
$hasPath = Test-Path($publishFolder)
|
if (-Not $hasPath) {
|
new-item -path $rootFolder -name "output/publish" -type directory
|
}
|
}
|
Write-Host ("Publish Output " + $publishFolder)
|
|
# List of projects
|
$projects = (
|
"src/CMS.Plugin.PipeLineLems"
|
)
|
|
# Rebuild solution
|
Set-Location $rootFolder
|
dotnet restore -s https://nexus.sycdev.com/repository/nuget-hosted/ --runtime win-x64
|
# dotnet restore --configfile NuGet.config --runtime win-x64
|
Write-Host ("Restore Completed ! ")
|
# Publish all projects
|
foreach($project in $projects) {
|
$projectFolder = Join-Path $rootFolder $project
|
$projectName = $project.Substring($project.LastIndexOf("/") + 1)
|
Set-Location $projectFolder
|
Write-Host ("Publish " + $projectName)
|
# & dotnet publish ($projectName + ".csproj ") --configuration Release --output (Join-Path $publishFolder ("/" + $projectName.ToLower())) --nologo --verbosity quiet --no-restore
|
& dotnet publish ($projectName + ".csproj ") --configuration Release --output (Join-Path $publishFolder ("/" + $projectName.ToLower())) --nologo --verbosity quiet --no-restore --runtime win-x64
|
}
|
|
Write-Host ("Publish Completed ! ")
|
|
# Go back to the root folder
|
Set-Location $rootFolder
|