Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: calling publish --with-source with bicep template #1040

Merged
merged 30 commits into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
657d2ee
Rename folder
eriqua Oct 15, 2023
f9e6b5d
Add tests unit placeholder
eriqua Oct 15, 2023
2999821
Rename to min and regen
eriqua Oct 15, 2023
73b2485
example metadata
eriqua Oct 15, 2023
aca41db
new line
eriqua Oct 15, 2023
565b2bb
new line revert
eriqua Oct 15, 2023
4035d68
Merge branch 'main' of https://github.com/Azure/bicep-registry-modules
eriqua Oct 16, 2023
89eede7
orphaned file
eriqua Oct 16, 2023
24c394d
orphaned file
eriqua Oct 16, 2023
6012070
Merge branch 'main' of https://github.com/Azure/bicep-registry-module…
eriqua Oct 29, 2023
de1f8e3
Merge branch 'main' of https://github.com/Azure/bicep-registry-module…
eriqua Feb 4, 2024
d9e58ee
remove orphaned
eriqua Feb 4, 2024
83325ba
Merge branch 'main' into fix/orphaned
eriqua Feb 9, 2024
1d96e0b
Merge branch 'main' into fix/orphaned
eriqua Feb 9, 2024
ae3453c
Merge branch 'main' of https://github.com/Azure/bicep-registry-module…
eriqua Feb 9, 2024
76d71d8
Merge branch 'main' of https://github.com/Azure/bicep-registry-module…
eriqua Feb 10, 2024
b88feca
fix: unorphaned compute image
eriqua Feb 10, 2024
4dda33d
Merge branch 'main' into fix/orphaned-cimage
ChrisSidebotham Feb 12, 2024
9c35c6b
Merge branch 'main' into fix/orphaned-cimage
eriqua Feb 14, 2024
35e1af4
Merge branch 'main' of https://github.com/Azure/bicep-registry-module…
eriqua Feb 15, 2024
1dc912e
regen json for app container app
eriqua Feb 15, 2024
f07d4b0
Merge branch 'main' into feat/bump_version
eriqua Feb 16, 2024
853b9d7
Merge branch 'main' into feat/bump_version
eriqua Feb 17, 2024
6850813
replace json with bicep
eriqua Feb 18, 2024
356d933
Merge branch 'main' of https://github.com/Azure/bicep-registry-module…
eriqua Feb 19, 2024
de6d121
revert brm yml
eriqua Feb 19, 2024
3655892
test version update
eriqua Feb 19, 2024
a35fc11
test publish
eriqua Feb 19, 2024
9e01efa
revert avm template
eriqua Feb 19, 2024
33b9c4e
revert test module version
eriqua Feb 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ function Publish-ModuleFromTagToPBR {
$targetVersion = Split-Path $ModuleReleaseTagName -Leaf
$moduleRelativeFolderPath = $ModuleReleaseTagName -replace "\/$targetVersion$", ''
$moduleFolderPath = Join-Path $repositoryRoot $moduleRelativeFolderPath
$moduleJsonFilePath = Join-Path $moduleFolderPath 'main.json'
Write-Verbose "Determined JSON template Path [$moduleJsonFilePath]"
$moduleBicepFilePath = Join-Path $moduleFolderPath 'main.bicep'
Write-Verbose "Determined Bicep template path [$moduleBicepFilePath]"

# 2. Get the documentation link
$documentationUri = Get-ModuleReadmeLink -TagName $ModuleReleaseTagName -ModuleFolderPath $moduleFolderPath
Expand All @@ -53,7 +53,7 @@ function Publish-ModuleFromTagToPBR {
$plainPublicRegistryServer = ConvertFrom-SecureString $PublicRegistryServer -AsPlainText

$publishInput = @(
$moduleJsonFilePath
$moduleBicepFilePath
'--target', ("br:{0}/public/bicep/{1}:{2}" -f $plainPublicRegistryServer, $moduleRelativeFolderPath, $targetVersion)
'--documentationUri', $documentationUri
'--with-source'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function Publish-ModuleFromPathToPBR {
. (Join-Path $RepoRoot 'avm' 'utilities' 'pipelines' 'sharedScripts' 'tokenReplacement' 'Convert-TokensInFileList.ps1')

$moduleFolderPath = Split-Path $TemplateFilePath -Parent
$moduleJsonFilePath = Join-Path $moduleFolderPath 'main.json'
$moduleBicepFilePath = Join-Path $moduleFolderPath 'main.bicep'

# 1. Test if module qualifies for publishing
if (-not (Get-ModulesToPublish -ModuleFolderPath $moduleFolderPath)) {
Expand All @@ -66,9 +66,9 @@ function Publish-ModuleFromPathToPBR {
# 5. Get the documentation link
$documentationUri = Get-ModuleReadmeLink -TagName $tagName -ModuleFolderPath $moduleFolderPath

# 6. Replace telemetry version value (in JSON)
# 6. Replace telemetry version value (in Bicep)
$tokenConfiguration = @{
FilePathList = @($moduleJsonFilePath)
FilePathList = @($moduleBicepFilePath)
AbsoluteTokens = @{
'-..--..-' = $targetVersion
}
Expand All @@ -77,11 +77,11 @@ function Publish-ModuleFromPathToPBR {
$null = Convert-TokensInFileList @tokenConfiguration

# Double-check that tokens are correctly replaced
$templateContent = Get-Content -Path $moduleJsonFilePath
$templateContent = Get-Content -Path $moduleBicepFilePath
$incorrectLines = @()
for ($index = 0; $index -lt $templateContent.Count; $index++) {
if ($templateContent[$index] -match '-..--..-') {
$incorrectLines += ('You have the token [{0}] in line [{1}] of file [{2}]. Please seek advice from the AVM team.' -f $matches[0], ($index + 1), $moduleJsonFilePath)
$incorrectLines += ('You have the token [{0}] in line [{1}] of file [{2}]. Please seek advice from the AVM team.' -f $matches[0], ($index + 1), $moduleBicepFilePath)
}
}
if ($incorrectLines) {
Expand All @@ -94,7 +94,7 @@ function Publish-ModuleFromPathToPBR {
$plainPublicRegistryServer = ConvertFrom-SecureString $PublicRegistryServer -AsPlainText

$publishInput = @(
$moduleJsonFilePath
$moduleBicepFilePath
'--target', ("br:{0}/public/bicep/{1}:{2}" -f $plainPublicRegistryServer, $publishedModuleName, $targetVersion)
'--documentationUri', $documentationUri
'--with-source'
Expand Down
Loading