You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/wiki/The CI environment - Publishing.md
+72-2Lines changed: 72 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,7 @@
1
1
This section provides an overview of the principles the publishing is built upon, how it is set up, and how you can interact with it.
2
2
3
3
-[Publishing overview](#publishing-overview)
4
+
-[Module identifiers](#module-identifiers)
4
5
-[How it works](#how-it-works)
5
6
-[Example scenario](#example-scenario)
6
7
-[Output example](#output-example)
@@ -17,11 +18,79 @@ The publishing phase concludes each module's pipeline. If all previous tests suc
17
18
18
19
Besides the publishing phase's runtime, there is also the possibility to set the switch `Publish prerelease module`. This switch makes it possible to publish a prerelease version in every workflow run that is not based on `main` or `master`. This can be controlled when running the module pipeline leveraging [Module pipeline inputs](./The%20CI%20environment%20-%20Pipeline%20design#module-pipeline-inputs).
19
20
20
-
> **Note**<br>
21
-
> The `version` used for publishing any artifact is the same for all three target locations, which reduces the maintenance effort.
21
+
> **Note**: The `version` used for publishing any artifact is the same for all three target locations, which reduces the maintenance effort.
22
22
23
23
> **Note:** The orchestration options described in the [solution creation](./Solution%20creation) section work differently well with the publishing locations we offer in CARML. To help you select the best location for your use case, we provide further information [here](./Solution%20creation#publish-location-considerations) section.
24
24
25
+
## Module identifiers
26
+
27
+
The names of published modules differ slighly depending on the location they are published to. This is rooted in the different requirements per target location. In the following you can find the rules applied for each:
28
+
29
+
<details>
30
+
<summary>Template Specs</summary>
31
+
32
+
**Actions**
33
+
34
+
- Remove the root folder name `modules` from provided module reference
35
+
- Make lowercase
36
+
- Replace `Microsoft` with `MS`
37
+
- Replace all `\` or `/` with `.`
38
+
- Remove all duplications in the path. For example, the path `virtualNetwork/virtualNetworkPeerings` would be shortened to `virtualNetwork/peerings`
@@ -36,6 +105,7 @@ The publishing works as follows:
36
105
> Example: Using the Bicep registry, the reference to a `major.minor` could look like: `br/modules:microsoft.resources.resourcegroups:0.4` which means that the template will always consume whatever the potentially overwritten/updated version `0.4` contains.
37
106
1. For a changed child module, the direct parent hierarchy is also registered for an update, following the same procedure as above.
38
107
1. The list of module files paths and their versions are passed on as a array list.
108
+
1. The [Get-ModulesMissingFrom*.ps1](https://github.com/Azure/ResourceModules/tree/main/utilities/pipelines/resourcePublish) scripts further check if a given module is missing from the corresponding target location (e.g., Azure Container Registry) and adds each missing entry to to aforementioned array - using the version specified in the module's `version.json` file.
39
109
1. The different publishing scripts run (Artifact, Template Spec or Bicep Registry) and publish the module to the respective target location for each item on the list.
# This is requried as certain modules generate names such as `MS.RecoveryServices.vaults.replicationFabrics.replicationProtectionContainers.replicationProtectionContainerMappings` which are longer than the allowed 90 characters for template specs
30
+
# Using the logic below, the name is shortened to `MS.RecoveryServices.vaults.replicationFabrics.replicationProtectionContainers.Mappings` which has 'only' 86 characters
31
+
$nameElems=$templateSpecIdentifier-split'\.'
32
+
for ($index=0; $index-lt$nameElems.Count; $index++) {
33
+
if ($index-lt ($nameElems.count-1)) {
34
+
$stringToRemove=$nameElems[($index)]
35
+
$stringToCheck=$nameElems[($index+1)]
36
+
37
+
if ($stringToRemove.EndsWith('s') -and$stringToCheck.StartsWith($stringToRemove.Substring(0,$stringToRemove.length-1))) {
0 commit comments