I am currently in the midst of breaking up a monolithic repo from Github to smaller modules in Bitbucket. The difficulty I am currently facing is having the CI pull the build artifacts of necessary modules from different repos. I was thinking of perhaps a repo just for holding the build artifacts of all other repos, that would create a centralized source to both download and upload all build artifacts. Is there a way this could be achieved? From what I read, there are only tutorials to uploading build artifacts to it's own repo.
Hi @Ryan ,
This can be done by uploading the artifact to Bitbucket's Repository "Download" page, and the other repos/builds can download it directly with curl/wget
You may checkout the following to upload the artifact to Repository's Download page:
Deploy build artifacts to Bitbucket Downloads - Atlassian Documentation
When download the artifact, you can use the following commands to download it:
curl "https://${BB_AUTH_STRING}@api.bitbucket.org/2.0/repositories/${BITBUCKET_REPO_OWNER}/${BITBUCKET_REPO_SLUG}/downloads/<YOUR_FILE_NAME>" --output "<YOUR_FILE_NAME>"
ℹ The value of the variable ${BB_AUTH_STRING} is your username and password (<username>:<password>)
Hope this helps.
Regards,
Ronald
Hey Ronald,
I've been testing my workflow the past week and I manage to make it work for a saved secured variable, which is tied to a person in the team.
The workflow I'm trying to implement is that on a successful merge with master, the Bitbucket Pipelines get triggered, build, and publishes the build artifact to another repo's Bitbucket Download. Now, I would very much like to have the person who triggered the merge to be identified as the person who uploaded the build artifact to the repo.
Would that be possible to accomplish?
I'm not sure if what I said was confusing, happy to clarify further.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Ryan
Based on my understanding you would like a build to be triggered whenever a PR is merge.
I'm afraid that Bitbucket Pipelines yet to have the feature available but we would suggest upvote the following feature request:
https://jira.atlassian.com/browse/BCLOUD-13867
A workaround that I can suggest is by create a bash script to do a merge check.
Sample bash script: https://bitbucket.org/r-comm/check-merge-commit/src/master/check-merge.sh
Build example:
You just need to replace the "echo" in line 7 command with the commands that you want to run to upload the artifact. :)
Hope this helps.
Cheers,
Ronald C.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey Ronald,
In the interim, would it be possible to use the credentials of the person who pushed(dosent have to be a merge) to upload the artifact?
FYI, I cant open any of the links you provided.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.