Normally the easiest way to do this would be to generate the pipeline LABEL 
from these constructs and this label is available as an environment 
variable in every stage and the label can be carried forward through 
materials in upstream pipelines in the value stream. However because your 
label is generated as a side effect of artifacts in your build it is not 
currently possible in GoCd to update a label after a stage has started 
(https://github.com/gocd/gocd/issues/52).

So your other option is to take this label and output it to a file and then 
archive this file as an artifact of the first pipeline stage. Subsequent 
stages can then use the FetchArtifact task to fetch this artifact from 
previous stages (or even downstream pipelines in the VSM). Once you've 
fetched this file then you can use it directly or load it into an 
environment variable. Here's an example what the configration of your 
DeployToDev might look like (on linux) 

Tasks:

FetchArtifact:  *pipeline Name*: yourPipelineName *pipeline Stage*: build j*ob 
Name*: yourJob *Source FIle *buildLabel: /myDir/label.txt
CustomCommand: /bin/bash A*rguments:* -c export LABEL=$(cat ./label.txt) && 
./octopusWhateverItDoes deploy $LABEL


Cheers,
D.

On Wednesday, October 4, 2017 at 12:24:37 PM UTC+13, munchrall wrote:
>
> Somewhat new to GO and I inherited our company's CICD system recently from 
> someone who's no longer available to inquire, so please bare with me.
>
> Our pipelines inherit from a Template that has 4 Stages
>
> - Build
> - DeployToDev
> - DeployToTest
> - DeployToProd
>
> We utilize TFS as our respostory and use OctopusDeploy to deploy and 
> promote our code.
>
> Our build script creates a release / version number that is a composite of 
> [ChangeSet].[BuildSystemVersionChangeSet].[%PipelineCounter%][%StepCounter]. 
> This is all derived in the Build Stage and passed into the build script.
>
> I need to retain this number somehow so that I can use it in the 
> DeployToDev / DeployToTest / DeployToProd Stages in order to specify to 
> OctopusDeploy which specific release / version needs to be promoted for 
> that specific step.
>
> Therefore, my question is what is the correct manner to store this value 
> from the build stage for later stages, but only for that specific pipeline 
> 'release'.
>
> Any help is appreciated.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"go-cd" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to