Is there a way to link existing templates correctly after upgrading to 3.7.2? I have a few templates (see screenshot) that I would expect to be linked.
The alternative is to give them a different name, import the community template, and change all my deployment steps to the new template, which isn’t a great solution.
Thanks for getting in touch! The linking process executes as part of the sync process which is done during start up and then once a day. This means the links should be created immediately after your 3.7.2 instance starts.
The screenshot above was from after updating to 3.7.2 and hasn’t linked. I restarted the Octopus service to see if it would help, no luck.
One example is “Redgate - Create Database Release”. I’ve checked and all the parameters are the same. I’ve exported the json and attached it here to see if that will help diagnose the problem.
Most of them are not linked, here are three of them.
I’ve run a diff checker on these and the latest versions on github. The main differences I see are:
Id in local scripts being the old format like ActionTemplate-6 vs the new guids.
Parameters have Ids in local scripts, no Ids in github
Empty links object on parameters in local script
Redgate - Deploy from Package has had a parameter removed now (DLMAutomationTemporaryDatabaseServer) so I suppose it makes sense that it didn’t match that one up.
It looks like the code is also checking the script body, so the problem could be that if I am not on the absolute latest version at time of linking, it will never link.
I was able to write a custom extension to link scripts with matching names/parameters and skipped the checking of the script body.
SQL - Execute Script had a Default Value on the “Continue on Error” parameter set to false previously, the script now has no default value set, so once I removed the default value it was able to link correctly.
Thanks for the templates. Yes, we require the ScriptBody to be the same in both templates to make sure we don’t link templates that are different. Also, I had one more look at the original template you attached and it looks like your template has Windows style line endings whereas the template from the community library has Unix style line endings. I will see if we can do anything about that but for now if you believe you have the latest version of the template and the linking is still not working then I would suggest you try to update your custom template manually and then trigger the linking process again. In this particular case you would need to update the script body. I will also update our docs.