Skip to content

Commit

Permalink
add temp bicepconfig to validate bicep
Browse files Browse the repository at this point in the history
Signed-off-by: sk593 <[email protected]>
  • Loading branch information
sk593 committed Aug 12, 2024
1 parent 3a8df14 commit e20fcec
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 6 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/functional-test-cloud.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,30 @@ jobs:
message: |
:hourglass: Publishing Bicep Recipes for functional tests...
- name: Generate test bicepconfig.json
run: |
if [[ "${{ env.REL_VERSION }}" == "edge" ]]; then
RADIUS_VERSION="latest"
else
RADIUS_VERSION="${{ env.REL_VERSION }}"
fi
cat <<EOF > ./test/bicepconfig.json
{
"experimentalFeaturesEnabled": {
"extensibility": true,
"extensionRegistry": true,
"dynamicTypeLoading": true
},
"extensions": {
"radius": "br:${{ env.BICEP_TYPES_REGISTRY }}/test/radius:$RADIUS_VERSION",
"aws": "br:${{ env.BICEP_TYPES_REGISTRY }}/aws:latest"
},
"cloud": {
"credentialPrecedence": ["Environment"]
}
}
EOF
- name: Publish Bicep Test Recipes
run: |
mkdir ./bin
Expand Down
6 changes: 0 additions & 6 deletions bicepconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,5 @@
"extensions": {
"radius": "br:biceptypes.azurecr.io/radius:latest",
"aws": "br:biceptypes.azurecr.io/aws:latest"
},
"cloud": {
"credentialPrecedence": [
"Environment",
"AzureCLI"
]
}
}
6 changes: 6 additions & 0 deletions build/validate-bicep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ fi
WARNING_MSG="WARNING: The following experimental Bicep features"
FILES=$(find . -type f -name "*.bicep")

# Backup the original bicepconfig.json file
cp bicepconfig.json bicepconfig.json.bak

# Update the bicepconfig.json file to include the "cloud" field using sed
sed -i '' 's/^{/{\n "cloud": { "credentialPrecedence": ["Environment"] },/' bicepconfig.json

# Get the first bicep file with Radius and AWS extensions from the list to restore extensions
FIRST_FILE_RAD=""
FIRST_FILE_AWS=""
Expand Down

0 comments on commit e20fcec

Please sign in to comment.