Skip to content

Commit 3af84f3

Browse files
authored
Add ability to publish private site ext in host.public build (#11068)
1 parent 575890a commit 3af84f3

File tree

3 files changed

+48
-2
lines changed

3 files changed

+48
-2
lines changed

eng/ci/public-build.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# This build is used for public PR and CI builds.
22

3+
parameters:
4+
- name: privateSiteExt
5+
displayName: Build private site extension
6+
type: boolean
7+
default: false
8+
39
trigger:
410
batch: true
511
branches:
@@ -64,3 +70,9 @@ extends:
6470
- stage: Test
6571
jobs:
6672
- template: /eng/ci/templates/jobs/run-unit-tests.yml@self
73+
74+
- ${{ if eq(parameters.privateSiteExt, true) }}:
75+
- stage: Build
76+
dependsOn: []
77+
jobs:
78+
- template: /eng/ci/templates/jobs/build-private-site-ext.yml@self
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
jobs:
2+
- job: PrivateSiteExt
3+
displayName: Build Private Site Extension
4+
5+
variables:
6+
drop_path: $(Build.ArtifactStagingDirectory)
7+
site_ext_path: $(drop_path)/site_ext
8+
windows_drop_path: $(drop_path)/windows
9+
10+
templateContext:
11+
outputParentDirectory: $(drop_path)
12+
outputs:
13+
- output: pipelineArtifact
14+
displayName: Publish windows artifacts
15+
path: $(windows_drop_path)
16+
artifact: drop_windows
17+
18+
steps:
19+
- template: /eng/ci/templates/install-dotnet.yml@self
20+
- template: /eng/ci/templates/steps/build-site-ext.yml@self
21+
parameters:
22+
publishDir: $(site_ext_path)
23+
24+
- pwsh: |
25+
cd $(site_ext_path) | Out-Null
26+
New-Item -Path $(windows_drop_path) -ItemType Directory -Force | Out-Null
27+
./New-PrivateSiteExtension.ps1 -OutputPath '$(windows_drop_path)' -AppendOutputName
28+
Write-Host "##vso[build.addbuildtag]private-site-ext"
29+
displayName: Compress private site extension

src/WebJobs.Script.SiteExtension/New-PrivateSiteExtension.ps1

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
.PARAMETER NoZip
1818
[Switch] Include to produce site extension as a folder and not a zip.
1919
20+
.PARAMETER AppendOutputName
21+
[Switch] Used when supplying OutputPath to append the name of the private site extension to the OutputPath.
22+
2023
.PARAMETER Force
2124
[Switch] Include to overwrite existing files.
2225
@@ -32,6 +35,7 @@ param (
3235
[string] $OutputPath = $null,
3336
[ValidateSet('x64', '64bit', 'x86', '32bit')][string] $Bitness = '64bit',
3437
[switch] $NoZip,
38+
[switch] $AppendOutputName,
3539
[switch] $Force
3640
)
3741

@@ -61,12 +65,13 @@ if (-not (Join-Path $InputPath "extension.xml" | Test-Path))
6165
exit 1
6266
}
6367

64-
if (-not $OutputPath)
68+
if ($AppendOutputName || !$OutputPath)
6569
{
6670
$runtime = $Bitness -eq '32bit' ? 'win-x86' : 'win-x64'
6771
$leaf = (Split-Path $InputPath -Leaf)
6872
$split = $leaf.IndexOf('.')
69-
$OutputPath = "$($leaf.Substring(0, $split)).Private.$($leaf.Substring($split + 1)).$runtime"
73+
$OutputPath = [System.IO.Path]::Combine(
74+
$OutputPath, "$($leaf.Substring(0, $split)).Private.$($leaf.Substring($split + 1)).$runtime")
7075
}
7176

7277
function New-TemporaryDirectory {

0 commit comments

Comments
 (0)