Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Build of Android Studio Project and Post the apk to Slack from Magnum CI

Build of Android Studio Project and Post the apk to Slack from Magnum CI

  • Build the Android Studio Project (Gradle Project) which exist on your Git repository.
  • Upload the generated apk file to Slack.

Basic Setup

  • Repository URL:
  • Provider: Github
  • Source control: Git
  • Project type: Generic

Build Configuration

Environment variables

You need to describe the settings for build the project as follows.


Hint: You need to specify the required packages of your app to the ANDROID_PACKAGES variable. You can get the package names using android list sdk --all --extended command.

Build Steps - Dependencies installation:

sudo apt-get install -y openjdk-7-jdk python-software-properties
sudo add-apt-repository -y ppa:cwchien/gradle
sudo apt-get update -y
sudo apt-get install -y gradle-2.10 curl lib32stdc++6 lib32z1
tar zxf android-sdk_r24.4.1-linux.tgz -C ~/
export ANDROID_HOME=~/android-sdk-linux/
( sleep 5 && while [ 1 ]; do sleep 1; echo y; done ) |  ~/android-sdk-linux/tools/android update sdk --no-ui --all --filter "${ANDROID_PACKAGES}"
gradle -v
chmod +x gradlew

Build Steps - Test suite commands:

If you want to do testing, please describe it.

Build Steps - After test suite execution:

./gradlew assembleDebug
export apk_name="build-`git rev-parse --short HEAD`.apk"
curl -F token="${SLACK_TOKEN}" -F channels="${SLACK_CHANNEL}" -F title="${apk_name}" -F filename="${apk_name}" -F file=@app/build/outputs/apk/app-debug.apk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.