Update Jenkinsfile

This commit is contained in:
2026-04-04 19:27:18 +02:00
parent 1d32b9e1e7
commit 44ff18e56b

25
Jenkinsfile vendored
View File

@@ -1,56 +1,43 @@
pipeline { pipeline {
agent any agent any
environment { triggers {
ANDROID_SDK = '/home/jenkins/flutter_things/android-sdk' gitea()
ANDROID_PATH="$ANDROID_SDK/tools:$ANDROID_SDK/platform-tools"
FLUTTER = '/home/jenkins/flutter_things/flutter/bin'
PATH = "$PATH:$ANDROID_PATH:$FLUTTER"
//TODO: need to fix flutter
} }
stages { stages {
stage('Copy Key Properties') { stage('Copy Key Properties') {
steps { steps {
// Copy the key.properties file
sh 'cp /home/jenkins/key.properties refilc/android/key.properties' sh 'cp /home/jenkins/key.properties refilc/android/key.properties'
} }
} }
stage('Flutter Doctor') { stage('Flutter Doctor') {
steps { steps {
// Ensure Flutter is set up correctly
sh 'flutter doctor' sh 'flutter doctor'
} }
} }
stage('Dependencies') { stage('Dependencies') {
steps { steps {
// Get Flutter dependencies
sh 'cd refilc && flutter pub get' sh 'cd refilc && flutter pub get'
} }
} }
stage('Build') { stage('Build') {
steps { steps {
// Build the Flutter project
sh 'cd refilc && flutter build apk --release' sh 'cd refilc && flutter build apk --release'
} }
} }
stage('Archive') { stage('Archive') {
steps { steps {
// Archive the APK // Fixed path — APK is inside refilc/
archiveArtifacts artifacts: 'build/app/outputs/flutter-apk/app-release.apk', fingerprint: true archiveArtifacts artifacts: 'refilc/build/app/outputs/flutter-apk/app-release.apk',
fingerprint: true
} }
} }
} }
post { post {
always { always {
// Clean up workspace after build
cleanWs() cleanWs()
} }
} }
} }