Skip to content

Add support for custom sort order#121

Merged
daltondhcp merged 3 commits intoAzure:mainfrom
SimonWahlin:customOrder
Sep 7, 2022
Merged

Add support for custom sort order#121
daltondhcp merged 3 commits intoAzure:mainfrom
SimonWahlin:customOrder

Conversation

@SimonWahlin
Copy link
Collaborator

@SimonWahlin SimonWahlin commented Jun 11, 2022

Overview/Summary

Add option to configure in which order templates will be deployed by adding a conditional step between Diff and Validate/Deploy.

I am a bit uncertain on if the variable AZOPS_CUSTOM_SORT_ORDER should be put into the credentials variable group or if a new group should be created. If a new group should be created, I am uncertain of what to name it.
I have considered the following names:

  • azops
  • azopsConfig
  • config

I do not think it should be named anything related to settings to avoid confusion with settings.json

This PR fixes/adds/changes/removes

  1. Add support for custom sort order of templates

Breaking Changes

For Azure DevOps only: Requires creation of variable group azops as well as granting pipelines access to that group.

Testing Evidence

CustomSorting step sorts files in diff.txt
image

Deploy step uses parameter -CustomSortOrder and picks up on the order in diff.txt
image

As part of this Pull Request I have

Fixes Azure/AzOps#592

@SimonWahlin SimonWahlin marked this pull request as ready for review June 12, 2022 18:44
@SimonWahlin SimonWahlin added the enhancement 💡 New feature or request label Jun 15, 2022
@daltondhcp daltondhcp self-assigned this Jul 11, 2022
@daltondhcp
Copy link
Contributor

I have tested the functionality and it works as expected - awesome job! 😄
Do you think it makes sense to externalize the script as it becomes quite cumbersome to manage 30+ lines of PS directly in the yaml pipeline?

@SimonWahlin
Copy link
Collaborator Author

Sure, I can put the code in a scripts folder. How about .pipelines/.script/customSortOrder.ps1?

Or maybe have a generic location for both GitHub and ADO? Maybe .scripts/customSortOrder.ps1?

@daltondhcp
Copy link
Contributor

Sure, I can put the code in a scripts folder. How about .pipelines/.script/customSortOrder.ps1?

Or maybe have a generic location for both GitHub and ADO? Maybe .scripts/customSortOrder.ps1?

Sounds like a good plan to me!

@SimonWahlin
Copy link
Collaborator Author

Sorry for the delay, should be working now.

@daltondhcp daltondhcp merged commit 6edcdaf into Azure:main Sep 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement 💡 New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add option to specify deployment order

2 participants