Skip to content

Commit

Permalink
Feature/release 4.1 docker gitlab ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Viish committed Jan 25, 2019
1 parent b3de09c commit 680111e
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 5 deletions.
15 changes: 14 additions & 1 deletion .gitlab-ci-files/job-android.yml
Expand Up @@ -2,14 +2,27 @@ job-android:

stage: build
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:
- 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:
paths:
- ./app/build/outputs/apk/debug/linphone-android-debug-*.apk
- ./app/build/outputs/apk/release/linphone-android-release-*.apk
when: always
expire_in: 1 week

Expand Down
12 changes: 12 additions & 0 deletions .gitlab-ci-files/job-upload.yml
@@ -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
1 change: 1 addition & 0 deletions .gitlab-ci.yml
Expand Up @@ -11,6 +11,7 @@

include:
- '.gitlab-ci-files/job-android.yml'
- '.gitlab-ci-files/job-upload.yml'


stages:
Expand Down
2 changes: 1 addition & 1 deletion README.md
@@ -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.

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Expand Up @@ -11,7 +11,7 @@ buildscript {
}
dependencies {
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"

// NOTE: Do not place your application dependencies here; they belong
Expand Down
12 changes: 10 additions & 2 deletions docker-files/bc-dev-android → docker-files/bc-dev-android-28
Expand Up @@ -19,7 +19,7 @@ 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 install -y curl nano sudo unzip vim wget openjdk-8-jdk-headless rsync ssh && \
apt-get clean

# Get the Android tools
Expand All @@ -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

# 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
RUN useradd -ms /bin/bash bc && \
Expand Down

0 comments on commit 680111e

Please sign in to comment.