Files
sheetless/Jenkinsfile
2025-10-09 09:16:14 +02:00

101 lines
4.0 KiB
Groovy

pipeline {
agent {
node {
label 'devenv'
}
}
triggers {
pollSCM('H/10 * * * *')
}
stages {
stage('Test devenv') {
steps {
sh 'devenv test'
}
}
stage('Parallel Build and Deploy') {
parallel {
stage('Android') {
stages {
stage('Build') {
steps {
sh 'devenv shell flutter build apk'
}
}
stage('Deploy') {
stages {
stage('Checkout F-Droid Repo') {
steps {
dir("fdroid-repo") {
git branch: 'binaries', url: "https://gitlab.julian-mutter.de/julian/fdroid-frajul.git", credentialsId: "3563e7c8-6a79-407c-9681-5d6e6291ba34"
}
}
}
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('Update Metadata') {
steps {
dir("fdroid-repo") {
sh 'devenv shell ./update-repo.sh'
}
}
}
stage('Push updates') {
steps {
dir("fdroid-repo") {
sh '''
git fetch origin
git cehckout master
git add .
git commit -m "Update repo from CI"
git push origin master
./push-apks.sh
'''
}
}
}
}
}
}
}
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'
}
}
}
}
}
}
}
}
post {
always {
step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: emailextrecipients([developers(), requestor()])])
}
}
}