Implement Jenkinsfile
This commit is contained in:
parent
be8f115304
commit
1ab1c02fd4
2 changed files with 135 additions and 2 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -132,7 +132,6 @@ android/app/google-services.json
|
|||
google_maps_api.xml
|
||||
|
||||
# Web related
|
||||
lib/generated_plugin_registrant.dart
|
||||
|
||||
# Obfuscation related
|
||||
app.*.map.json
|
||||
|
|
134
Jenkinsfile
vendored
Normal file
134
Jenkinsfile
vendored
Normal file
|
@ -0,0 +1,134 @@
|
|||
pipeline {
|
||||
agent any
|
||||
|
||||
options {
|
||||
buildDiscarder (
|
||||
logRotator(
|
||||
numToKeepStr: '5'
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
stages {
|
||||
stage("Compile Windows") {
|
||||
agent {
|
||||
label 'windows'
|
||||
}
|
||||
|
||||
steps {
|
||||
script {
|
||||
bat 'mkdir out'
|
||||
bat 'flutter pub get'
|
||||
bat 'flutter build windows'
|
||||
dir("build\\windows\\x64\\runner\\Release") {
|
||||
bat 'tar -cvf ..\\..\\..\\..\\..\\windows.tgz .'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
post {
|
||||
always {
|
||||
archiveArtifacts artifacts: "windows.tgz"
|
||||
|
||||
cleanWs()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage("Build Linux") {
|
||||
agent {
|
||||
label 'linux'
|
||||
}
|
||||
|
||||
steps {
|
||||
script {
|
||||
sh '''
|
||||
#!/bin/bash
|
||||
|
||||
flutter pub get
|
||||
mkdir out
|
||||
flutter build linux
|
||||
'''
|
||||
|
||||
dir("build/linux/x64/release/bundle") {
|
||||
sh 'tar -cvf ../../../../../linux.tgz .'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
post {
|
||||
always {
|
||||
archiveArtifacts artifacts: "linux.tgz"
|
||||
|
||||
cleanWs()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage("Build Android") {
|
||||
agent {
|
||||
label 'linux'
|
||||
}
|
||||
|
||||
steps {
|
||||
script {
|
||||
sh '''
|
||||
#!/bin/bash
|
||||
|
||||
flutter pub get
|
||||
mkdir out
|
||||
flutter build apk
|
||||
flutter build appbundle
|
||||
'''
|
||||
|
||||
dir("build/app/outputs/bundle/release") {
|
||||
sh 'cp app-release.aab ../../../../../bugvault.aab'
|
||||
}
|
||||
|
||||
dir("build/app/outputs/flutter-apk") {
|
||||
sh 'cp app-release.apk ../../../../bugvault.apk'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
post {
|
||||
always {
|
||||
archiveArtifacts artifacts: "bugvault.aab"
|
||||
archiveArtifacts artifacts: "bugvault.apk"
|
||||
|
||||
cleanWs()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage("Build Web") {
|
||||
agent {
|
||||
label 'linux'
|
||||
}
|
||||
|
||||
steps {
|
||||
script {
|
||||
sh '''
|
||||
#!/bin/bash
|
||||
|
||||
flutter pub get
|
||||
mkdir out
|
||||
flutter build web
|
||||
'''
|
||||
|
||||
dir("build/web") {
|
||||
sh 'tar -cvf ../../web.tgz .'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
post {
|
||||
always {
|
||||
archiveArtifacts artifacts: "web.tgz"
|
||||
|
||||
cleanWs()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue