How to pass-along TFS Build variables

What would be the best way to provide a project-release with specific TFS Build properties… for example, the TFS build.Id (so a powershell script can call the Visual Studio Online REST API’s ‘Set Build Quality’)?

Hi Sean,

Thanks for reaching out. I’m afraid i’m not quite following your question. Would you mind explaining it a bit more in detail?

Sorry for me being dumb :slight_smile:

Dalmiro

For example:
I would like to create a release step (aka a ps1 script) that calls a VSO (TFS online) rest service to set a TFS build property. When the Release is completed and successful, I’d like the TFS Build’s “Build Quality” property to be automatically set to a value of “Deployed”.

To call a VSO rest service, I would need to know some TFS build specifics… like the “Build ID”, “Build Url”, etc…
To call the VSO rest service’s ‘set the build quality’, I would need to know the TFS Build’s "Build ID’ value.

http://www.visualstudio.com/integrate/api/build/builds#ModifyabuildSetthebuildquality

I am hoping there is a way to include some TFS Build property values within the generated Nuget metadata.
I realize there is probably no other interface between TFS and an Octopus Deploy project, except for what is within the Nuget metadata… but I am guessing that someone has already crossed this bridge :slight_smile:

Hi Sean,

Sorry for the delay. I’ve given this a thought and i believe the easiest way would be to

  1. Put the buid info you want into a text file during the deployment process and add that file to your nuget package using octopack’s OctoPackEnforceAddingFiles.

  2. From Octopus, have a powershell script to read the values of that file and use it to call VSO’s rest service.

If you need help with any of the steps, let me know and we’ll figure it out together.

Thanks!

Dalmiro.

Not sure if this is what you’re after, but I pass the octopus project, build number, build definition, and team project as project variables to Octopus during build time.

Then I have a custom step template that updates the quality on a successful deployment.

This all boils down to two powershell scripts and the addition of one invoke process activity to the build template.

Hello,
Simple.The Question is You Find a Section Octopus in Build Definition where it has Project Variable .The Think is How to Populate the Project Name which is created in Octopus to Build Definition File

Hi Navaneeth,

Thanks for getting in touch. The build definition configuration usually comes 1-2 steps before the deployment in the application development lifecycle. This can make passing values from a step to a previous one a bit of a hard task.

If you want to get information from Octopus and put it on your Build Definition, the only way I can think of is by writing some code that takes the information from Octopus using its API, and then injects it on your Build Definition.

Best regards,
Dalmiro

We accomplished this by passing the TFS Build number along as Release Notes. We use Octo.exe to create the release, and specify the build number using the --releaseNotes parameter. (Note this is the release notes of the Release, not the NuGet package.)