I want to deploy a builded jar form simple pipeline to dowload page.
I already saw this post : https://bitbucket.org/site/master/issues/13919/deploy-build-artifacts-to-bitbucket but can't find the solution ...
The repository is from the team name 'cgi-smartcase-test' (id 'cgismartcasetest') and is the owner of the repository
Here some log :
echo "${BITBUCKET_REPO_OWNER}"
+ echo "${BITBUCKET_REPO_OWNER}"
cgismartcasetest
echo "${BITBUCKET_REPO_SLUG}"
+ echo "${BITBUCKET_REPO_SLUG}"
springboot-restservices-sandboxHere the log for the curl command :
+ curl -v -X POST --user "${BB_AUTH_STRING}" "https://api.bitbucket.org/2.0/repositories/${BITBUCKET_REPO_OWNER}/${BITBUCKET_REPO_SLUG}/downloads" --form files=@"target/springboot-restservices-sandbox-0.1.0.jar"
* Hostname was NOT found in DNS cache
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Trying 104.192.143.4...
* Connected to api.bitbucket.org (104.192.143.4) port 443 (#0)
* successfully set certificate verify locations:
* CAfile: none
CApath: /etc/ssl/certs
* SSLv3, TLS handshake, Client hello (1):
} [data not shown]
* SSLv3, TLS handshake, Server hello (2):
{ [data not shown]
* SSLv3, TLS handshake, CERT (11):
{ [data not shown]
* SSLv3, TLS handshake, Server key exchange (12):
{ [data not shown]
* SSLv3, TLS handshake, Server finished (14):
{ [data not shown]
* SSLv3, TLS handshake, Client key exchange (16):
} [data not shown]
* SSLv3, TLS change cipher, Client hello (1):
} [data not shown]
* SSLv3, TLS handshake, Finished (20):
} [data not shown]
* SSLv3, TLS change cipher, Client hello (1):
{ [data not shown]
* SSLv3, TLS handshake, Finished (20):
{ [data not shown]
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
* Server certificate:
* subject: C=US; ST=CA; L=San Francisco; O=Atlassian, Inc.; OU=Bitbucket; CN=*.bitbucket.org
* start date: 2017-04-04 00:00:00 GMT
* expire date: 2020-06-11 12:00:00 GMT
* subjectAltName: api.bitbucket.org matched
* issuer: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=DigiCert SHA2 High Assurance Server CA
* SSL certificate verify ok.
* Server auth using Basic with user 'cgismartcasetest'
> POST /2.0/repositories/cgismartcasetest/springboot-restservices-sandbox/downloads HTTP/1.1
> Authorization: Basic Y2dpc21hcnRjYXNldGVzdDo1YUw5YVVNeUVVRkJHNXU1anZtZg==
> User-Agent: curl/7.38.0
> Host: api.bitbucket.org
> Accept: */*
> Content-Length: 31315798
> Expect: 100-continue
> Content-Type: multipart/form-data; boundary=------------------------f9b74c02efad42a6
>
< HTTP/1.1 100 Continue
} [data not shown]
< HTTP/1.1 401 Unauthorized
* Server nginx is not blacklisted
< Server: nginx
* Authentication problem. Ignoring this.
< WWW-Authenticate: Basic realm="Bitbucket.org HTTP"
< Content-Type: text/html; charset=utf-8
< Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
< Date: Thu, 18 May 2017 08:55:36 GMT
< X-Served-By: app-161
< X-Static-Version: 51240b5303d2
< ETag: "d41d8cd98f00b204e9800998ecf8427e"
< X-Render-Time: 0.0207269191742
< Connection: keep-alive
< X-Version: 51240b5303d2
< X-Request-Count: 54
< X-Frame-Options: SAMEORIGIN
< Content-Length: 0
* HTTP error before end of send, stop sending
<
100 29.8M 0 0 100 29.8M 0 54.7M --:--:-- --:--:-- --:--:-- 54.8M
* Closing connection 0
* SSLv3, TLS alert, Client hello (1):
} [data not shown]
Thanks you
Guillaume GALLOIS
Hi Guillame,
In your curl command, can you try prepend your username (not team) to the user? Like this:
--user "<your_bitbucket_username>${BB_AUTH_STRING}"
Hi,
Do you mean change the content of the BB_AUTH_STRING variable ?
I've made the test with :
Still get the same error :-(
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Juste made a test with the environement variable "BB_AUTH_STRING" at the repository level : same issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Whoops, I forgot the colon!
So the whole curl command should look something like this:
curl -v -X POST --user "<your_bb_username>:${BB_AUTH_STRING}" "https://api.bitbucket.org/2.0/repositories/${BITBUCKET_REPO_OWNER}/${BITBUCKET_REPO_SLUG}/downloads" --form files=@"target/springboot-restservices-sandbox-0.1.0.jar"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So,
It work with :
echo "${BITBUCKET_REPO_OWNER}"
cgismartcasetest
echo "${BITBUCKET_REPO_SLUG}"
springboot-restservices-sandbox
curl -i -X POST --user "galloisg:${BB_AUTH_STRING}" "https://api.bitbucket.org/2.0/repositories/${BITBUCKET_REPO_OWNER}/${BITBUCKET_REPO_SLUG}/downloads" --form files=@"target/springboot-restservices-sandbox-0.1.0.jar" --verbose
But still KO with :
echo "${BITBUCKET_REPO_OWNER}"
cgismartcasetest
echo "${BITBUCKET_REPO_SLUG}"
springboot-restservices-sandbox
curl -i -X POST --user "cgismartcasetest:5aL9aUMyEUFBG5u5jvmf" "https://api.bitbucket.org/2.0/repositories/cgismartcasetest/springboot-restservices-sandbox/downloads" --form files=@"target/springboot-restservices-sandbox-0.1.0.jar" --verboseEven if cgismartcasetest is the owner of the repository, i need to add tu user id instead of.
Thanks you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.