From b175a97c417051990b059dceb13a18110620b65d Mon Sep 17 00:00:00 2001 From: zontreck Date: Sun, 21 Jul 2024 02:32:47 -0700 Subject: [PATCH] Add jenkins build file --- Jenkinsfile | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..62aa333 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,46 @@ +pipeline { + agent { + label 'linux' + } + options { + buildDiscarder( + logRotator( + numToKeepStr: '5' + ) + ) + } + + stages { + step ("Build") { + script { + sh ''' + #!/bin/bash + + flutter pub get + flutter build linux + flutter build apk + ''' + } + } + step ('Package') { + script { + sh ''' + #!/bin/bash + + cd build/linux/x64/release/bundle + tar -cvf ../../../../../linux.tgz ./ + cd ../../../../app/outputs/flutter-apk + cp app-release.apk ../../../../ + ''' + } + } + } + + post { + always { + archiveArtifacts artifacts: '*.tgz', fingerprint: true + archiveArtifacts artifacts: '*.apk', fingerprint: true + deleteDir() + } + } +} \ No newline at end of file