The project was developed during HackTBILISI Fall 2015 festival. Tristan the Deployer helps you build the Android app distribution pipeline. You can find demo video here.
To set up project for your own Android project follow these steps:
- Link your GitHub repo to Travis
- Setup .travis.yml to upload artifacts to Amazon S3
- Connect S3 and AWS Lambda
- Create Slack organisation and get custom hook url
- Write script for lambda to post to Slack
runs gradle task and sets BUCKET
and DIR
variables.
For example, if GitHub repo is gkiko/Popcorn
then BUCKET=gkiko
and DIR=Popcorn
.
These variables will be handy when storing data in S3.
Notice on bucket naming
Bucket names can contain lowercase letters, numbers, and hyphens. Each label must start and end with a lowercase letter or a number
My S3 console says that bucket names can contain only lowercase characters. More info here
./gradlew assemble
command saves build output in app/
directory:
app/build/outputs/apk/app-debug-unaligned.apk
app/build/outputs/apk/app-debug.apk // <---
app/build/outputs/apk/app-release-unaligned.apk
app/build/outputs/apk/app-release-unsigned.apk
The file we are interested in is app-debug.apk
. Script in before_deploy
moves the .apk
in new directory and deletes other files.
app-debug.apk
is renamed with git commit hash and placed under the direcotry maching GitHub project name.
app/build/outputs/apk/Popcorn/f75cb468aa1dd50d981691b42edf6c562ec3abfe.apk
Uploads build artifact to S3. The file is stored in $BUCKET/$DIR
gkiko/Popcorn/f75cb468aa1dd50d981691b42edf6c562ec3abfe.apk
This file is deployed on AWS Lambda.
Download link for the .apk file is the most essential part. We generate S3 public link in concatUrl
function. Yes I know, this is ugly and unreliable. We will find better solution asap!
You should have already done step 4. Sends json data to Slack API. text field in the json is formatted with Slack markdown to include hyperlinks.