Dev #4

Closed
rezidir wants to merge 6 commits from dev into release
Vendored
+49 -49
View File
@@ -14,29 +14,29 @@ pipeline {
timestamps() timestamps()
} }
parameters { // parameters {
string(name: 'BUILD_TYPE', defaultValue: 'all', description: 'Build type: all, android, web') // string(name: 'BUILD_TYPE', defaultValue: 'all', description: 'Build type: all, android, web')
string(name: 'ANDROID_FLAVOR', defaultValue: 'release', description: 'Android build: debug, release') // string(name: 'ANDROID_FLAVOR', defaultValue: 'release', description: 'Android build: debug, release')
string(name: 'VERSION_NAME', defaultValue: '', description: 'Override version name (optional)') // string(name: 'VERSION_NAME', defaultValue: '', description: 'Override version name (optional)')
string(name: 'VERSION_CODE', defaultValue: '', description: 'Override version code (optional)') // string(name: 'VERSION_CODE', defaultValue: '', description: 'Override version code (optional)')
booleanParam(name: 'CLEAN_BUILD', defaultValue: true, description: 'Run flutter clean before build') // booleanParam(name: 'CLEAN_BUILD', defaultValue: true, description: 'Run flutter clean before build')
} // }
stages { stages {
stage('Preparation') { // stage('Preparation') {
steps { // steps {
script { // script {
def buildType = params.BUILD_TYPE.toLowerCase() // def buildType = params.BUILD_TYPE.toLowerCase()
if (buildType == 'all' || buildType == 'android') { // if (buildType == 'all' || buildType == 'android') {
currentBuild.description = "Android ${params.ANDROID_FLAVOR}" // currentBuild.description = "Android ${params.ANDROID_FLAVOR}"
} else if (buildType == 'web') { // } else if (buildType == 'web') {
currentBuild.description = "Web" // currentBuild.description = "Web"
} else { // } else {
error("Unknown BUILD_TYPE: ${buildType}. Use 'all', 'android', or 'web'") // error("Unknown BUILD_TYPE: ${buildType}. Use 'all', 'android', or 'web'")
} // }
} // }
} // }
} // }
stage('Environment Setup') { stage('Environment Setup') {
steps { steps {
@@ -45,20 +45,20 @@ pipeline {
env.PATH = "${flutterHome}/bin:${env.PATH}" env.PATH = "${flutterHome}/bin:${env.PATH}"
sh 'flutter doctor -v' sh 'flutter doctor -v'
} }
script { // script {
//def ANDROID_HOME = "/opt/flutter" // //def ANDROID_HOME = "/opt/flutter"
//env.PATH = "${flutterHome}/bin:${env.PATH}" // //env.PATH = "${flutterHome}/bin:${env.PATH}"
//sh 'find /soft -name "*droid*"' // //sh 'find /soft -name "*droid*"'
} // }
} }
} }
stage('Flutter Deps') { stage('Flutter clean') {
when { // when {
expression { // expression {
params.CLEAN_BUILD == true // params.CLEAN_BUILD == true
} // }
} // }
steps { steps {
sh 'flutter clean' sh 'flutter clean'
} }
@@ -76,16 +76,16 @@ pipeline {
} }
} }
stage('Tests') { // stage('Tests') {
steps { // steps {
sh 'flutter test --concurrency=1' // sh 'flutter test --concurrency=1'
} // }
post { // post {
always { // always {
junit allowEmptyResults: true, testResults: '**/test-results/*.xml' // junit allowEmptyResults: true, testResults: '**/test-results/*.xml'
} // }
} // }
} // }
// stage('Build Android') { // stage('Build Android') {
// when { // when {
@@ -169,12 +169,12 @@ pipeline {
// } // }
stage('Build Web') { stage('Build Web') {
when { // when {
expression { // expression {
def buildType = params.BUILD_TYPE.toLowerCase() // def buildType = params.BUILD_TYPE.toLowerCase()
buildType == 'all' || buildType == 'web' // buildType == 'all' || buildType == 'web'
} // }
} // }
steps { steps {
script { script {
currentBuild.displayName = "#${currentBuild.number} - Web" currentBuild.displayName = "#${currentBuild.number} - Web"