Feature/release 4.1 docker gitlab ci

This commit is contained in:
Sylvain Berfini 2019-01-25 11:44:00 +01:00
parent b3de09c2d8
commit 680111e5dc
6 changed files with 39 additions and 5 deletions

View file

@ -2,14 +2,27 @@ job-android:
stage: build stage: build
tags: [ "docker-android" ] tags: [ "docker-android" ]
image: gitlab.linphone.org:4567/bc/public/linphone-android/bc-dev-android:28
before_script:
- if ! [ -z ${SCP_PRIVATE_KEY+x} ]; then eval $(ssh-agent -s); fi
- if ! [ -z ${SCP_PRIVATE_KEY+x} ]; then echo "$SCP_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null; fi
script: script:
- sdkmanager - sdkmanager
- ./gradlew app:assembleDebug - scp -oStrictHostKeyChecking=no $DEPLOY_SERVER:$ANDROID_KEYSTORE_PATH app/
- scp -oStrictHostKeyChecking=no $DEPLOY_SERVER:$ANDROID_GOOGLE_SERVICES_PATH app/
- echo storePassword=$ANDROID_KEYSTORE_PASSWORD > keystore.properties
- echo keyPassword=$ANDROID_KEYSTORE_KEY_PASSWORD >> keystore.properties
- echo keyAlias=$ANDROID_KEYSTORE_KEY_ALIAS >> keystore.properties
- echo storeFile=$ANDROID_KEYSTORE_FILE >> keystore.properties
- ./gradlew assembleDebug
- ./gradlew assembleRelease
artifacts: artifacts:
paths: paths:
- ./app/build/outputs/apk/debug/linphone-android-debug-*.apk - ./app/build/outputs/apk/debug/linphone-android-debug-*.apk
- ./app/build/outputs/apk/release/linphone-android-release-*.apk
when: always when: always
expire_in: 1 week expire_in: 1 week

View file

@ -0,0 +1,12 @@
job-android-upload:
stage: deploy
tags: [ "deploy" ]
only:
- schedules
dependencies:
- job-android
script:
- cd app/build/outputs/apk/ && rsync ./debug/*.apk $DEPLOY_SERVER:$ANDROID_DEPLOY_DIRECTORY

View file

@ -11,6 +11,7 @@
include: include:
- '.gitlab-ci-files/job-android.yml' - '.gitlab-ci-files/job-android.yml'
- '.gitlab-ci-files/job-upload.yml'
stages: stages:

View file

@ -1,4 +1,4 @@
[![pipeline status](https://gitlab.linphone.org/BC/public/linphone-android/badges/master/pipeline.svg)](https://gitlab.linphone.org/BC/public/linphone-android/commits/master) [![pipeline status](https://gitlab.linphone.org/BC/public/linphone-android/badges/master/pipeline.svg)](https://gitlab.linphone.org/BC/public/linphone-android/commits/feature/release-4.1)
Linphone is a free VoIP and video softphone based on the SIP protocol. Linphone is a free VoIP and video softphone based on the SIP protocol.

View file

@ -11,7 +11,7 @@ buildscript {
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:3.3.0' classpath 'com.android.tools.build:gradle:3.3.0'
classpath 'com.google.gms:google-services:3.2.0' classpath 'com.google.gms:google-services:4.2.0'
classpath "com.diffplug.spotless:spotless-plugin-gradle:3.16.0" classpath "com.diffplug.spotless:spotless-plugin-gradle:3.16.0"
// NOTE: Do not place your application dependencies here; they belong // NOTE: Do not place your application dependencies here; they belong

View file

@ -19,7 +19,7 @@ ENV ANDROID_HOME /opt/android-sdk-linux
# Install common general tools # Install common general tools
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y curl nano sudo unzip vim wget openjdk-8-jdk-headless && \ apt-get install -y curl nano sudo unzip vim wget openjdk-8-jdk-headless rsync ssh && \
apt-get clean apt-get clean
# Get the Android tools # Get the Android tools
@ -29,7 +29,15 @@ RUN wget https://dl.google.com/android/repository/tools_r$ANDROID_SDK-linux.zip
ENV PATH $ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$ANDROID_HOME/platform-tools:$PATH ENV PATH $ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$ANDROID_HOME/platform-tools:$PATH
# Get the Android SDK # 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" RUN echo "y" | sdkmanager "platforms;android-28" "build-tools;28.0.3" "extras;android;m2repository" "extras;google;m2repository" "platform-tools" "tools"
# Accept Android SDK licenses
RUN yes | sdkmanager --licenses
# Update if needed
RUN echo y | android update sdk --no-ui --all --filter platform-tools
RUN echo y | android update sdk --no-ui --all --filter android-28
RUN echo y | android update sdk --no-ui --all --filter build-tools-28.0.3
# Configure user bc # Configure user bc
RUN useradd -ms /bin/bash bc && \ RUN useradd -ms /bin/bash bc && \