Missed Team ’24? Catch up on announcements here.

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

Android CI Build and Deploy

MarcoCarnevali February 13, 2019

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
Atlassian Team members are employees working across the company in a wide variety of roles.
February 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?

MarcoCarnevali February 17, 2019

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
Atlassian Team members are employees working across the company in a wide variety of roles.
February 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.

MarcoCarnevali February 17, 2019

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

MarcoCarnevali February 22, 2019

@Josh Carolan No news? Thank you in advance!

Josh Carolan
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 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)

0 votes
Renato Prosofsky December 3, 2020

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events