forked from Azure/CanadaPubSecALZ
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Configurable management group hierarchy (Azure#186)
Implement configurable management group hierarchy
- Loading branch information
Showing
17 changed files
with
442 additions
and
59 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
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,45 @@ | ||
# ---------------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. | ||
# Licensed under the MIT license. | ||
# | ||
# THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, | ||
# EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES | ||
# OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. | ||
# ---------------------------------------------------------------------------------- | ||
|
||
steps: | ||
|
||
# Load Variables | ||
- task: Bash@3 | ||
displayName: Load Variables | ||
inputs: | ||
targetType: inline | ||
script: | | ||
$(var-bashPreInjectScript) | ||
### ------------------------------------------------------------------------------------------------- | ||
### Create the 'var-parentManagementGroupId' and 'var-topLevelManagementGroupName' | ||
### variables (used in YAML pipeilne definitions) based on information extracted from the | ||
### newer 'var-managementgroup-hierarchy' variable, if it is defined. | ||
### ------------------------------------------------------------------------------------------------- | ||
hierarchyJson='$(var-managementgroup-hierarchy)' | ||
if [[ -n $hierarchyJson ]]; then | ||
echo "The new 'var-managementgroup-hierarchy' variable IS defined." | ||
echo "REMAPPING 'var-parentManagementGroupId' and 'var-topLevelManagementGroupName' variables." | ||
parentManagementGroupId=`echo $hierarchyJson | jq -r '.id'` | ||
topLevelManagementGroupName=`echo $hierarchyJson | jq -r '.children[0].id'` | ||
echo "##vso[task.setvariable variable=var-parentManagementGroupId]$parentManagementGroupId" | ||
echo "##vso[task.setvariable variable=var-topLevelManagementGroupName]$topLevelManagementGroupName" | ||
else | ||
echo "The new 'var-managementgroup-hierarchy' variable IS NOT defined." | ||
echo "USING existing 'var-parentManagementGroupId' and 'var-topLevelManagementGroupName' variables." | ||
fi | ||
### ------------------------------------------------------------------------------------------------- | ||
### Add more scripts here to remap other variables. For example, if you refactor for existing (flat) | ||
### variables to represent them in JSON notation (objects), then this is a useful approach to | ||
### maintaining backward compatibility while supporting a newer and improved configuration schema. | ||
### ------------------------------------------------------------------------------------------------- | ||
$(var-bashPostInjectScript) |
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
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
Oops, something went wrong.