Pushing freestyle build artifacts to Bitbucket cloud instance

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Pushing freestyle build artifacts to Bitbucket cloud instance

Ioannis Moutsatsos-2

I need to push build artifacts to a cloud instance of Atlassian Bitbucket.
I've considered the Pubish-to-Bitbucket Jenkins plugin but it does not seem to handle proxies gracefully and fails to connect to the cloud server.

Alternatively, I am considering using a custom groovy build step and the Atlassian Bitbucket REST API  using http-builder-ng to accomplish what is needed.
For example to list my repositories I use:

import groovyx.net.http.JavaHttpBuilder
import java.net.Proxy
import static groovy.json.JsonOutput.toJson
import static groovyx.net.http.HttpBuilder.configure
import groovy.json.*
def http = JavaHttpBuilder.configure {
.proxy 'myproxy.net', 20XX, Proxy.Type.HTTP, false
.uri ='https://api.bitbucket.org/2.0/repositories/myusername'
.auth.basic 'myusername','mypass'
.contentType = 'application/json'

However, I'm having issues authenticating with this basic authorization strategy

I get the following null result

"{page=1, pagelen=10, size=0, values=[]}"

Any suggestions or alternate strategies?


You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/a8702174-522d-443d-bffb-12c9801c9d29%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.