From 321e79b9a1bfde7c124516f30e133c1afb406629 Mon Sep 17 00:00:00 2001 From: Julian Mutter Date: Sun, 26 Oct 2025 08:43:13 +0100 Subject: [PATCH] jenkins: run flutter builds sequential and deployment parallel --- Jenkinsfile | 102 ++++++++++++++++++++++++---------------------------- 1 file changed, 46 insertions(+), 56 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2aa1737..444b4d7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -13,75 +13,65 @@ pipeline { sh 'devenv test' } } - stage('Build and Deploy') { - stages { + stage('Flutter builds') { + sh 'devenv shell dart run pdfrx:remove_wasm_modules --revert' // Make sure WASM is put in output + sh 'devenv shell flutter build web --release' + + sh 'devenv shell dart run pdfrx:remove_wasm_modules' // NOT idempotent! + sh 'devenv shell flutter build apk --release' + + sh 'devenv shell dart run pdfrx:remove_wasm_modules --revert' // Reset again, just to be sure + } + stage('Parallel Deploy') { + parallel { stage('Web') { - stages { - stage('Build') { - steps { - sh 'devenv shell flutter build web --release' - sh 'docker build -t harbor.julian-mutter.de/sheetless/sheetless-frontend .' - } - } - stage('Deploy') { - steps { - withDockerRegistry([credentialsId: 'harbor', url: 'https://harbor.julian-mutter.de']) { - sh 'docker push harbor.julian-mutter.de/sheetless/sheetless-frontend' - } - } + steps { + sh 'docker build -t harbor.julian-mutter.de/sheetless/sheetless-frontend .' + withDockerRegistry([credentialsId: 'harbor', url: 'https://harbor.julian-mutter.de']) { + sh 'docker push harbor.julian-mutter.de/sheetless/sheetless-frontend' } } } stage('Android') { - stages { - stage('Build') { + stage('Checkout F-Droid Repo') { steps { - sh 'devenv shell flutter build apk --release' + dir("fdroid-repo") { + git branch: 'master', url: "https://gitlab.julian-mutter.de/julian/fdroid-frajul.git", credentialsId: "gitea", poll: "false" + } } } - stage('Deploy') { - stages { - stage('Checkout F-Droid Repo') { - steps { - dir("fdroid-repo") { - git branch: 'master', url: "https://gitlab.julian-mutter.de/julian/fdroid-frajul.git", credentialsId: "gitea", poll: "false" - } - } - } - stage('Decrypt keys') { - steps { - dir("fdroid-repo") { - sh 'devenv shell ./decrypt.sh' - } - } + stage('Decrypt keys') { + steps { + dir("fdroid-repo") { + sh 'devenv shell ./decrypt.sh' } + } + } - stage('Copy APK') { - steps { - sh "cp build/app/outputs/apk/release/app-release.apk fdroid-repo/fdroid/repo/sheetless.apk" - } + stage('Copy APK') { + steps { + sh "cp build/app/outputs/apk/release/app-release.apk fdroid-repo/fdroid/repo/sheetless.apk" + } + } + + stage('Update Metadata') { + steps { + dir("fdroid-repo") { + sh 'devenv shell ./update-repo.sh' } + } + } - stage('Update Metadata') { - steps { - dir("fdroid-repo") { - sh 'devenv shell ./update-repo.sh' - } - } - } - - stage('Push updates') { - steps { - dir("fdroid-repo") { - withCredentials([gitUsernamePassword(credentialsId: 'gitea')]) { - sh ''' - git config --global user.email "jenkins@comumail.de" - git config --global user.name "Jenkins CI" - ./push-updates.sh - ''' - } - } + stage('Push updates') { + steps { + dir("fdroid-repo") { + withCredentials([gitUsernamePassword(credentialsId: 'gitea')]) { + sh ''' + git config --global user.email "jenkins@comumail.de" + git config --global user.name "Jenkins CI" + ./push-updates.sh + ''' } } }