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

Android CI Build and Deploy

Edited

Hello guys, first time I ask a question here... I'm setting a pipeline for my android project where I would like to build and deploy ( so having a debug.apk ) my android app.

At this time I'm able to build the apk but can't find any way to deploy it, could someone help me?

Thank you!!

This is my code right now:

image: javiersantos/android-ci:latest 
pipelines:  
default:
    
- step:
        
script:
          
- export GRADLE_USER_HOME=`pwd`/.gradle
          
- chmod +x ./gradlew
          
- ./gradlew assembleDebug

2 answers

1 accepted

0 votes
Answer accepted
Josh Carolan Atlassian Team Feb 17, 2019

Hi Marco,

When you say deploy in this case, what do you mean exactly? Push the APK to the Play store? Push it to firebase to run instrumentation tests?

Hello, sorry for the misunderstanding. Actually at the moment I would like to send the APK to a slack channel, I already know the Slack API to do that, but right now I can't find the folder of the APK, I can only build that.

Like Josh Carolan likes this
Josh Carolan Atlassian Team Feb 17, 2019

the ./gradlew assembleDebug command will build the APK and put it in the build folder for your app. I think by default this build folder will be somewhere like 

{projectRoot}/app/build/outputs/apk/debug/app-debug.apk

If you run ./gradlew assembleDebug on your local machine, then check around that location you should see the apk. It will be in the same relative location when it is built using pipelines.

But when I build it successfully then go to the repository and go to the path you mentioned, can't find nothing. Do you have a template for android build and maybe a deploy to bitbucket download center? Thank you very much

@Josh Carolan No news? Thank you in advance!

Josh Carolan Atlassian Team Feb 24, 2019

The build wont actually commit the artefacts from the build to your repository that is why you can't see them in the repository (and you don't want to do this). What you want to do is add a command after the assemble command to the build script that will get the APK that you just built which will be around that location I posted above, and send that to slack using the API you have. 

If for example you added:

ls ./app/build/outputs/apk/debug

 as the last line of you script above, it should print out something like app-debug.apk

(the location may be slightly different so run ./gradlew assembleDebug on your local machine and have a look around there for the apk to get the exact location)

@MarcoCarnevali I'm facing the same issues, did you fixed?

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,784 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