Verified Commit 6a5c3fda authored by Ryan Harg's avatar Ryan Harg
Browse files

Restructure pipelines to improve speed

parent c2becae5
......@@ -12,26 +12,36 @@ stages:
- deploy
.gradle-default:
stage: build
before_script:
- export GRADLE_USER_HOME=$(pwd)/.gradle
- chmod +x ./gradlew
- mkdir -p .android && touch .android/repositories.cfg
script:
- echo "Overwrite me"
cache:
key: ${CI_PROJECT_ID}
paths:
- .gradle/
- .gradle/wrapper
- .gradle/caches
- app/build
.build:
before_script:
- git fetch --unshallow --tags
stage: build
extends: .gradle-default
variables:
apk_file: 'app/build/outputs/apk/debug/app-debug.apk'
metadata_file: 'metadata/audio.funkwhale.android.yml'
before_script:
- git fetch --unshallow --tags
after_script:
- export versionCode=`$ANDROID_HOME/build-tools/30.0.2/aapt dump badging $apk_file | grep versionCode | awk '{print $3}' | sed s/versionCode=//g | sed s/\'//g`
- apt update && apt install gettext-base
- cat metadata/template.yml | envsubst > $metadata_file
artifacts:
paths:
- app/build/outputs/apk/debug/app-debug.apk
- $apk_file
- $metadata_file
- app/build/outputs/apk/debug/output-metadata.json
test:
extends: .gradle-default
......@@ -81,6 +91,8 @@ deploy-develop:
- eval `ssh-agent -s`
- ssh-add <(echo "$SSH_PRIVATE_KEY")
- scp -o StrictHostKeyChecking=no app/build/outputs/apk/debug/app-debug.apk fdroid@apps.funkwhale.audio:/srv/fdroid/fdroid/develop/repo/audio.funkwhale.ffa.dev-$CI_COMMIT_SHORT_SHA.apk
- scp -o StrictHostKeyChecking=no app/build/outputs/apk/debug/output-metadata.json fdroid@apps.funkwhale.audio:/srv/fdroid/fdroid/develop/output-metadata.json
- scp -o StrictHostKeyChecking=no metadata/audio.funkwhale.android.yml fdroid@apps.funkwhale.audio:/srv/fdroid/fdroid/develop/metadata/audio.funkwhale.ffa.dev.yml
- ssh -o StrictHostKeyChecking=no fdroid@apps.funkwhale.audio 'docker run --rm -u $(id -u):$(id -g) -v /srv/fdroid/fdroid/develop:/repo registry.gitlab.com/fdroid/docker-executable-fdroidserver:master update'
tags:
- shell
......@@ -4,3 +4,4 @@ kotlin.code.style=official
android.useAndroidX=true
android.enableJetifier=true
org.gradle.caching=true
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment