I'm trying to create a build plan using Bamboo Java Specs using the stored specs feature storing the specs in my Bitbucket Server repo (our Bitbucket Server and Bamboo instances are linked correctly). I have got Bamboo picking up the specs file but it fails with this exception:
java.lang.IllegalArgumentException:
com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException: Clone url or ssh key pair is not valid
My plan looks something like this:
new Plan(project(), "name", "key")
...
.planRepositories(new BitbucketServerRepository()
.name(PROJECTNAME)
.oid(new BambooOid(BAMBOOOID))
.repositoryViewer(new BitbucketServerRepositoryViewer())
.server(new ApplicationLink()
.name("Bitbucket")
.id(BITBUCKETSERVERID))
.projectKey(PROJECTKEY)
.repositorySlug(REPOSLUG)
.sshPublicKey(PUBLICKEY)
.sshPrivateKey(PRIVATEKEY)
.sshCloneUrl(CLONEURL)
.branch("main")
.remoteAgentCacheEnabled(false)
.fetchWholeRepository(true)
.changeDetection(new VcsChangeDetection()))
I initially just tried using the public key and private key from an existing build we created in the UI, but it was always a long-shot and didn't work. From reading this page on the API - https://docs.atlassian.com/bamboo-specs/6.5.0/com/atlassian/bamboo/specs/builders/repository/bitbucket/server/BitbucketServerRepository.html - it seems like I need to specify these rather than letting Bamboo create its own.
So my question is, do I need to create a user in Bitbucket for Bamboo (using one of our Bitbucket licences) and then generate SSH keys on the Bamboo host as if it were a normal user and use these or am I missing something here?