Android deployment to Google Play store

Hi,

I am unable to deploy to the play store. I have followed the docs and used the example play store plugin https://github.com/Triple-T/gradle-play-publisher#usage for deployment.

It works when I run the task from the command line and see the apk uploaded to the alpha channel.
The build runs fine and it is a green build but the deployment task in not triggered.

Any ideas will be helpful.

Thanks

Is this a public project? If so can you paste the build URL?

Also keep in mind that if you are running the build via SSH (for debugging purposes) you will not be able to do the deployment phase. The Deployment phase is not run during SSH builds.

I am sorry, it is not a public project. I am not running the build via SSH. The deployment phase is not run at all. It runs up till the test phase. Then gets the artifacts and stops .

This is my circle.yml-

general:
    artifacts:
        - /home/ubuntu/app/build/outputs/apk/

machine:
    environment:
        ANDROID_HOME: /usr/local/android-sdk-linux

dependencies:
  pre:
    - echo y | android update sdk --no-ui --all --filter "tools,platform-tools,android-23"
    - echo y | android update sdk --no-ui --all --filter "build-tools-23.0.2"

test:
    override:
       - ./gradlew build -x test -PpreDexEnable=false -Pcom.android.build.threadPoolSize=1 -Dorg.gradle.parallel=false -Dorg.gradle.jvmargs="-Xms512m -Xmx512m"

deployment:
    alpha:
        branch: develop
        commands:
           - ./gradlew publishApkProductionRelease

Are you on this branch?

A subdirectory in that branch. Is that the problem?
If so. How do I specify the directory in deployment?

When you say branch:develop you are telling CircleCI to only run the deployments from that branch. So if you want to deploy from multiple branches you need to list them all.

Most people only deploy from a master branch (to production) and maybe a staging branch to staging, but you can certainly deploy from others.

In the circle.yml , we can specify the build directory using the key ‘build_dir’. Can I do something similar for the deployment phase as well?

Sorry for any confusion. This has nothing to do with the directories – this is regarding the name of the branch on GitHub.

Ok, this the right branch I am trying to deploy from, I am still trying to figure it out. Since it was not deploying I was thinking that it may be because the project is not the root directory.

No, that should not matter, as long as you are on the right branch (in this case develop) then ./gradlew publishApkProductionRelease should be running in the deployment phase. Does this run?

No, it does not run in deployment phase. I don’t get any error or indication that it has run or failed. It runs on my local machine and deploys the apk.

Can you give me the build URL

@levlaz . Sure. Would I be able to send you a private message or email?

You can just paste it here, since its not public nobody but CircleCI admins can see it.

Otherwise, feel free to PM me as well. :slight_smile:

Click on my username and select “Message”

There you go… https://circleci.com/gh/honest/beauty-android/77 :slightly_smiling:

So in that build the branch is called “develop” but the circle.yml says:

deployment:
    alpha:
        branch: beauty-android
        commands:
           - ./gradlew publishApkProductionRelease

Which translates to "only deploy when the branch is called “beauty-android”

@levlaz I changed the branch name and it works now. Thanks for your help.

2 Likes