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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Generate Signed APK using Bitbucket pipeline

Edited
Manish Kumar Atlassian Team Jan 27, 2021

Hi everyone,

 

I am trying to build release-signed apk using bitbucket pipeline. I am able to make release build but not sure how to sign it using BB pipeline. I have following queries here

1. Where to store .keystore file for signing

2. How to use it in bitbucket-pipeline.yaml file

 

1 answer

1 accepted

0 votes
Answer accepted
Manish Kumar Atlassian Team Feb 17, 2021

Hi everyone,

Just answering my own question

1. Encode keystore file into base 64 (can use terminal to do same)

               base64 > keystore_file

2. Create a secure repo variable and store the base64 value

3. Decode keystore file during build process

echo "$SIGNING_JKS_FILE" | base64 -d > keystore_file

Since this is secure variable it will not be printed anywhere

4. Now we can go ahead with our normal build process.

Hi @Manish Kumar do we not required to give any keystore passwords , keystore aliases etc. ?

Will it create a signed apk without it


1. Encode keystore file into base 64 (can use terminal to do same)

               base64 > keystore_file

What is the exact command ?
This just hangs 

Manish Kumar Atlassian Team Apr 15, 2021

Hi @Keshava11 

 

You need to create secure repo variable for all credentials like KEYS_STORE_ALIAS, KEY_STORE_PASSWORD etc. and utilise these environment variable during signing. Since it's secured repo variable it will not be disclosed.

Manish Kumar Atlassian Team Apr 15, 2021

Hi @Keshava11 

base64 works fine on Mac but you can utilise equivalent command on different OS. 

@Manish Kumar I am facing issue in generating base64 content from my keystore file 

I have tried using both git bash and command prompt to generate the content but it hangs . 

Also , is there a way to link these repository variables to build.gradle file where few variables can be used. 

Bitbucket pipeline is of now use without one able to generate these repository variables 

starting with the base64 encode content of keystore file which doesn't get generated.


I am on windows and also running ubuntu as guest on VirtualBox . In none of the OS, this base64 encoded content of keystore file getting generated.  



Anyways my problem resolved. 
Thanks

How have you solved your problem?

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

New improvements to user management in Bitbucket Cloud 👥

Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...

3,741 views 10 16
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you