Skip to content

Commit 70b818e

Browse files
author
Sheyla Trudo
committed
fixup! Artifacts
1 parent b725957 commit 70b818e

File tree

2 files changed

+31
-27
lines changed

2 files changed

+31
-27
lines changed

.pipelines/templates/artifact-storage.steps.yaml

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -20,32 +20,6 @@ steps:
2020
echo >&2 "##vso[task.setvariable variable=SUBSCRIPTION_ID]$SUBSCRIPTION_ID"
2121
2222
23-
- task: AzureCLI@2
24-
displayName: "[Provision] Build User Owner Role Definition"
25-
inputs:
26-
azureSubscription: $(ACN_TEST_SERVICE_CONNECTION)
27-
scriptType: bash
28-
scriptLocation: inlineScript
29-
addSpnToEnvironment: true
30-
inlineScript: |
31-
set -e
32-
[[ -n $SYSTEM_DEBUG ]] && [[ $SYSTEM_DEBUG =~ $IS_TRUE ]] && set -x || set +x
33-
34-
set -x
35-
pwd
36-
ls -la
37-
DEFS_FOUND=$(az role definition list --name "$ACNCI_BUILDUSER_ROLE_NAME" --custom-role-only -ojson | jq length)
38-
39-
DEF=$(cat ./azure-container-networking/.pipelines/templates/mi-build-role.json | jq -rc '.')
40-
if (( $DEFS_FOUND < 1 )); then
41-
az role definition create \
42-
--role-definition "$DEF"
43-
else
44-
az role definition update \
45-
--role-definition "$DEF"
46-
fi
47-
48-
4923
## Resource Groups ##
5024
- bash: |
5125
set -x
@@ -239,6 +213,36 @@ steps:
239213
240214
241215
## MI Role Assignments ##
216+
- task: AzureCLI@2
217+
displayName: "[Provision] Build User Owner Role Definition"
218+
inputs:
219+
azureSubscription: $(ACN_TEST_SERVICE_CONNECTION)
220+
scriptType: bash
221+
scriptLocation: inlineScript
222+
addSpnToEnvironment: true
223+
inlineScript: |
224+
set -e
225+
[[ -n $SYSTEM_DEBUG ]] && [[ $SYSTEM_DEBUG =~ $IS_TRUE ]] && set -x || set +x
226+
227+
set -x
228+
pwd
229+
ls -la
230+
DEFS_FOUND=$(az role definition list --name "$ACNCI_BUILDUSER_ROLE_NAME" --custom-role-only -ojson | jq length)
231+
232+
DEF=$(cat ./azure-container-networking/.pipelines/templates/mi-build-role.json | \
233+
jq -rc \
234+
--arg RESOURCE_GROUP_ID "$ACNCI_BUILD_RESOURCEGROUP_ID" \
235+
-rc '.')
236+
if (( $DEFS_FOUND < 1 )); then
237+
az role definition create \
238+
--role-definition "$DEF"
239+
else
240+
az role definition update \
241+
--role-definition "$DEF"
242+
fi
243+
env:
244+
ACNCI_BUILD_RESOURCEGROUP_ID: $(resourcegroups.ACNCI_BUILD_RESOURCEGROUP_ID)
245+
242246
- task: AzureCLI@2
243247
displayName: "[Check] Build User MI Roles"
244248
inputs:

.pipelines/templates/mi-build-role.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,6 @@
5656
],
5757
"notDataActions": [],
5858
"assignableScopes": [
59-
"$RESOURCE_GROUP_ID"
59+
$RESOURCE_GROUP_ID
6060
]
6161
}

0 commit comments

Comments
 (0)