It's not the same without you
Join the community to find out what other Atlassian users are discussing, debating and creating.
Hi.
I just have followed this tutorial: https://confluence.atlassian.com/bitbucket/deploy-build-artifacts-to-bitbucket-downloads-872124574.html.
but i'm getting this error:
+ curl -X POST --user "${BITBUCKET_REPO_OWNER}:${BB_AUTH_STRING}" "https://api.bitbucket.org/2.0/repositories/${BITBUCKET_REPO_OWNER}/${BITBUCKET_REPO_SLUG}/downloads" --form files=@"target/output.jar"
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0curl: (26) couldn't open file "target/output.jar"
Here is my .yml:
image: maven:3.3.3 pipelines: default: - step: script: - mvn -B clean install - curl -X POST --user "${BITBUCKET_REPO_OWNER}:${BB_AUTH_STRING}" "https://api.bitbucket.org/2.0/repositories/${BITBUCKET_REPO_OWNER}/${BITBUCKET_REPO_SLUG}/downloads" --form files=@"target/output.jar"
I have created an app password in my account level, with all permissions set. My Enriromental variable is configured with the generated key (like this: zBre6W************)
I figured out the solution. I'll post here if anyone has the same question:
Anything under "script:" it's just unix commands, this means that you can use unix commands to navigate and list the files generated by your build.
My pom.xml generated the jar file with the name "my-project-1.0-SNAPSHOT", but my .yml was looking for a file named "output.jar".
I simply searched in the generated folders to see where my file was, using this command:
ls -R # Will list all files in the directory and subfolders
After finding the right place, i just point the "files" property to the right file in my .yml:
image: maven:3.3.3 pipelines: default: - step: script: - mvn -B clean install
- ls -R # Use this to find your generated jar. Remove it after. - curl -i -X POST --user "${BITBUCKET_REPO_OWNER}:${BB_AUTH_STRING}" "https://api.bitbucket.org/2.0/repositories/${BITBUCKET_REPO_OWNER}/${BITBUCKET_REPO_SLUG}/downloads/" --form files=@"target/my-project-1.0-SNAPSHOT.jar"
We've just released an experimental wagon for maven which deploys directly do bitbucket downloads - https://bitbucket.org/codedoers/maven-bitbucket-download-wagon
it does the same as curl but treats the bitbucket downloads as a maven repository
This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.
Read moreBitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda ...
Connect with like-minded Atlassian users at free events near you!
Find a groupConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.
Start an AUGYou're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.