0
votes

Im trying to deploy a plan that has artefacts from external service for this I want to download via curl those files that I will pass as variables... however I am not able to set programmaticly the variables with the deploymet call

curl -k -u user:passord -X POST -d "bamboo.myVariable=someurl" BASE_BAMBOO_URL/bamboo/rest/api/latest/queue/PROJECT-ID

Trying to do the same with the deployment API fails

curl BASE_BAMBOO_URL/bamboo/rest/api/latest/deploy/project/1321123123 -u user:passord-X POST -d "bamboo.myVariable=callMEwithDATA"

Trying to add that into the API fails as does trying to pass it thru JSON

curl -X POST BASE_BAMBOO/bamboo/rest/api/latest/deploy/project/1320058 -u user:passord -H "Accepts: application/json" -H "Content-Type: application/json" -d '{"name":"release-1", "myVariable":"ARTEFACT_URL"}'
1
You might be able to use: BASE_BAMBOO_URL/browse/<buildResultKey>/artifact/shared/<name_of_the_artifact>. Not the most beautiful solution though, but it works if you know the buildResultKey. You should be able to find it programmatically using the REST API. You can properly find some inspiration here: link - Jonas Pedersen
hum that is not what i was asking i want to set variables any kin of variable like i do for a build plan - Astronaut

1 Answers

0
votes

To continue with a request the variables have to be passed as query params... a sad sad reality is that the Bamboo API is very messed up

bamboourl&executeAllStages=true&bamboo.variable.MYVAR=1234