Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Best practice to sync only specific files from repositories

Alexander Maier
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 26, 2022

Hello,

I have access to 10 different repositories from our Dev team. From each of the repository I need only one specific file. Each specific file from the repositories will be used by team members or tools who are not allowed to have access to those 10 repositories.

Therefore I'm planning to create another repository which contains each specific file from the 10 repositories. This way it's easier to provide access to these files to team members and tools.

My problem is that these files have to be always up-to-date. If one of the files was updated in one of the 10 repositories it also needs to be automatically updated in my repository.

I wanted to ask what the best practice is to make this process work?

I'm grateful for any advice. Thank you!

 

Best,
Alexander

1 answer

1 vote
Erez Maadani
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 29, 2022

That depends on the required access level (read/write/delete), your technology stack and use cases (for example, what happens if one of the files is updated while a user reads it).

For the most simple case, if the systems/users just need read access and you don't care about updates during read, you can use either:

1. Third parties like BitBucket pipelines or ArgoCD, to listen to changes and update the dedicated repo.

2. Have a small service which only returns the specific files directly from BitBucket. See here for a simple CURL example: https://community.atlassian.com/t5/Bitbucket-questions/How-to-download-a-file-from-bitbucket-downloads-during-pipelines/qaq-p/1859283.

3*. This one is more cumbersome but it eliminates the file duplication so I'm putting it here -  use submodule or sub-tree. See here:https://community.atlassian.com/t5/Bitbucket-questions/How-to-add-a-subrepository/qaq-p/778446  

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events