Skip to content

Instantly share code, notes, and snippets.

@tobiaszuercher
Created September 20, 2017 09:39
Show Gist options
  • Save tobiaszuercher/ca14cadb84889afd60dbb5ab5c3ccfef to your computer and use it in GitHub Desktop.
Save tobiaszuercher/ca14cadb84889afd60dbb5ab5c3ccfef to your computer and use it in GitHub Desktop.
PreDeploy script to use transformer with octopus deploy
$transformer_exe = Resolve-Path "tools/transformer.exe"
$path = pwd | select -ExpandProperty Path
$args = @("transform", "--environment", $OctopusParameters["Octopus.Environment.Name"], "--path", $path, "--delete-templates")
if ([string]::IsNullOrEmpty($OctopusParameters["transformer.masterkey"]) -eq $false) {
write-host "add password"
$args += "--password"
$args += $OctopusParameters["transformer.masterkey"]
}
& $transformer_exe $args
# self destruction...
Remove-Item .transformer -Force -Recurse
Remove-Item tools -Force -Recurse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment