Skip to content

Commit b8db3dd

Browse files
authored
[1ES] Migrate FunctionsNetHost CI pipelines (#2515)
1 parent 2ece46d commit b8db3dd

6 files changed

+281
-0
lines changed

eng/ci/host/official-build.yml

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
trigger:
2+
batch: true
3+
branches:
4+
include:
5+
- main
6+
- release/*
7+
paths:
8+
include:
9+
- host/src/
10+
11+
# CI only, does not trigger on PRs.
12+
pr: none
13+
14+
resources:
15+
repositories:
16+
- repository: 1es
17+
type: git
18+
name: 1ESPipelineTemplates/1ESPipelineTemplates
19+
ref: refs/tags/release
20+
- repository: eng
21+
type: git
22+
name: engineering
23+
ref: refs/tags/release
24+
25+
variables:
26+
- template: ci/variables/build.yml@eng
27+
- template: ci/variables/cfs.yml@eng
28+
- template: /eng/ci/templates/variables/build.yml@self
29+
30+
extends:
31+
template: v1/1ES.Official.PipelineTemplate.yml@1es
32+
parameters:
33+
pool:
34+
name: 1es-pool-azfunc
35+
image: 1es-ubuntu-22.04
36+
os: linux
37+
sdl:
38+
sourceAnalysisPool:
39+
name: 1es-pool-azfunc
40+
image: 1es-windows-2022
41+
os: windows
42+
43+
stages:
44+
- stage: Build
45+
46+
jobs:
47+
- template: /eng/ci/templates/official/jobs/build-host-prelaunch-artifacts.yml@self
48+
- template: /eng/ci/templates/official/jobs/build-host-artifacts-linux.yml@self
49+
- template: /eng/ci/templates/official/jobs/build-host-artifacts-windows.yml@self
50+
51+
- stage: Pack
52+
dependsOn: Build
53+
54+
jobs:
55+
- template: /eng/ci/templates/official/jobs/pack-host-artifacts.yml@self

eng/ci/host/public-build.yml

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# This build is used for public PR and CI builds.
2+
3+
trigger:
4+
batch: true
5+
branches:
6+
include:
7+
- main
8+
- release/*
9+
paths:
10+
include:
11+
- host/src/
12+
13+
pr:
14+
branches:
15+
include:
16+
- main
17+
- release/*
18+
paths:
19+
include:
20+
- host/src/
21+
22+
resources:
23+
repositories:
24+
- repository: 1es
25+
type: git
26+
name: 1ESPipelineTemplates/1ESPipelineTemplates
27+
ref: refs/tags/release
28+
29+
variables:
30+
- template: /eng/ci/templates/variables/build.yml@self
31+
32+
extends:
33+
template: v1/1ES.Unofficial.PipelineTemplate.yml@1es
34+
parameters:
35+
pool:
36+
name: 1es-pool-azfunc-public
37+
image: 1es-ubuntu-22.04
38+
os: linux
39+
sdl:
40+
sourceAnalysisPool:
41+
name: 1es-pool-azfunc-public
42+
image: 1es-windows-2022
43+
os: windows
44+
45+
stages:
46+
- stage: Build
47+
48+
jobs:
49+
- template: /eng/ci/templates/official/jobs/build-host-prelaunch-artifacts.yml@self
50+
- template: /eng/ci/templates/official/jobs/build-host-artifacts-linux.yml@self
51+
- template: /eng/ci/templates/official/jobs/build-host-artifacts-windows.yml@self
52+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
jobs:
2+
3+
- job: BuildFunctionsNetHostLinux
4+
displayName: '[Linux] Build FunctionsNetHost'
5+
6+
templateContext:
7+
outputParentDirectory: $(Build.ArtifactStagingDirectory)
8+
outputs:
9+
- output: pipelineArtifact
10+
displayName: Publish FunctionsNetHost packages
11+
path: $(Build.ArtifactStagingDirectory)/_functionsNetHostPackagesLinux
12+
artifact: _functionsNetHostPackagesLinux
13+
14+
pool:
15+
name: 1es-pool-azfunc
16+
image: 1es-ubuntu-22.04
17+
os: linux
18+
19+
steps:
20+
- task: UseDotNet@2
21+
displayName: Install .NET SDK from global.json
22+
inputs:
23+
useGlobalJson: true
24+
25+
- script: |
26+
sudo apt-get install clang zlib1g-dev
27+
displayName: Install dependencies
28+
29+
- task: DotnetCoreCLI@2
30+
displayName: Dotnet Publish
31+
inputs:
32+
command: publish
33+
publishWebProjects: false
34+
zipAfterPublish: false
35+
arguments: -c Release -r linux-x64 -o $(Build.SourcesDirectory)/pkg_output/linux
36+
workingDirectory: $(Build.SourcesDirectory)/host/src/FunctionsNetHost
37+
38+
- task: CopyFiles@2
39+
displayName: Copy files
40+
inputs:
41+
SourceFolder: $(Build.SourcesDirectory)/pkg_output/linux
42+
# Publish output will include many other files. We only need the FunctionsNetHost, FunctionsNetHost.dbg & libnethost.so
43+
Contents: |
44+
FunctionsNetHost
45+
FunctionsNetHost.dbg
46+
libnethost.so
47+
TargetFolder: $(Build.ArtifactStagingDirectory)/_functionsNetHostPackagesLinux
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
jobs:
2+
3+
- job: BuildFunctionsNetHostWindows
4+
displayName: '[Windows] Build FunctionsNetHost'
5+
6+
templateContext:
7+
outputParentDirectory: $(Build.ArtifactStagingDirectory)
8+
outputs:
9+
- output: pipelineArtifact
10+
displayName: Publish FunctionsNetHost packages
11+
path: $(Build.ArtifactStagingDirectory)/_functionsNetHostPackagesWindows
12+
artifact: _functionsNetHostPackagesWindows
13+
14+
pool:
15+
name: 1es-pool-azfunc
16+
image: 1es-windows-2022
17+
os: windows
18+
19+
steps:
20+
- task: UseDotNet@2
21+
displayName: Install .NET SDK from global.json
22+
inputs:
23+
useGlobalJson: true
24+
25+
- task: DotnetCoreCLI@2
26+
displayName: Dotnet Publish
27+
inputs:
28+
command: publish
29+
publishWebProjects: false
30+
zipAfterPublish: false
31+
arguments: -c Release -r win-x64 -o $(Build.SourcesDirectory)/pkg_output/windows
32+
workingDirectory: $(Build.SourcesDirectory)/host/src/FunctionsNetHost
33+
34+
- task: CopyFiles@2
35+
displayName: Copy files
36+
inputs:
37+
SourceFolder: $(Build.SourcesDirectory)/pkg_output/windows
38+
# Publish output will include many other files. We only need FunctionsNetHost.exe, pdb & nethost.dll
39+
Contents: |
40+
FunctionsNetHost.exe
41+
FunctionsNetHost.pdb
42+
nethost.dll
43+
TargetFolder: $(Build.ArtifactStagingDirectory)/_functionsNetHostPackagesWindows
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
jobs:
2+
3+
- job: BuildPrelaunchApp
4+
displayName: Build PrelaunchApp
5+
6+
templateContext:
7+
outputParentDirectory: $(Build.ArtifactStagingDirectory)
8+
outputs:
9+
- output: pipelineArtifact
10+
displayName: Publish PrelaunchApp packages
11+
path: $(Build.ArtifactStagingDirectory)/_preLaunchAppPackages
12+
artifact: _preLaunchAppPackages
13+
14+
pool:
15+
name: 1es-pool-azfunc
16+
image: 1es-windows-2022
17+
os: windows
18+
19+
variables:
20+
dotnetVersions: 'net8.0,net7.0,net6.0'
21+
22+
steps:
23+
- template: /eng/ci/templates/steps/install-dotnet.yml@self
24+
25+
- ${{ each version in split(variables.dotnetVersions, ',') }}:
26+
- task: DotNetCoreCLI@2
27+
displayName: Publish prelaunch App.csproj
28+
inputs:
29+
command: publish
30+
publishWebProjects: false
31+
zipAfterPublish: false
32+
modifyOutputPath: false
33+
arguments: -c Release -o $(Build.ArtifactStagingDirectory)/_preLaunchAppPackages/${{ version }} -f ${{ version }} -p:UseAppHost=false
34+
projects: host/src/PrelaunchApp/App.csproj
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
jobs:
2+
3+
- job: PackArtifacts
4+
displayName: Pack artifacts
5+
6+
templateContext:
7+
outputParentDirectory: $(Build.ArtifactStagingDirectory)
8+
outputs:
9+
- output: pipelineArtifact
10+
displayName: Publish nuget packages
11+
path: $(Build.ArtifactStagingDirectory)/NugetPackages
12+
artifact: NugetPackages
13+
14+
pool:
15+
name: 1es-pool-azfunc
16+
image: 1es-windows-2022
17+
os: windows
18+
19+
steps:
20+
- task: UseDotNet@2
21+
displayName: Install .NET SDK from global.json
22+
inputs:
23+
useGlobalJson: true
24+
25+
- task: DownloadPipelineArtifact@2
26+
displayName: Download prelaunch artifacts
27+
inputs:
28+
artifactName: _preLaunchAppPackages
29+
path: $(Build.SourcesDirectory)/host/dist/portable
30+
31+
- task: DownloadPipelineArtifact@2
32+
displayName: Download host artifacts - linux
33+
inputs:
34+
artifactName: _functionsNetHostPackagesLinux
35+
path: $(Build.SourcesDirectory)/host/dist/linux
36+
37+
- task: DownloadPipelineArtifact@2
38+
displayName: Download host artifacts - windows
39+
inputs:
40+
artifactName: _functionsNetHostPackagesWindows
41+
path: $(Build.SourcesDirectory)/host/dist/windows
42+
43+
- task: NuGetCommand@2
44+
displayName: Nuget pack
45+
inputs:
46+
command: pack
47+
packagesToPack: $(Build.SourcesDirectory)/host/tools/build/Microsoft.Azure.Functions.DotnetIsolatedNativeHost.nuspec
48+
versioningScheme: off
49+
packDestination: $(Build.ArtifactStagingDirectory)/NugetPackages
50+
basePath: $(Build.SourcesDirectory)/host/tools/build

0 commit comments

Comments
 (0)