Upgraded to 3.8.6 for Docker support.
Created a Run a Docker Container step to deploy to a Windows Server 2016 on AWS.
The docker container is deployed and runs fine when no Explicit Variable Mapping is used.
The docker container fails to run when even the simplest Explicit Variable Mapping is used, like blah=“blah”, with the following error
February 9th 2017 11:06:24Info
Performing `docker run` command on 'Test-DockerServer'
February 9th 2017 11:06:26Error
Write-Host : Parameter cannot be processed because the parameter name 'e' is
ambiguous. Possible matches include: -ErrorAction -ErrorVariable.
February 9th 2017 11:06:26Error
At C:\Octopus\Work\20170209000625-51\Script.ps1:3 char:288
+ ... opus.Action.Id="fc7c87fb-c21d-47e3-9d84-ee4ee42c32b8" -e "blah=b ...
+ ~~
+ CategoryInfo : InvalidArgument: (:) [Write-Host], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : AmbiguousParameter,Microsoft.PowerShell.Commands.WriteHostCommand
February 9th 2017 11:06:26Fatal
The remote script failed with exit code 1
February 9th 2017 11:06:26Fatal
Run Transaction Core Service Test container on Test-DockerServer
I intercepted the Script.ps1 generated for the deployment and tried to run it line by line to diagnose the issue at line 3
Write-Host docker run -d --restart no --label Octopus.Release.Number="0.0.11" --label Octopus.Project.Id="Projects-3" --label Octopus.Environment.Id="Environments-41" --label Octopus.Deployment.Id="Deployments-931" --label Octopus.Action.Id="fc7c87fb-c21d-47e3-9d84-ee4ee42c32b8" 9999999999999.dkr.ecr.ap-southeast-2.amazonaws.com/microservices/transaction-core-service-test:1.0.0.35 pause
it runs fine without any environmental variables passed in, but fails with the same error in powershell with the simplest of -e "blah=blah"
Write-Host docker run -d --restart no --label Octopus.Release.Number="0.0.11" --label Octopus.Project.Id="Projects-3" --label Octopus.Environment.Id="Environments-41" --label Octopus.Deployment.Id="Deployments-931" --label Octopus.Action.Id="fc7c87fb-c21d-47e3-9d84-ee4ee42c32b8" -e "blah=blah" 9999999999999.dkr.ecr.ap-southeast-2.amazonaws.com/microservices/transaction-core-service-test:1.0.0.35 pause
To fix, simply enclose the printed command in single quotation marks as follows
Write-Host 'docker run -d --restart no --label Octopus.Release.Number="0.0.11" --label Octopus.Project.Id="Projects-3" --label Octopus.Environment.Id="Environments-41" --label Octopus.Deployment.Id="Deployments-931" --label Octopus.Action.Id="fc7c87fb-c21d-47e3-9d84-ee4ee42c32b8" -e "blah=blah" 9999999999999.dkr.ecr.ap-southeast-2.amazonaws.com/microservices/transaction-core-service-test:1.0.0.35 pause'
See http://serverfault.com/questions/47811/what-is-the-literal-escape-character-in-powershell
Please fix this asap, as my work is blocked. Please also let me know if there is anything I can do with my Octopus installation to unblock myself in the meantime.