diff --git a/.gitlab-ci-files/job-android.yml b/.gitlab-ci-files/job-android.yml new file mode 100644 index 000000000..3f91a3ea9 --- /dev/null +++ b/.gitlab-ci-files/job-android.yml @@ -0,0 +1,20 @@ +.job-android: + + stage: build + tags: [ "docker-android" ] + + script: + - sdkmanager + - ./gradlew app:assembleDebug + + artifacts: + paths: + - ./app/build/outputs/apk/debug/linphone-android-debug-*.apk + when: always + expire_in: 1 week + + +.scheduled-job-android: + extends: .job-android + only: + - schedules \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 000000000..ae36cb70b --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,18 @@ +################################################# +# Base configuration +################################################# + + + +################################################# +# Platforms to test +################################################# + + +include: + - '.gitlab-ci-files/job-android.yml' + + +stages: + - build + - deploy diff --git a/docker-files/bc-dev-android b/docker-files/bc-dev-android new file mode 100644 index 000000000..e2d572834 --- /dev/null +++ b/docker-files/bc-dev-android @@ -0,0 +1,42 @@ +FROM debian:stretch + +MAINTAINER Ghislain MARY + + +# Configure locale +RUN apt-get update && \ + apt-get install -y locales && \ + apt-get clean && \ + echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && \ + locale-gen +ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' + +ENV SHELL=/bin/bash + +# Define environment +ENV ANDROID_SDK 25.2.5 +ENV ANDROID_HOME /opt/android-sdk-linux + +# Install common general tools +RUN apt-get update && \ + apt-get install -y curl nano sudo unzip vim wget openjdk-8-jdk-headless && \ + apt-get clean + +# Get the Android tools +RUN wget https://dl.google.com/android/repository/tools_r$ANDROID_SDK-linux.zip && \ + unzip tools_r$ANDROID_SDK-linux.zip -d $ANDROID_HOME && \ + rm -f tools_r$ANDROID_SDK-linux.zip +ENV PATH $ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$ANDROID_HOME/platform-tools:$PATH + +# Get the Android SDK +RUN echo "y" | sdkmanager "platforms;android-28" "build-tools;28.0.0" "extras;android;m2repository" "extras;google;m2repository" "platform-tools" "tools" + +# Configure user bc +RUN useradd -ms /bin/bash bc && \ + echo 'bc:cotcot' | chpasswd && \ + echo 'bc ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers + +USER bc +WORKDIR /home/bc +ENV PS1='\[\e[34m\]\u@bc-dev-android>\[\e[0m\] ' +CMD bash