Skip to content

Commit

Permalink
fix: set azure variables to be used in templates
Browse files Browse the repository at this point in the history
  • Loading branch information
karlbaumhauer committed Jun 30, 2023
1 parent 4102153 commit 890a3c9
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 14 deletions.
8 changes: 4 additions & 4 deletions .azuredevops/pipelines/templates/purge-cdn.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ steps:
--resource-group rg-staticcontent-prod-frontend-cdn \
--profile-name cdn-staticcontent-prod-frontend-cdn \
--name "fe-solid-design-system-prod" \
--content-paths "/$version/*" \
--content-paths "/$(version)/*" \
--no-wait
set +x
Expand All @@ -24,7 +24,7 @@ steps:
--resource-group rg-staticcontent-prod-frontend-cdn \
--profile-name cdn-staticcontent-prod-frontend-cdn \
--name "fe-solid-design-system-prod" \
--content-paths "/$patchWildcardPath/*" \
--content-paths "/$(patchWildcardPath)/*" \
--no-wait
set +x
Expand All @@ -34,7 +34,7 @@ steps:
--resource-group rg-staticcontent-prod-frontend-cdn \
--profile-name cdn-staticcontent-prod-frontend-cdn \
--name "fe-solid-design-system-prod" \
--content-paths "/$majorWildcardPath/*" \
--content-paths "/$(majorWildcardPath)/*" \
--no-wait
set +x
Expand All @@ -44,7 +44,7 @@ steps:
--resource-group rg-staticcontent-prod-frontend-cdn \
--profile-name cdn-staticcontent-prod-frontend-cdn \
--name "fe-solid-design-system-prod" \
--content-paths "/$minorWildcardPath/*" \
--content-paths "/$(minorWildcardPath)/*" \
--no-wait
set +x
fi
32 changes: 22 additions & 10 deletions .azuredevops/pipelines/templates/push-to-storage-main.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ steps:
versionArray=($(echo "$version" | tr '.' ' '))
echo "Version array is ${versionArray[@]}"
# set version paths
# Set version paths
echo "Version path is: $version"
patchWildcardPath="x.x.x"
echo "Patch-wildcard path is: $patchWildcardPath"
Expand All @@ -27,8 +27,20 @@ steps:
minorWildcardPath+=${path}
echo "Minor-wildcard path is: $minorWildcardPath"
fi
# Set Azure variables to use in templates
echo "##vso[task.setvariable variable=version]$version"
echo $(version)
echo "##vso[task.setvariable variable=patchWildcardPath]$patchWildcardPath"
echo $(patchWildcardPath)
echo "##vso[task.setvariable variable=majorWildcardPath]$majorWildcardPath"
echo $(majorWildcardPath)
echo "##vso[task.setvariable variable=minorWildcardPath]$minorWildcardPath"
echo $(minorWildcardPath)
echo "##vso[task.setvariable variable=path]$path"
echo $(path)
fi
displayName: 'Set version variables'
displayName: 'Set version and wildcard variables'
## Deploy to CDN
- task: AzureCLI@2
Expand All @@ -45,8 +57,8 @@ steps:
az storage blob upload-batch \
--destination \$web \
--account-name "safesoliddesignsysprod" \
--source "dist${path}" \
--destination-path "/$version" \
--source "dist$(path)" \
--destination-path "/$(version)" \
--overwrite
set +x
Expand All @@ -56,8 +68,8 @@ steps:
az storage blob upload-batch \
--destination \$web \
--account-name "safesoliddesignsysprod" \
--source "dist${path}" \
--destination-path "/$patchWildcardPath" \
--source "dist$(path)" \
--destination-path "/$(patchWildcardPath)" \
--overwrite
set +x
Expand All @@ -67,8 +79,8 @@ steps:
az storage blob upload-batch \
--destination \$web \
--account-name "safesoliddesignsysprod" \
--source "dist${path}" \
--destination-path "/$minorWildcardPath" \
--source "dist$(path)" \
--destination-path "/$(minorWildcardPath)" \
--overwrite
set +x
Expand All @@ -78,8 +90,8 @@ steps:
az storage blob upload-batch \
--destination \$web \
--account-name "safesoliddesignsysprod" \
--source "dist${path}" \
--destination-path "/$majorWildcardPath" \
--source "dist$(path)" \
--destination-path "/$(majorWildcardPath)" \
--overwrite
set +x
fi
Expand Down

0 comments on commit 890a3c9

Please sign in to comment.