I could need a "smarter" solution import task #200
Replies: 3 comments 2 replies
-
I had the same need, so I wrote my own wrapper in PowerShell that gets the version of the solution in the target and gets the version of the solution in source if is there is any major or minor version increment perform an upgrade, if there is a build or revision version increment perform update (this is to support patching) if all versions are the same, skip. The current problem with this is |
Beta Was this translation helpful? Give feedback.
-
Using Microsoft.Xrm.Data.PowerShell, connect to the environment to retrieve the solution by name using Get-CrmRecords filtering on the solution entity and get its version. |
Beta Was this translation helpful? Give feedback.
-
We are adding new flag |
Beta Was this translation helpful? Give feedback.
-
We are storing the solutions in one .git repository. The solution structure is component based, so we have to follow a specific import order. A commit on a solution folder triggers a publish artifact pipeline which publishes the resulting new artifact.
We are having a release distributing the solutions to an internal test system on a nightly basis. My experience is, that the most reliable and stable result is created when a solution is imported managed and upgraded afterwards. This is also necessary as often components are deleted and recreated differently during development iterations due to changed requirements or simply by mistakes.
Therefore I would like to create a release, that only imports a solution when its version is set higher as found in the target organization. When this is not the case, there should be no point in importing it at all.
Here comes the problem in. Not all solutions are modified every day. So a release with just import + upgrade tasks will fail due to a solution version violation on a solution that was not modified. If I now configure those tasks to run even if previous tasks have failed the result will show up as partially succeeded after it has finished. That is bad in those cases, where the solution import failed due to a problem with the solution itself. In this case it would also show up as partially succeeded and not as failed.
Therefore I would like to have an option like "Skip import if solution version is not higher than in target organization" that compares both versions and only executes the task if the newer version enables the solution for an upgrade after the import.
There might also be some other way to achieve this like comparing an artifact against earlier releases and if they were used already as just one idea. I am open for everything that would workaround these problems and just let me import with a following upgrade when necessary. This would also lower deployment duration and resource usage.
So if anyone has any idea how to achieve this it would be greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions