diff --git a/Jenkinsfile b/Jenkinsfile index 4421818..f70d9c6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -216,6 +216,31 @@ ] } +// Release to internal test track, only for deploy branches +lazyStage { + name = 'internal' + onlyif = ( deployBranches.contains(lazyConfig['branch']) ) + input = 'Deploy to internal testers?' + tasks = [ + pre: { + unarchive(mapping:["${buildDir}/" : '.']) + }, + run: { + if ( !lazyConfig.env.DRYRUN ) { + withCredentials([file(credentialsId: env.GOOGLE_API_CID, variable: 'GOOGLE_API_FILE')]) { + sh('cp $GOOGLE_API_FILE ~/GoogleAPICredentials.json') + fastLane('android', 'internal') + } + } + }, + args: "-v /opt/android:/opt/android" + + " -e ANDROID_HOME=${env.ANDROID_HOME}" + + " -e GRADLE_USER_HOME=${env.GRADLE_USER_HOME}", + in: [ 'centos7' ], + on: 'android', + ] +} + // From alpha to beta, only for deploy branches lazyStage { name = 'alpha' diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 5625d4c..c3cd799 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -38,10 +38,10 @@ end if flavor file.each do |line| - if line[/^(#.*)?$/] + if line[/^\s*([#\/].*)?$/] next end - #UI.message("Line = #{line.tr("\n",'')}") + #UI.message("Line = #{line.tr("\n",'')}") if toggle_flavors current_flavor = line[/(?=\s*)\w+(?=\s+\{)/] if ! current_flavor @@ -58,11 +58,11 @@ next end if line[/\s*}/] - if current_flavor - current_flavor = nil - toggle_flavors = true - next - end + if current_flavor + current_flavor = nil + toggle_flavors = true + next + end if toggle_flavors break end @@ -146,6 +146,9 @@ end desc "Run all the tests" + # Test both acceptance and production flavors + # So we detect problem for those before releasing + # Test for dev2 will be done with build lane anyway lane :test do |options| gradle( task: "test", @@ -159,6 +162,15 @@ ) end + desc "Run integration tests" + # Test remote API + # So we know this build will not work againt the back-end + lane :intgtest do |options| + gradle( + task: "networking:test" + ) + end + desc "Build the apk" lane :build do |options| gradle( @@ -216,14 +228,14 @@ desc "Deploy a new alpha version to the Google Play" lane :alpha do |options| supply( - apk: "app/build/outputs/apk/#{getFlavorName(options)}/release/app-#{getFlavorName(options)}-release.apk", - mapping: "app/build/outputs/apk/#{getFlavorName(options)}/release/mapping.txt", - track: 'alpha', + track: 'internal', + track_promote_to: 'alpha', skip_upload_apk: true, skip_upload_metadata: true, skip_upload_images: true, skip_upload_screenshots: true, package_name: "#{getPackageName(options)}", + version_code: getVersionCode(), ) end