Creating a Bamboo build plan using the Rest API

Hi!

I see that task BAM-4854 was solved by release 6.0.0. But I couldn't find any new information about plan creation in the REST API documentation.

When can we start using this feature?

2 answers

0 votes

It's possible to create plan by Bamboo Specs, which uses REST endpoint, that's why that issue was closed. Please look at Bamboo Specs documentation https://confluence.atlassian.com/bamboo/bamboo-specs-894743906.html

Unfortunately this solution does not work in windows.  When I ran

mvn -Ppublish-specs

I got this error:

[ERROR] Failed to execute goal com.atlassian.bamboo:bamboo-specs-runner:6.0.2:run (default-cli) on project bamboo-specs-tutorial: Execution default-cli of goal com.atlassian.bamboo:bamboo-specs-runner:6.0.2:run failed: A required class was missing while executing com.atlassian.bamboo:bamboo-specs-runner:6.0.2:run: tutorial\PlanSpec (wrong name: tutorial/PlanSpec)

I tried mvn versions 3.2 and 3.5

can you share your repo if it doesn't have any secrets on Bitbucket/Github? Looks like some issue in folders layout

There are no secrets :) Its just "get started" tutorial. I reproduced the error on another PC with the same result

mvn archetype:generate -B ^
-DarchetypeGroupId=com.atlassian.bamboo -DarchetypeArtifactId=bamboo-specs-archetype ^
-DarchetypeVersion=6.0.2 ^
-DgroupId=com.atlassian.bamboo -DartifactId=bamboo-specs-tutorial -Dversion=1.0.0-SNAPSHOT ^
-Dpackage=tutorial -Dtemplate=minimal
cd bamboo-specs-tutorial
mvn -Ppublish-specs -X
[INFO] Scanning C:\java\proj\bamboo-specs-tutorial\target\classes for classes annotated with Bamboo plan annotation.
[DEBUG] Adding C:\java\proj\bamboo-specs-tutorial\target\classes\tutorial\PlanSpec.class to scan candidates
[DEBUG] Scanning tutorial\PlanSpec for BambooSpec annotation.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.437 s
[INFO] Finished at: 2017-07-21T21:35:56+03:00
[INFO] Final Memory: 19M/272M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.atlassian.bamboo:bamboo-specs-runner:6.0.2:run (default-cli) on project bamboo-specs-tutorial: Execution default-cli of goal com.atlassian.bamboo:bamboo-specs-runner:6.0.2:run failed: A required class was missing while executing com.atlassian.bamboo:bamboo-specs-runner:6.0.2:run: tutorial\PlanSpec (wrong name: tutorial/PlanSpec)
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>com.atlassian.bamboo:bamboo-specs-runner:6.0.2
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy

Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-03T22:39:06+03:00)
Maven home: c:\java\maven\bin\..
Java version: 1.8.0_141, vendor: Oracle Corporation
Java home: c:\java\jdk1.8\jre
Default locale: en_US, platform encoding: Cp1251
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

 

When I run it from bash all is ok. The difference in trace from bash here:

[DEBUG] Scanning tutorial.PlanSpec for BambooSpec annotation.

tutorial.PlanSpec - linux 

tutorial\PlanSpec - win

Can this be a problem?

 

Until this is fixed, you will need to store your spec file in the default package.

0 votes

@Pavel Smolkin, confirmed this issue and created bug https://jira.atlassian.com/browse/BAM-18584

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Monday in Jira Ops

Jira Ops Early Access Program Update #1: Announcing our next feature and a new integration

Thanks for signing up for Jira Ops! I’m Matt Ryall, leader for the Jira Ops product team at Atlassian. Since this is a brand new product, we’ll be delivering improvements quickly and sharing updates...

455 views 0 9
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you