Skip to content

Commit bc790c6

Browse files
aishwaryabhfabiocav
authored andcommitted
Create metadata.json file in conslidated artifacts intermediate pipeline (#3884)
* adding generate metadata file * remove code mirror * get correct inproc version * print out metadata file * fixing zip issue * fixing release number * fixing release number again * removing zip artifact script and fixing code mirror
1 parent 2821f48 commit bc790c6

File tree

12 files changed

+332
-147
lines changed

12 files changed

+332
-147
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,40 @@
1-
trigger:
2-
branches:
3-
include:
4-
- feature/oop-host
5-
paths:
6-
include:
7-
- ./host/src/**
1+
pr: none
82

9-
pr:
3+
trigger:
104
branches:
115
include:
126
- feature/oop-host
137
paths:
148
include:
15-
- ./host/src/**
9+
- /host/src/**
1610

1711
resources:
1812
repositories:
13+
- repository: 1es
14+
type: git
15+
name: 1ESPipelineTemplates/1ESPipelineTemplates
16+
ref: refs/tags/release
1917
- repository: eng
2018
type: git
2119
name: engineering
2220
ref: refs/tags/release
2321

24-
jobs:
25-
- job: BuildCoreToolsHostWindows
26-
displayName: '[Windows] Build CoreToolsHost'
27-
pool:
28-
vmImage: 'windows-latest'
29-
30-
variables:
22+
variables:
3123
- template: /ci/variables/cfs.yml@eng
3224

33-
templateContext:
34-
outputParentDirectory: $(Build.ArtifactStagingDirectory)
35-
outputs:
36-
- output: pipelineArtifact
37-
displayName: Publish CoreToolsHost packages
38-
path: $(Build.ArtifactStagingDirectory)/_coreToolsHostPackagesWindows
39-
artifact: _coreToolsHostPackagesWindows
40-
41-
steps:
42-
- pwsh: |
43-
Import-Module "./pipelineUtilities.psm1" -Force
44-
Install-Dotnet
45-
displayName: 'Install .NET 9'
46-
- task: DotnetCoreCLI@2
47-
displayName: Dotnet Publish (win-x64)
48-
inputs:
49-
command: publish
50-
publishWebProjects: false
51-
zipAfterPublish: false
52-
arguments: -c Release -r win-x64 -o $(Build.SourcesDirectory)/pkg_output/windows/win-x64
53-
workingDirectory: $(Build.SourcesDirectory)/host/src/CoreToolsHost
54-
55-
- task: DotnetCoreCLI@2
56-
displayName: Dotnet Publish (win-arm64)
57-
inputs:
58-
command: publish
59-
publishWebProjects: false
60-
zipAfterPublish: false
61-
arguments: -c Release -r win-arm64 -o $(Build.SourcesDirectory)/pkg_output/windows/win-arm64
62-
workingDirectory: $(Build.SourcesDirectory)/host/src/CoreToolsHost
63-
64-
- task: CopyFiles@2
65-
displayName: Copy files (win-x64)
66-
inputs:
67-
SourceFolder: $(Build.SourcesDirectory)/pkg_output/windows/win-x64
68-
# Publish output will include many other files. We only need func.exe & nethost.dll
69-
Contents: |
70-
func.exe
71-
nethost.dll
72-
TargetFolder: $(Build.ArtifactStagingDirectory)/_coreToolsHostPackagesWindows/win-x64
73-
74-
- task: CopyFiles@2
75-
displayName: Copy files (win-arm64)
76-
inputs:
77-
SourceFolder: $(Build.SourcesDirectory)/pkg_output/windows/win-arm64
78-
# Publish output will include many other files. We only need func.exe & nethost.dll
79-
Contents: |
80-
func.exe
81-
nethost.dll
82-
TargetFolder: $(Build.ArtifactStagingDirectory)/_coreToolsHostPackagesWindows/win-arm64
83-
84-
- task: PublishPipelineArtifact@1
85-
displayName: 'Publish CoreToolsHost packages artifact'
86-
inputs:
87-
targetPath: '$(Build.ArtifactStagingDirectory)/_coreToolsHostPackagesWindows'
88-
artifact: 'drop-coretools-host-windows'
89-
publishLocation: 'pipeline'
25+
extends:
26+
template: v1/1ES.Official.PipelineTemplate.yml@1es
27+
parameters:
28+
pool:
29+
name: 1es-pool-azfunc
30+
image: 1es-windows-2022
31+
os: windows
32+
sdl:
33+
codeql:
34+
compiled:
35+
enabled: true
36+
runSourceLanguagesInSourceAnalysis: true
37+
stages:
38+
- stage: BuildCoreToolsHost
39+
jobs:
40+
- template: /eng/ci/templates/official/jobs/build-core-tools-host.yml@self
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
jobs:
2+
- job: BuildCoreToolsHostWindows
3+
displayName: '[Windows] Build CoreToolsHost'
4+
pool:
5+
name: 1es-pool-azfunc
6+
image: 1es-windows-2022
7+
os: windows
8+
9+
steps:
10+
- task: UseDotNet@2
11+
inputs:
12+
version: 9.x
13+
includePreviewVersions: true
14+
displayName: Install .NET 9
15+
- task: UseDotNet@2
16+
inputs:
17+
version: 6.x
18+
displayName: Install .NET 6
19+
20+
- task: DotnetCoreCLI@2
21+
displayName: Dotnet Publish (win-x64)
22+
inputs:
23+
command: publish
24+
publishWebProjects: false
25+
zipAfterPublish: false
26+
arguments: -c Release -r win-x64 -o $(Build.SourcesDirectory)/pkg_output/windows/win-x64 --self-contained
27+
workingDirectory: $(Build.SourcesDirectory)/host/src/CoreToolsHost
28+
29+
- task: DotnetCoreCLI@2
30+
displayName: Dotnet Publish (win-arm64)
31+
inputs:
32+
command: publish
33+
publishWebProjects: false
34+
zipAfterPublish: false
35+
arguments: -c Release -r win-arm64 -o $(Build.SourcesDirectory)/pkg_output/windows/win-arm64 --self-contained
36+
workingDirectory: $(Build.SourcesDirectory)/host/src/CoreToolsHost
37+
38+
- template: ci/sign-files.yml@eng
39+
parameters:
40+
displayName: 'Authenticode signing (dll) (win-arm64)'
41+
folderPath: '$(Build.SourcesDirectory)/pkg_output/windows/win-arm64'
42+
pattern: '*.dll, *.exe'
43+
signType: inline
44+
inlineOperation: |
45+
[
46+
{
47+
"KeyCode": "CP-230012",
48+
"OperationCode": "SigntoolSign",
49+
"Parameters": {
50+
"OpusName": "Microsoft",
51+
"OpusInfo": "http://www.microsoft.com",
52+
"FileDigest": "/fd \"SHA256\"",
53+
"PageHash": "/NPH",
54+
"TimeStamp": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
55+
},
56+
"ToolName": "sign",
57+
"ToolVersion": "1.0"
58+
},
59+
{
60+
"KeyCode": "CP-230012",
61+
"OperationCode": "SigntoolVerify",
62+
"Parameters": {},
63+
"ToolName": "sign",
64+
"ToolVersion": "1.0"
65+
}
66+
]
67+
68+
- template: ci/sign-files.yml@eng
69+
parameters:
70+
displayName: 'Authenticode signing (dll) (win-x64)'
71+
folderPath: '$(Build.SourcesDirectory)/pkg_output/windows/win-x64'
72+
pattern: '*.dll, *.exe'
73+
signType: inline
74+
inlineOperation: |
75+
[
76+
{
77+
"KeyCode": "CP-230012",
78+
"OperationCode": "SigntoolSign",
79+
"Parameters": {
80+
"OpusName": "Microsoft",
81+
"OpusInfo": "http://www.microsoft.com",
82+
"FileDigest": "/fd \"SHA256\"",
83+
"PageHash": "/NPH",
84+
"TimeStamp": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
85+
},
86+
"ToolName": "sign",
87+
"ToolVersion": "1.0"
88+
},
89+
{
90+
"KeyCode": "CP-230012",
91+
"OperationCode": "SigntoolVerify",
92+
"Parameters": {},
93+
"ToolName": "sign",
94+
"ToolVersion": "1.0"
95+
}
96+
]
97+
98+
- task: CopyFiles@2
99+
displayName: Copy files (win-x64)
100+
inputs:
101+
SourceFolder: $(Build.SourcesDirectory)/pkg_output/windows/win-x64
102+
# Publish output will include many other files. We only need func.exe & nethost.dll
103+
Contents: |
104+
func.exe
105+
nethost.dll
106+
TargetFolder: $(Build.ArtifactStagingDirectory)/_coreToolsHostPackagesWindows/win-x64
107+
108+
- task: CopyFiles@2
109+
displayName: Copy files (win-arm64)
110+
inputs:
111+
SourceFolder: $(Build.SourcesDirectory)/pkg_output/windows/win-arm64
112+
# Publish output will include many other files. We only need func.exe & nethost.dll
113+
Contents: |
114+
func.exe
115+
nethost.dll
116+
TargetFolder: $(Build.ArtifactStagingDirectory)/_coreToolsHostPackagesWindows/win-arm64
117+
118+
templateContext:
119+
outputParentDirectory: $(Build.ArtifactStagingDirectory)
120+
outputs:
121+
- output: pipelineArtifact
122+
path: $(Build.ArtifactStagingDirectory)/_coreToolsHostPackagesWindows
123+
artifact: drop-coretools-host-windows

publish-scripts/chocolatey/buildNUPKG.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def preparePackage():
4545

4646
for arch in archList:
4747
fileName = f"Azure.Functions.Cli.win-{arch.lower()}.{constants.VERSION}.zip"
48-
url = f'https://functionscdn.azureedge.net/public/{constants.VERSION}/{fileName}'
48+
url = f'https://functionscdn.azureedge.net/public/4.0.{constants.CONSOLIDATED_BUILD_ID}/{fileName}'
4949
substitutionMapping[f"ZIPURL_{arch}"] = url
5050

5151
# download the zip

publish-scripts/driver.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,15 @@ def main(*args):
1212
packageNamePostfix = ""
1313

1414
print(f"args: {args} {len(args)}")
15-
if (len(args) >= 3):
15+
if (len(args) >= 4):
1616
packageNamePostfix = "-" + args[2]
1717

1818
constants.PACKAGENAME = constants.PACKAGENAME + packageNamePostfix
1919
print(f"constants.PACKAGENAME: {constants.PACKAGENAME}")
20+
21+
constants.CONSOLIDATED_BUILD_ID = args[2] # New argument for consolidatedBuildId
22+
print(f"Consolidated Build ID: {constants.CONSOLIDATED_BUILD_ID}") # Print the new argument
23+
2024
constants.VERSION = args[1]
2125
constants.DRIVERROOTDIR = os.path.dirname(os.path.abspath(__file__))
2226
platformSystem = platform.system()

0 commit comments

Comments
 (0)