Android-ci-docker is a Docker images meant to serve as good bases for Android mobile apps build via CircleCI.
Android-ci-docker is built on top of circleci images: Circle-Ci-Android.
- Fork/clone the project and setup a circle ci project.
- Add
DOCKER_USERNAME
andDOCKER_PASSWORD
of your Docker Hub in your Circle CI Environment Variables. - Push the repo to build the custom image
If you need to maintain different images for your project, i.e target for different Android APIs,
- Create a new folder
android-api-{version-number}
- Create a new Dockerfile inside your new folder. You can copy the Dockerfile from existing folders or from Circle-Ci-Android
- Make sure you edit the java version to
openjdk:8-jdk-slim
and build-tools version for your targeted SDK. - Edit your circle ci config to targetyour new folder.
...
- checkout
- setup_remote_docker
- run:
name: Setup custom environment variables
command: |
echo 'export ANDROID_REPO="$DOCKER_USERNAME/android-ci-api-{version-number}"' >> $BASH_ENV
- run:
name: Build Docker image
command: |
source $BASH_ENV
export TAG=`if [ "$CIRCLE_BRANCH" == "master" ]; then echo "latest"; else echo $CIRCLE_BRANCH ; fi`
docker build -t $ANDROID_REPO:$CIRCLE_BUILD_NUM -t $ANDROID_REPO:$TAG ./android-api-{version-number}
...
- Commit and push your changes. A new docker image will be created via Circle-Ci