Hi!
I followed the tutorial at:
https://confluence.atlassian.com/bitbucket/deploy-build-artifacts-to-bitbucket-downloads-872124574.html
However the file upload via curl is not working in my case, altough curl states so otherwise:
curl -X POST "https://${BB_AUTH_STRING}@api.bitbucket.org/2.0/repositories/${BITBUCKET_REPO_OWNER}/${BITBUCKET_REPO_SLUG}/downloads" --form files=@file.pdf % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0100 1680k 0 0 100 1680k 0 6426k --:--:-- --:--:-- --:--:-- 6413k100 1680k 0 0 100 1680k 0 4926k --:--:-- --:--:-- --:--:-- 4927k
Afterwards the downloads section is still empty...
Has anybody an idea what might be the case here?
Hey @Guy_Incognito,
I suspect that your repository is not public and thus you need to pass in credentials with your request.
To test this, add '-v' at the end of your curl command, which enables verbose logging:
curl -X POST "https://${BB_AUTH_STRING}@api.bitbucket.org/2.0/repositories/${BITBUCKET_REPO_OWNER}/${BITBUCKET_REPO_SLUG}/downloads""file.pdf" -v
If this responds with a 401 HTTP response code, create an Application Password, which you configure as a secured variable in Pipelines. Then add `-u <your-user>:<your-password>`.
Thanks @Jeroen De Raedt
Altough the ${BB_AUTH_STRING} did containt the "username:password" combination, the problem was indeed a 401 issue.
I switched to using the ' -u "${USERNAME}:${PASSWORD}" ' option and everything works like a charm..
Thanks a lot!
worked for me too... thanks!
Could anyone please post a complete curl command? Where to add
-u "${USERNAME}:${PASSWORD}"
It looks like you're new here. Sign in or register to get started.