Fred
Fred

Reputation: 5808

Error deploying solution using Octopus deploy

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.

Upvotes: 0

Views: 718

Answers (1)

Ben Richards
Ben Richards

Reputation: 3575

  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

Upvotes: 0

Related Questions