Skip to content

Commit c44e837

Browse files
authored
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 ca526b9 commit c44e837

File tree

2 files changed

+37
-39
lines changed

2 files changed

+37
-39
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
param (
2+
[string]$StagingDirectory
3+
)
4+
5+
# Define paths using the provided StagingDirectory
6+
$stagingCoreToolsCli = Join-Path $StagingDirectory "coretools-cli"
7+
$stagingCoreToolsVisualStudio = Join-Path $StagingDirectory "coretools-visualstudio"
8+
9+
# Get OOP Artifact Version
10+
$oopVersion = (Get-ChildItem $stagingCoreToolsCli | Where-Object { $_.Name -match "^Azure\.Functions\.Cli\..*\.(\d+\.\d+\.\d+)$" } | Select-Object -First 1).Name -replace "^Azure\.Functions\.Cli\..*\.(\d+\.\d+\.\d+)$", '$1'
11+
12+
# Get inProc Artifact Version
13+
$inProcVersion = (Get-ChildItem $stagingCoreToolsVisualStudio -Filter "*.zip" | Where-Object { $_.Name -match "^Azure\.Functions\.Cli\.min\.win.*\.(\d+\.\d+\.\d+)\.zip$" } | Select-Object -First 1).Name -replace "^Azure\.Functions\.Cli\.min\.win.*\.(\d+\.\d+\.\d+)\.zip$", '$1'
14+
15+
# Get the current release number from ADO
16+
$releaseNumberFull = $env:RELEASE_RELEASENAME
17+
$releaseNumber = ($releaseNumberFull -replace '\D', '')
18+
19+
# Create the JSON file
20+
$metadata = @{
21+
defaultArtifactVersion = $oopVersion
22+
inProcArtifactVersion = $inProcVersion
23+
consolidatedBuildId = $releaseNumber
24+
}
25+
26+
# Set the output path for the JSON file in the StagingDirectory
27+
$jsonOutputPath = Join-Path $StagingDirectory "metadata.json"
28+
29+
# Convert to JSON and save to file
30+
$metadata | ConvertTo-Json | Set-Content -Path $jsonOutputPath
31+
32+
Write-Host "Metadata file generated successfully at $jsonOutputPath"
33+
34+
# Read and print the JSON content
35+
$jsonContent = Get-Content -Path $jsonOutputPath
36+
Write-Host "Contents of metadata.json:"
37+
Write-Host $jsonContent

src/Azure.Functions.ArtifactAssembler/PipelineHelpers/zipCliArtifacts.ps1

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)