diff --git a/android/current-jobs.json b/android/current-jobs.json index 78f5ea3..4a75517 100644 --- a/android/current-jobs.json +++ b/android/current-jobs.json @@ -1,7 +1,8 @@ [ {"name": "KAlgebra", "application": "kalgebra", "type": "generic-build", "cmakeParameters": ""}, {"name": "KirigamiGallery", "application": "kirigami", "type": "generic-build", "cmakeParameters": "-DBUILD_EXAMPLES=ON"}, {"name": "Klimbgrades", "application": "klimbgrades", "type": "generic-build", "cmakeParameters": ""}, {"name": "KTuberling", "application": "ktuberling", "type": "generic-build", "cmakeParameters": ""}, - {"name": "vvave", "application": "vvave", "type": "generic-build", "cmakeParameters": ""} + {"name": "vvave", "application": "vvave", "type": "generic-build", "cmakeParameters": ""}, + {"name": "Okular", "application": "okular", "type": "generic-build", "cmakeParameters": "", "dependency": "/opt/helpers/build-poppler"} ] diff --git a/android/generic-build.pipeline b/android/generic-build.pipeline index 3147f9b..3fd4e8a 100644 --- a/android/generic-build.pipeline +++ b/android/generic-build.pipeline @@ -1,22 +1,23 @@ // Request a node to be allocated to us node( "AndroidSDK" ) { // We want Timestamps on everything timestamps { // We want to catch any errors that occur to allow us to send out notifications (ie. emails) if needed catchError { // Android application builds are performed by a single script, so let's get that underway stage('Building Application') { // Do the build! sh """ + ${dependency} /opt/helpers/build-generic ${application} ${cmakeParameters} """ } stage('Capturing APKs') { // Now grab the APKs it generated archiveArtifacts artifacts: 'build/*/*_build_apk/build/outputs/apk/*-debug.apk', onlyIfSuccessful: true } } } } diff --git a/dsl/android_jobs.groovy b/dsl/android_jobs.groovy index b945371..ec80edd 100644 --- a/dsl/android_jobs.groovy +++ b/dsl/android_jobs.groovy @@ -1,53 +1,54 @@ // Read the contents of the gathered-jobs.json file a step created for us previously def jobsToParse = readFileFromWorkspace('android/current-jobs.json') def knownJobs = new groovy.json.JsonSlurper().parseText( jobsToParse ) // Iterate over all of the known jobs and create them! knownJobs.each { // Save our job name for later def jobName = "${it.name}_android" // Read in the necessary Pipeline template def pipelineTemplate = readFileFromWorkspace("android/${it.type}.pipeline") // Now we can construct our Pipeline script // We append a series of variables to the top of it to provide a variety of useful information to the otherwise templated script // These appended variables are what makes one build different to the next, aside from the template which was used def pipelineScript = """ |def application = "${it.application}" |def cmakeParameters = "${it.cmakeParameters}" + |def dependency = "${it.dependency}" |${pipelineTemplate}""".stripMargin() // Actually create the job now pipelineJob( jobName ) { properties { // We don't want to keep build results forever // We'll set it to keep the last 10 builds and discard everything else buildDiscarder { strategy { logRotator { numToKeepStr("5") daysToKeepStr('') artifactDaysToKeepStr('') artifactNumToKeepStr('') } } } // We don't want to be building the same project more than once // This is to prevent one project hogging resources // And also has a practical component as otherwise an older build could finish afterwards and upload old build results disableConcurrentBuilds() } triggers { // We want to automatically rebuild once a day cron("@daily") } // This is where the Pipeline script actually happens :) definition { cps { script( pipelineScript ) sandbox() } } } }