61 lines
2.2 KiB
YAML
61 lines
2.2 KiB
YAML
---
|
|
kind: pipeline
|
|
name: build
|
|
|
|
workspace:
|
|
base: /src
|
|
path: .
|
|
|
|
steps:
|
|
|
|
- name: build
|
|
image: openjdk:8-jdk
|
|
environment:
|
|
ANDROID_COMPILE_SDK: 25
|
|
ANDROID_BUILD_TOOLS: 25.0.2
|
|
ANDROID_SDK_TOOLS: 3859397
|
|
commands:
|
|
- chmod +x ./gradlew
|
|
- export ANDROID_HOME=/src/android-sdk-linux
|
|
- export PATH=$${PATH}:$${ANDROID_HOME}/platform-tools/
|
|
- export GRADLE_USER_HOME=/src/.gradle
|
|
- apt-get --quiet update --yes
|
|
- apt-get --quiet install --yes wget tar unzip lib32stdc++6 lib32z1
|
|
- wget --no-clobber --quiet --output-document=sdk-tools-linux-$${ANDROID_SDK_TOOLS}.zip https://dl.google.com/android/repository/sdk-tools-linux-$${ANDROID_SDK_TOOLS}.zip || true
|
|
- unzip -q -d $${ANDROID_HOME}/ sdk-tools-linux-$${ANDROID_SDK_TOOLS}.zip
|
|
- mkdir -p $${ANDROID_HOME}/licenses/
|
|
- echo "8933bad161af4178b1185d1a37fbf41ea5269c55" > $${ANDROID_HOME}/licenses/android-sdk-license
|
|
- mkdir -p $${HOME}/.android
|
|
- touch $${HOME}/.android/repositories.cfg
|
|
- echo y | $${ANDROID_HOME}/tools/bin/sdkmanager --update
|
|
- echo y | $${ANDROID_HOME}/tools/bin/sdkmanager "platforms;android-$${ANDROID_COMPILE_SDK}"
|
|
- echo y | $${ANDROID_HOME}/tools/bin/sdkmanager "build-tools;$${ANDROID_BUILD_TOOLS}"
|
|
- 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"
|
|
- ./gradlew test
|
|
- ./gradlew build
|
|
|
|
- name: upload
|
|
image: vividboarder/drone-webdav
|
|
settings:
|
|
file: com.iamthefij.otbeta/build/outputs/apk/com.iamthefij.otbeta-debug.apk
|
|
destination: https://cloud.iamthefij.com/remote.php/dav/files/iamthefij/Android/Apks/
|
|
username:
|
|
from_secret: WEBDAV_USER
|
|
password:
|
|
from_secret: WEBDAV_PASSWORD
|
|
|
|
- name: notify
|
|
image: drillster/drone-email
|
|
settings:
|
|
host:
|
|
from_secret: smtp_host
|
|
username:
|
|
from_secret: smtp_user
|
|
password:
|
|
from_secret: smtp_pass
|
|
from: drone@iamthefij.com
|
|
when:
|
|
status: [changed, failure]
|