Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Pipelines with filled Database for Android APK

Relaxo January 27, 2019

Hello,

I ship a pre-filled Database with my APK. The DB is located in the Assets directory of the Project.

To use Bitbucket Pipelines to build the APK and upload it to the downloads section, i need to add the DB to the Assets directory (on the build server) before. What is the best way to solve this?

Is Git LFS a solution? The DB is about 90MB.

Or download the DB file from somewhere else? E.g. the download section?

1 answer

1 accepted

1 vote
Answer accepted
Philip Hodder
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 3, 2019

Hi Relaxo,

If it's in the Assets directory of your project, does that mean it has already been pushed to Bitbucket? If so, the it should already be accessible inside of your Pipelines build container. As we clone the entire repository. If you are already using Git LFS then it will automatically be downloaded to the Pipelines build container.

What's the format of the DB files?

Git LFS is typically used for binary files that don't create small diffs. Depending on the format of the DB file you may or may not need it. Git LFS is a solution for pushing it to your repository if it's an appropriate format. Perhaps regular Git of the downloads section could be as well. Again, it all depends on the format of the file.

Thanks,

Phil

Relaxo February 5, 2019

Hello Philip,

thanks for your reply.

No, the Assets directory is ignored, caused to big files.

No i'm not currently using Git LFS.

The database is a *.db file. A Data Base File for SQLite3.

 

The file does not change normally, but it does sometimes.

 

If I download it from the downloads section, will it take much build time? I don't know the download speed when something is downloaded from Bitbucket to a container on your server. 

 

Kind regards

Relaxo

Philip Hodder
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 5, 2019

Right. In that case I'd recommend you use Git LFS. Git LFS is used for binary files, which the SQLite Database file is (from my quick Googling).

You can get started by looking at our documentation on Git LFS here: https://confluence.atlassian.com/bitbucket/git-large-file-storage-in-bitbucket-829078514.html

The downloads section is still an option. But Pipelines has no built-in features that integrate well with it, so you'll need to use the Bitbucket REST API to retrieve the files. However, Git LFS is automatically supported in Pipelines.

Relaxo February 12, 2019

Thanks for your recommendation.

But I will try it first with a download from Downloads section.

 

It works well with this line:

curl --user "${BB_AUTH_STRING}" -L "https://api.bitbucket.org/2.0/repositories/${BITBUCKET_REPO_OWNER}/${BITBUCKET_REPO_SLUG}/downloads/filename.db" --output app/src/main/assets/filename.db

 

Like Philip Hodder likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events