Commit c5237508 authored by Christophe Henry's avatar Christophe Henry

Enable Jenkins build and archive APK

parent 9c47a2a1
Pipeline #3720 passed with stage
in 0 seconds
......@@ -4,6 +4,7 @@ pipeline {
image "bitriseio/docker-android"
args "-v /etc/passwd:/etc/passwd:ro " +
"-v /home/android/android-sdk-linux/:/opt/android-sdk-linux/:rw " +
"-v /home/android/freshrss_signkey.jks:/home/android/freshrss_signkey.jks:ro " +
"-u root --privileged"
}
}
......@@ -14,6 +15,8 @@ pipeline {
MIN_SDK_IMAGE = "system-images;android-$MIN_SDK_VERSION;default;x86_64".toString()
MAX_SDK_IMAGE = "system-images;android-$MAX_SDK_VERSION;default;x86_64".toString()
ANDROID_HOME = "/opt/android-sdk-linux"
SIGN_KEY_PATH = "/home/android/freshrss_signkey.jks"
SIGN_KEY_CREDENTIALS = credentials "freshrss-signkey"
}
options {
......@@ -21,11 +24,12 @@ pipeline {
skipStagesAfterUnstable()
gitLabConnection('GitlabFeneas')
gitlabBuilds(builds: [
'Compile',
'Lint',
'Unit tests',
'Instrumented tests on min SDK image',
'Instrumented tests on max SDK image'
"Compile",
"Lint",
"Unit tests",
"Instrumented tests on min SDK image",
"Instrumented tests on max SDK image",
"Build APK"
])
disableConcurrentBuilds()
newContainerPerStage()
......@@ -121,15 +125,19 @@ pipeline {
}
}
// stage("Build APK") {
// steps {
// withAvd(hardwareProfile: "Nexus 5X", systemImage: env.MIN_SDK_IMAGE, headless: true) {
// sh "./gradlew assembleDebug"
// archiveArtifacts "**/*.apk"
// }
// }
// }
stage("Build APK") {
steps {
gitlabCommitStatus("Build APK") {
sh("""./gradlew clean assembleRelease \
-Pandroid.injected.signing.store.file=${env.SIGN_KEY_PATH} \
-Pandroid.injected.signing.store.password=${env.SIGN_KEY_CREDENTIALS_PSW} \
-Pandroid.injected.signing.key.alias=${env.SIGN_KEY_CREDENTIALS_USR} \
-Pandroid.injected.signing.key.password=${env.SIGN_KEY_CREDENTIALS_PSW}
""")
archiveArtifacts artifacts: "**/*.apk", fingerprint: true
}
}
}
}
post {
......
......@@ -73,6 +73,9 @@ android {
delete new FileNameFinder().getFileNames(buildDir.absolutePath, "**/config.properties")
}
}
variant.outputs.all { output ->
outputFileName = new File("FreshRSS-Jenkins-${variant.versionName}-${variant.name}.apk")
}
}
androidExtensions {
......
Markdown is supported
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