0

Hello I want to use the API approach to show the jenkins build status with curl as stated here: https://developer.atlassian.com/server/bitbucket/how-tos/updating-build-status-for-commits/

Assembled that:

curl -u username:'password' -H "Content-Type: application/json" -X POST https://tools.my.repo.com/bitbucket/rest/build-status/1.0/commits/620d293ed88412e45c58aae537b8765be2e8d148 -d @build0.json`

Where my build json contains:

{
        "state": "SUCCESSFUL",
        "key": "8",
        "name": "feature/branch",
        "url": "https://my.jenkins.placeholder/job/Plugintest/",
        "description": "Changes by Umbert Eco"
}

I need to have that in one line...Is it possible?

WhoAmI
  • 1,013
  • 2
  • 9
  • 19

1 Answers1

0

Yes!! Try framing the curl in this way

curl -u username:password -H "Content-Type: application/json" -X POST https://tools.my.repo.com/bitbucket/rest/build-status/1.0/commits/620d293ed88412e45c58aae537b8765be2e8d148 -d '{\"state\": \"SUCCESSFUL\",\"key\": \"8\",\"name\": \"feature/branch\",\"url\": \"https://my.jenkins.placeholder/job/Plugintest\",\"description\": \"Changes by Umbert Eco\"}'
AkshayBadri
  • 504
  • 1
  • 10
  • 18