-
Notifications
You must be signed in to change notification settings - Fork 440
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create metadata.json file in conslidated artifacts intermediate pipel…
…ine (#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
- Loading branch information
1 parent
ca526b9
commit c44e837
Showing
2 changed files
with
37 additions
and
39 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
src/Azure.Functions.ArtifactAssembler/PipelineHelpers/generateMetadataFile.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
param ( | ||
[string]$StagingDirectory | ||
) | ||
|
||
# Define paths using the provided StagingDirectory | ||
$stagingCoreToolsCli = Join-Path $StagingDirectory "coretools-cli" | ||
$stagingCoreToolsVisualStudio = Join-Path $StagingDirectory "coretools-visualstudio" | ||
|
||
# Get OOP Artifact Version | ||
$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' | ||
|
||
# Get inProc Artifact Version | ||
$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' | ||
|
||
# Get the current release number from ADO | ||
$releaseNumberFull = $env:RELEASE_RELEASENAME | ||
$releaseNumber = ($releaseNumberFull -replace '\D', '') | ||
|
||
# Create the JSON file | ||
$metadata = @{ | ||
defaultArtifactVersion = $oopVersion | ||
inProcArtifactVersion = $inProcVersion | ||
consolidatedBuildId = $releaseNumber | ||
} | ||
|
||
# Set the output path for the JSON file in the StagingDirectory | ||
$jsonOutputPath = Join-Path $StagingDirectory "metadata.json" | ||
|
||
# Convert to JSON and save to file | ||
$metadata | ConvertTo-Json | Set-Content -Path $jsonOutputPath | ||
|
||
Write-Host "Metadata file generated successfully at $jsonOutputPath" | ||
|
||
# Read and print the JSON content | ||
$jsonContent = Get-Content -Path $jsonOutputPath | ||
Write-Host "Contents of metadata.json:" | ||
Write-Host $jsonContent |
39 changes: 0 additions & 39 deletions
39
src/Azure.Functions.ArtifactAssembler/PipelineHelpers/zipCliArtifacts.ps1
This file was deleted.
Oops, something went wrong.