Implement Jenkinsfile
This commit is contained in:
parent
be8f115304
commit
1ab1c02fd4
2 changed files with 135 additions and 2 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -132,7 +132,6 @@ android/app/google-services.json
|
||||||
google_maps_api.xml
|
google_maps_api.xml
|
||||||
|
|
||||||
# Web related
|
# Web related
|
||||||
lib/generated_plugin_registrant.dart
|
|
||||||
|
|
||||||
# Obfuscation related
|
# Obfuscation related
|
||||||
app.*.map.json
|
app.*.map.json
|
||||||
|
@ -862,4 +861,4 @@ Temporary Items
|
||||||
|
|
||||||
# Archives - https://github.com/github/gitignore/blob/main/Global/Archives.gitignore
|
# Archives - https://github.com/github/gitignore/blob/main/Global/Archives.gitignore
|
||||||
# Backup - https://github.com/github/gitignore/blob/main/Global/Backup.gitignore
|
# Backup - https://github.com/github/gitignore/blob/main/Global/Backup.gitignore
|
||||||
# JEnv - https://github.com/github/gitignore/blob/main/Global/JEnv.gitignore
|
# JEnv - https://github.com/github/gitignore/blob/main/Global/JEnv.gitignore
|
||||||
|
|
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