0

I have a web project written in Sitecore 8/uCommerce. I am using Teamcity to compile and package the project and Octopus deploy to push it out. When I commit to SVN Teamcity picks up the changes, compiles and packages it up and Octopus deploys it to the Dev environment. All works well. However when I try to promote to test I get an error...

Error running conventions; running failure conventions... Fatal
10:24:19 Deployment on the Tentacle failed.

In the project I have a post deploy script (PostDeploy.ps1) to remove unwanted config files. There is only one line...

.\DeleteConfig.exe $OctopusEnvironmentName

I changed it to this from..

.\DeleteConfig.exe $OctopusParameters['Octopus.Environment.Name']

Due to an article I read, but this hasn't changed the error. I have also tried..

.\DeleteConfig.exe $OctopusParameters['OctopusEnvironmentName']

Again no effect. If I comment out the line of code I no longer get the error.

I have been trying to fix this for sometime now, read and followed the articles and post I can find on the problem but cannot find the fix.

A slight curveball is that this is the second project we deploy in this way. The first is also Sitecore/uCommerce and in the PostDeploy.ps1 the line

.\DeleteConfig.exe $OctopusParameters['Octopus.Environment.Name']

works perfectly.

Any help or pointers would be appreciated.

Yan Sklyarenko
  • 31,557
  • 24
  • 104
  • 139
Fred
  • 5,663
  • 4
  • 45
  • 74
  • 1
    Is the post deploy script an Octopus Powershell step or is it a powershell script when is checked in with your project (into source control)? – jammykam Jun 28 '16 at 10:18
  • @jammykam Its a file that is part of the project and checked into SVN – Fred Jun 28 '16 at 10:31
  • @Fred does that `.\DeleteConfig.exe` file exist? Also as you are trying to run an executable, have you checked that permissions are set correctly on the tentacle? We do something similar in a `PostDeploy.ps1` script, but rather than running an exe file, we just use powershell commands to delete the config files. Maybe that approach would be less problematic – Richard Seal Jun 28 '16 at 14:31
  • @RichardSeal Yes the file does exist and permission was one of the things I checked. They are the same as the other project that works. Its really odd. I do like the alternative you have mentioned though so I will see if that makes a difference. Thanks – Fred Jun 29 '16 at 08:29
  • 1
    You could as well have a Powershell script as part of Octopus step (post deploy) as an alternative solution. If you use in many places could be abstracted to a `Script modules` section in `Library` menu. – Alex M Jun 29 '16 at 10:58

1 Answers1

0
  1. You don't need a post deploy script as there is a community task that cleans up any extra configuration files. It's at https://library.octopusdeploy.com/step-templates/9a2b84db-2940-4d9a-b61f-c82df35cee6c/actiontemplate-file-system-clean-configuration-transforms.

  2. If you want to do it your way, I would simply use Poweshell like this:

    Get-ChildItem -Filter Web.*.config l Remove-Item

Ben Richards
  • 3,437
  • 1
  • 14
  • 18