Skip to content

Android App Deployment (EN)

Thanh-Son-Philippe Lam edited this page Apr 19, 2019 · 33 revisions

What do I have to do to publish a new version of ÉTSMobile bêta?

Not much. Currently, the deployment of the beta version is done automatically by Travis-CI and Gradle Play Publisher. The release process starts when a commit is made on master. Even though the process is automated, human intervention is still and only needed to update the release notes published on the Play Store. The app's release notes are stored here. Before committing on master, the release notes and should be changed. If not, the previous release notes will be used.

Steps done by Gradle Play Publisher and Travis-CI

Here are the steps done by Gradle Play Publisher and Travis-CI to release the beta version:

Step 0: Commit on master

The process starts when a commit is made to master.

Step 1: Start a build

A build is normally run by Travis according the travis.yml file. If the build succeeded, Travis will also execute the deploy block which simply execute the deploy_beta.sh script.

Step 2: Decrypt secret files

Since the source code is open-source, some files have been encrypted because they need to be kept secret. During a build, Travis will decrypt them and place them where to need to be.

Step 3: Publish on the Play Store

The deploy_beta.sh script will run the publishBetaReleaseApk Gradle command which will deploy the beta version of the app on the Play Store. After a moment, the update should be available to the users.

If your are not familiar with Travis, you should take a look at their doc here.

The travis.yml configuration file is located here. Since the repo also contains the iOS app, a matrix has been specified to run a job for Android and another job for iOS.

Moreoever, during the process, Travis will decrypt secret files. The passwords are stored as encrypted environment variables.

App Signing

Before an app can be released to the Play Store, it needs to be signed. For more information, take a look at the official doc here. This project make use of App Signing by Google Play which let Google manages our signing key for us. We simply need to sign our app with an upload key. This key is stored in a keystore called etsm_upload_ks.jks. The encrypted version is stored here.

Furthermore, the signing information have been removed from the build files since they are sensitive information. Take a look here to know how it has been done. To summarize briefly, the signing configuration in the app module build.gradle refers to properties stored in file called keystore.properties. The encrypted version of this file is located here.

Gradle Play Publisher is a Gradle plugin that let you upload your app and other details to the Play Store. Please start by reading through their doc here.

In this project, the configuration for Gradle Play Publisher is done in the app module's build.gradle file.

At the moment, Gradle Play Publisher has only set been for the beta flavor.

How do I deploy manually?

You shouln't have to deploy manually, but if needed, here are to steps for deploying the app without relying on Travis CI or Gradle Play Publisher :

  1. In order to start, you need to access to the encrypted files's passwords. They are kept by App|ETS because only members should be able to access them. Furthermore, you also need to have access to the university's Play Store account.
  2. Decrypt the files and move them to the right directory. Check the travis.yml file and the script to know how it is done. You should be aware that if you enter the passwords on the command line, someone could look at your terminal window history or list of running processes, get the password, and then have access to password that you have typed.
  3. Bump the versionCode. It should be higher than the versionCode of the last APK uploaded otherwise the new APK will be refused.
  4. Next, you need to tell Android Studio to generate a signed APK. Follow the official instructions here.
  5. Publish the APK on the Play Store. Follow the instructions here to know how.

Production version

At the moment, nothing have been configured to automate the deployment process of the production version.

How it was done for the second version of ÉTSMobile

First of all, the things described above which was done manually. For example, API keys was set manually and files such as google-services.json was added manually.

The process is now much faster and less error-prone.