Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trigger option to set specific build parameters?

I'm looking for a way to attach some specific build parameter to a scheduled trigger.

The idea is that we are continuously building debug versions of our products. Our nightly build has to be a release build, though. The build configurations for most of our projects is absolutely the same. It even has a configuration parameter, already. So all I would need is a trigger which allows for specifying an override for a single build parameter. That would cut the build configurations to maintain by half.

Is there a way to achieve this?

like image 256
freefall Avatar asked Apr 04 '12 08:04

freefall


2 Answers

Not right now, you can follow this issue.

like image 93
Evgeny Goldin Avatar answered Sep 24 '22 18:09

Evgeny Goldin


The approach I use is to create a "Deploy :: Dev D1 :: Run all integration tests" build. I then create a build trigger on each integration service build.

I create a parameter called "env:OctopusEnvironment" for integration service build. Set the value to be empty. I like to use prompt and display:

select display='prompt' label='OctopusEnvironment' data_13='Production' data_12='CI' data_11='Local - Hassan' data_10='Local - Mustafa' description='OctopusEnvironment' data_02='Test T1' data_01='Dev D1' data_04='Local - Taliesin' data_03='Continuous Deployment CI 1' data_06='Local - Paulius' data_05='Local - Ravi' data_08='Local - Venkata' data_07='Local - Marko' data_09='Local - Ivan' 

In each integration service build I add this powershell step:

$octopusEnvironment = ($env:OctopusEnvironment).Trim()  Write-Host "Octopus environment = '$octopusEnvironment'" if ($octopusEnvironment.Length -lt 1) {     Write-Host "Auto detecting octopus environment"     $trigger = '%teamcity.build.triggeredBy%' -split '::'     if ($trigger.Length -gt 2){         $environment = $trigger[1].Trim()         Write-Host "##teamcity[setParameter name='env.OctopusEnvironment' value='$environment']"     } } 

So now I can run the integration test via a trigger and when I run it directly it will prompt me on which environment to run integration test against.

like image 33
Taliesin Avatar answered Sep 21 '22 18:09

Taliesin