Atlassian Bamboo stops the build that is currently in progress / in progress

I am trying to stop the bamboo assemblies (which are currently running) if they convey a specific use case.

I have a list of assemblies that I need to stop. Now I want to send a REST request to stop the assembly, very similar to the "Stop assembly" button, which is located in the upper right corner of the assembly (see. Image). enter image description here

In the REST API documentation, I saw only this, which stops the assembly only if it is queued.

https://docs.atlassian.com/bamboo/REST/3.3-SNAPSHOT/

/queue/{projectKey}-{buildKey}-{buildNumber} 

Stop the assembly, but only if the assembly is not already running - so if it is waiting in the assembly queue. If the assembly no longer exists in the queue, the method has no effect.

I need a way to stop RUNNING builds. Any help would be greatly appreciated.

+7
rest atlassian bamboo
source share
1 answer

I managed to figure out the names of the bamboo compilations that I needed to stop through my own automation server. Then I was able to achieve this by pressing the stopPlan button directly. Here is the ruby ​​method I wrote:

 # Get request to stop a build located at the given url def stop_bamboo_build_request(build_key) logger.debug "Build Key: #{build_key}" uri = URI("#{Rails.configuration.bamboo_base_url}/build/admin/stopPlan.action?planKey=#{build_key}") # Create client http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_PEER # Create Request req = Net::HTTP::Get.new(uri) # Add Auth req.basic_auth(Rails.configuration.bamboo_username, Rails.configuration.bamboo_password) # Add headers req.add_field "X-Atlassian-Token", "no-check" # Fetch Request res = http.request(req) logger.debug "Response HTTP Status Code: #{res.code}" logger.debug "Response HTTP Response Body: #{res.body}" rescue StandardError => e logger.debug "HTTP Request failed (#{e.message})" end 
+1
source share

All Articles