Last active
June 30, 2016 10:30
-
-
Save renaudmathieu/1f69b5410ffa550d2a4f12a0848deb38 to your computer and use it in GitHub Desktop.
Continuous Integration Platform for Android with Jenkins using Docker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################################################### | |
# Continuous Integration Platform for Android with Jenkins using Docker | |
# You can provide your plugin list in a plugin.txt file | |
############################################################################### | |
FROM jenkins | |
MAINTAINER Renaud MATHIEU | |
ENV API_LEVEL 23 | |
ENV SDK_TOOLS 24.4.1 | |
ENV BUILD_TOOLS 23.0.3 | |
# ----------------------------------------------------------------------------- | |
# Setup | |
# ----------------------------------------------------------------------------- | |
COPY plugins.txt /usr/share/jenkins/plugins.txt | |
RUN /usr/local/bin/plugins.sh /usr/share/jenkins/plugins.txt | |
USER root | |
ENV DEBIAN_FRONTEND noninteractive | |
# Install basic packages | |
RUN apt-get update && \ | |
apt-get install -y git curl openssh-client | |
# Restore jenkins configuration | |
RUN mkdir /usr/share/jenkins/backups | |
COPY backups/FULL-2016-05-11_18-06/ /usr/share/jenkins/backups/FULL-2016-05-11_18-06 | |
# ----------------------------------------------------------------------------- | |
# Install Java 7 | |
# ----------------------------------------------------------------------------- | |
RUN echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && \ | |
echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main" | tee /etc/apt/sources.list.d/webupd8team-java.list && \ | |
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main" | tee -a /etc/apt/sources.list.d/webupd8team-java.list && \ | |
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886 && \ | |
apt-get update && \ | |
apt-get install oracle-java7-installer -y && \ | |
apt-get install oracle-java7-set-default -y | |
ENV JAVA_HOME /usr/bin/java | |
ENV PATH $JAVA_HOME:$PATH | |
## ----------------------------------------------------------------------------- | |
## Android SDK | |
## ----------------------------------------------------------------------------- | |
RUN wget --progress=dot:giga http://dl.google.com/android/android-sdk_r$SDK_TOOLS-linux.tgz && \ | |
mv android-sdk_r$SDK_TOOLS-linux.tgz /opt/ && \ | |
cd /opt && tar xzvf ./android-sdk_r$SDK_TOOLS-linux.tgz && \ | |
rm -f ./android-sdk_r$SDK_TOOLS-linux.tgz | |
ENV ANDROID_HOME /opt/android-sdk-linux/ | |
ENV PATH $ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$PATH | |
RUN echo "y" | android update sdk --no-ui --force --filter build-tools-$BUILD_TOOLS,android-$API_LEVEL,tools,platform-tools,extra-android-m2repository,extra-google-m2repository,extra-android-support,extra-google-google_play_services && \ | |
chmod -R 755 $ANDROID_HOME |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment