jenkins: run flutter builds sequential and deployment parallel
This commit is contained in:
102
Jenkinsfile
vendored
102
Jenkinsfile
vendored
@@ -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
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user