Skip to content

Commit

Permalink
Fix for Publish Web not working in Release Management
Browse files Browse the repository at this point in the history
  • Loading branch information
kirkone committed Jan 16, 2017
1 parent 663ff85 commit fa2205f
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 17 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ Please have a look here: [GitHub Issues](https://github.com/kirkone/vsts-dnx-tas

### Release Notes

#### Version 0.1.20

- Fix for Publish Web not working in Release Management

#### Version 0.1.18

- added support for App_Offline.htm in Web Publish Task
Expand Down
4 changes: 2 additions & 2 deletions VSTS.DNX.Tasks.BuildNugetPackage/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"name": "DNX.Tasks.BuildNugetPackage",
"friendlyName": "DNX Tasks Build Nuget Package",
"description": "Build a Nuget package with dotnet cli.",
"helpMarkDown": "Version: 0.1.18",
"helpMarkDown": "Version: 0.1.20",
"category": "Build",
"author": "Kirsten Kluge",
"version": {
"Major": 0,
"Minor": 1,
"Patch": 17
"Patch": 20
},
"visibility": [
"Build"
Expand Down
4 changes: 2 additions & 2 deletions VSTS.DNX.Tasks.BuildWebPackage/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"name": "DNX.Tasks.BuildWebPackage",
"friendlyName": "DNX Tasks Build Web Package",
"description": "Build a package with dotnet cli for Deployment",
"helpMarkDown": "Version: 0.1.18",
"helpMarkDown": "Version: 0.1.20",
"category": "Build",
"author": "Kirsten Kluge",
"version": {
"Major": 0,
"Minor": 1,
"Patch": 17
"Patch": 20
},
"visibility": [
"Build"
Expand Down
4 changes: 2 additions & 2 deletions VSTS.DNX.Tasks.ClearNugetCache/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"name": "DNX.Tasks.ClearNugetCache",
"friendlyName": "DNX Tasks NuGet Clear Cache",
"description": "Clear out the package cache for NuGet.",
"helpMarkDown": "Version: 0.1.18\n## Caution:\nUse this only when you exactly know what you are doing!\n This will clear the package cache and if there are any other build processes running at the same time at the same mashine **very bad things** will happen!",
"helpMarkDown": "Version: 0.1.20\n## Caution:\nUse this only when you exactly know what you are doing!\n This will clear the package cache and if there are any other build processes running at the same time at the same mashine **very bad things** will happen!",
"category": "Package",
"author": "Kirsten Kluge",
"version": {
"Major": 0,
"Minor": 1,
"Patch": 17
"Patch": 20
},
"visibility": [
"Build"
Expand Down
4 changes: 2 additions & 2 deletions VSTS.DNX.Tasks.GenerateChangeLog/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"name": "DNX.Tasks.GenerateChangeLog",
"friendlyName": "DNX Tasks Generate Change Log",
"description": "Generate a markdown file with all changeset for this build.",
"helpMarkDown": "Version: 0.1.18 \nTo use this task **Allow Scripts to Access OAuth Token** has to be enabled in **Options** of this build definition.",
"helpMarkDown": "Version: 0.1.20 \nTo use this task **Allow Scripts to Access OAuth Token** has to be enabled in **Options** of this build definition.",
"category": "Build",
"author": "Kirsten Kluge",
"version": {
"Major": 0,
"Minor": 1,
"Patch": 17
"Patch": 20
},
"visibility": [
"Build"
Expand Down
16 changes: 13 additions & 3 deletions VSTS.DNX.Tasks.PublishWebPackage/PublishWebPackage.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
$Destination,
[String] [Parameter(Mandatory = $true)]
$UseAppOffline,
[String] [Parameter(Mandatory = $true)]
$UseCustomAppOfflineFile,
[String] [Parameter(Mandatory = $false)]
$AppOfflineFile,
[String] [Parameter(Mandatory = $true)]
Expand Down Expand Up @@ -54,6 +56,7 @@ Function Main
}

$isUseAppOffline = [System.Convert]::ToBoolean($UseAppOffline)
$isUseCustomAppOfflineFile = [System.Convert]::ToBoolean($UseCustomAppOfflineFile)
$isStopBeforeDeploy = [System.Convert]::ToBoolean($StopBeforeDeploy)
$isCleanBeforeDeploy = [System.Convert]::ToBoolean($CleanBeforeDeploy)
$isForceRestart = [System.Convert]::ToBoolean($ForceRestart)
Expand Down Expand Up @@ -83,7 +86,7 @@ Function Main
$deployApiUri = JoinParts ($baseUri, "api/zip/", $Destination)

$publishZip = $Source
if(Test-Path $Source -pathtype container)
if(Test-Path $Source -pathtype Container)
{
Write-Host "Source is no .zip file, create .zip..."
$publishZip = [System.IO.Path]::Combine($env:TMP, ([System.IO.Path]::GetRandomFileName()))
Expand All @@ -100,10 +103,17 @@ Function Main

if($isUseAppOffline){
Write-Host "Placing app_offline.htm"
if([string]::IsNullOrWhiteSpace($AppOfflineFile))
if(-not $isUseCustomAppOfflineFile)
{
Write-Host " No App_Offline.htm specified, using default"
$AppOfflineFile = "$(Split-Path -parent $PSCommandPath)\app_offline.htm"
$AppOfflineFile = "$(Split-Path -parent $PSCommandPath)`\app_offline.htm"
}
if(Test-Path $AppOfflineFile -pathtype Container)
{
Write-Error "Invalid value for app_offline.htm`n`r "
Write-Error $AppOfflineFile
Write-Host "##vso[task.complete result=Failed;]Invalid value for app_offline.htm!"
exit 1
}
Invoke-RestMethod -Uri "$vfsApiUri/app_offline.htm" -Headers $authHeader -UserAgent $userAgent -Method PUT -InFile $AppOfflineFile -ContentType "multipart/form-data" -TimeoutSec $timeout | Out-Null
Write-Host " Done."
Expand Down
16 changes: 13 additions & 3 deletions VSTS.DNX.Tasks.PublishWebPackage/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"name": "DNX.Tasks.PublishWebPackage",
"friendlyName": "DNX Tasks Azure PublishWebPackage",
"description": "Publish a Dotnet package to Azure Website",
"helpMarkDown": "Version: 0.1.18",
"helpMarkDown": "Version: 0.1.20",
"category": "Deploy",
"author": "Kirsten Kluge",
"version": {
"Major": 0,
"Minor": 1,
"Patch": 17
"Patch": 20
},
"visibility": [
"Build",
Expand Down Expand Up @@ -98,6 +98,16 @@
"helpMarkDown": "Place an App_Offline.htm before deployment to shut down application while deployment.",
"groupName": "advanced"
},
{
"name": "UseCustomAppOfflineFile",
"type": "boolean",
"label": "Custom App_Offline.htm",
"defaultValue": "false",
"required": true,
"helpMarkDown": "Use an custom source for the App_Offline.htm.",
"groupName": "advanced",
"visibleRule": "UseAppOffline = true"
},
{
"name": "AppOfflineFile",
"label": "Source File for App_Offline.htm",
Expand All @@ -106,7 +116,7 @@
"helpMarkdown": "The content of this file is placed as App_Offline.htm while deployment. <br>Leave this field blank to use the default App_Offline.htm",
"required": false,
"groupName": "advanced",
"visibleRule": "UseAppOffline = true"
"visibleRule": "UseCustomAppOfflineFile = true"
},
{
"name": "StopBeforeDeploy",
Expand Down
4 changes: 2 additions & 2 deletions VSTS.DNX.Tasks.SlotSwap/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"name": "DNX.Tasks.SlotSwap",
"friendlyName": "DNX Tasks Azure SlotSwap",
"description": "Swap a slot in Azure web site deployment slots.",
"helpMarkDown": "Version: 0.1.18",
"helpMarkDown": "Version: 0.1.20",
"category": "Deploy",
"author": "Kirsten Kluge",
"version": {
"Major": 0,
"Minor": 1,
"Patch": 17
"Patch": 20
},
"visibility": [
"Build",
Expand Down
2 changes: 1 addition & 1 deletion vss-extension.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifestVersion": 1,
"id": "vsts-dnx-tasks",
"name": "VSTS DNX Tasks",
"version": "0.1.18",
"version": "0.1.20",
"publisher": "kirkone",
"public": true,
"targets": [
Expand Down

0 comments on commit fa2205f

Please sign in to comment.