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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,463,395
Community Members
 
Community Events
176
Community Groups

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

3 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

Atlassian Community Events