Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

Recognition

  • Give kudos
  • My kudos

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Calling MSBuild using YAML Bamboo Specs

Bamboo Version: 6.9.2

I'm in the process of converting the majority of my organization's plans to use Bamboo's YAML Spec for our build and deployment processes to benefit from all the goodness that configuration-as-code brings to the pipeline.

I'm running into a bit of a snag trying to add a build task that uses MSBuild to compile solution files. I see that I should be able to reference execute capabilities using a script entry (documentation here), but I don't think I'm using the right variable name.

---
version: 2

# <plan-info>

stages:
- Build:
- Build

Build:
tasks:
- clean
# <some-build-steps>
- script: "${system.builder.msbuild.MSBuild v14.0 (32bit)} solution.sln"
# <more-build-steps>
requirements:
- "system.builder.msbuild.MSBuild v14.0 (32bit)"
# <artifacts>
...

It looks like the error is that the ${system.builder.msbuild.MSBuild v14.0 (32bit)} variable isn't being changed to the executable path in the build log's error file:

Capture1.PNG

I've tried to escape the spaces with single/double backslashes (documentation here), but I still get the same error, just with an added backslash after msbuild.MSBuild.

The agent capability does show up in the stage's requirements, so I'm not quite sure what I'm missing in the script entry.

Capture.PNG

If anyone can point me in the right direction, I'd be super grateful! I'm 99% sure that my ${system.builder.msbuild.MSBuild v14.0 (32bit)} variable is the problem, I just don't know how to modify it so that it gets changed to the actual executable path.

1 answer

1 accepted

2 votes
Answer accepted

Good news! I found the problem. Replacing the script entry with the following calls MSBuild successfully.

- script: "\"${bamboo.capability.system.builder.msbuild.MSBuild v14.0 (32bit)}\" solution.sln"

 Thanks to this post here that hinted at what I was missing!

I'd like to suggest to the Atlassian team that the YAML Bamboo Specs documentation be updated to include the bamboo.capability prefix when referencing an executable; it might be obvious to more seasoned Bamboo users, but it would help new users like me out greatly.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bamboo

Bamboo 7.1 is here and is packed with value!

I'm happy to announce that Bamboo 7.1 has been released and it’s overflowing with awesome new features. Top-voted issues First and foremost, a bunch of JAC top voted issues has been delivered - y...

694 views 1 6
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you