Skip to content

Instantly share code, notes, and snippets.

@peterromfeldhk
Created November 16, 2017 07:43
Show Gist options
  • Save peterromfeldhk/8e0f6c851c142c0e20904a08de0fcacf to your computer and use it in GitHub Desktop.
Save peterromfeldhk/8e0f6c851c142c0e20904a08de0fcacf to your computer and use it in GitHub Desktop.
gitlab-ci-android
#
# GitLab CI: Android
#
FROM ubuntu:17.04
ENV VERSION_SDK_TOOLS 3859397
ENV ANDROID_HOME /sdk
ENV PATH $PATH:$ANDROID_HOME/tools
RUN apt-get -qq update && \
apt-get install -qqy --no-install-recommends \
curl \
git \
openjdk-8-jdk \
unzip \
bash \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN curl -s https://dl.google.com/android/repository/sdk-tools-linux-${VERSION_SDK_TOOLS}.zip > /sdk.zip && \
unzip /sdk.zip -d /sdk && \
rm -v /sdk.zip
RUN mkdir -p /root/.android && \
touch /root/.android/repositories.cfg && \
${ANDROID_HOME}/tools/bin/sdkmanager --update
RUN echo y | ${ANDROID_HOME}/tools/bin/sdkmanager "add-ons;addon-google_apis-google-24" && \
echo y | ${ANDROID_HOME}/tools/bin/sdkmanager "build-tools;26.0.2" && \
echo y | ${ANDROID_HOME}/tools/bin/sdkmanager "extras;android;m2repository" && \
echo y | ${ANDROID_HOME}/tools/bin/sdkmanager "extras;google;m2repository" && \
echo y | ${ANDROID_HOME}/tools/bin/sdkmanager "extras;google;google_play_services" && \
echo y | ${ANDROID_HOME}/tools/bin/sdkmanager "extras;m2repository;com;android;support;constraint;constraint-layout;1.0.2" && \
echo y | ${ANDROID_HOME}/tools/bin/sdkmanager "extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.2" && \
echo y | ${ANDROID_HOME}/tools/bin/sdkmanager "platform-tools" && \
echo y | ${ANDROID_HOME}/tools/bin/sdkmanager "platforms;android-27" && \
echo y | ${ANDROID_HOME}/tools/bin/sdkmanager "ndk-bundle"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment