diff --git a/Jenkinsfile b/Jenkinsfile index d4bb938..2cc23f6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -38,7 +38,6 @@ // Initialize lazyConfig for this pipeline lazyConfig( name: 'DummyAnd', - env: [ 'DRYRUN=true' ], ) // Define a method to run Fastlane from the later lazyStages @@ -178,48 +177,48 @@ ] } -if (env.BRANCH_NAME != 'master') return 0 - -lazyStage { - name = 'release' - tasks = [ - pre: { - unarchive(mapping:['app/build/outputs/apk/' : '.']) - sh("ls -lA app/build/outputs/apk") - }, - run: { env -> - def currentVersion = [ name: getVersion('versionName') as String, code: getVersion('versionCode') as Integer ] - def nextVersion = [ name: currentVersion.name, code: currentVersion.code + 1] - echo("currentVersion = ${currentVersion.toString()} / nextVersion = ${nextVersion.toString()}") - withGitPassword('bot-ci-dgm', { - echo("Git logs since last tag:\n" + gitLog()) - prepareChangelogs(currentVersion.code) - if ( env.DRYRUN == 'false' ) fastlane('android', 'alpha') - gitUpdateChangelogs(currentVersion.code) - gitTag("${currentVersion.name}-${currentVersion.code}") - gitUpdateVersion(nextVersion.name, nextVersion.code) - }) - }, - on: 'android', - ] -} - -lazyStage { - name = 'acceptance' - tasks = [ - run: { env -> - input('Promote alpha to beta ?') - if ( env.DRYRUN == 'false' ) fastlane('android', 'beta') - } - ] -} - -lazyStage { - name = 'production' - tasks = [ - run: { env -> - input('Promote beta to production ?') - if ( env.DRYRUN == 'false' ) fastlane('android', 'production') - } - ] +if (env.BRANCH_NAME == 'master') { + lazyStage { + name = 'release' + tasks = [ + pre: { + unarchive(mapping:['app/build/outputs/apk/' : '.']) + sh("ls -lA app/build/outputs/apk") + }, + run: { env -> + def currentVersion = [ name: getVersion('versionName') as String, code: getVersion('versionCode') as Integer ] + def nextVersion = [ name: currentVersion.name, code: currentVersion.code + 1] + echo("currentVersion = ${currentVersion.toString()} / nextVersion = ${nextVersion.toString()}") + withGitPassword('bot-ci-dgm', { + echo("Git logs since last tag:\n" + gitLog()) + prepareChangelogs(currentVersion.code) + if ( env.DRYRUN == 'false' ) fastlane('android', 'alpha') + gitUpdateChangelogs(currentVersion.code) + gitTag("${currentVersion.name}-${currentVersion.code}") + gitUpdateVersion(nextVersion.name, nextVersion.code) + }) + }, + on: 'android', + ] + } + + lazyStage { + name = 'acceptance' + tasks = [ + run: { env -> + input('Promote alpha to beta ?') + if ( env.DRYRUN == 'false' ) fastlane('android', 'beta') + } + ] + } + + lazyStage { + name = 'production' + tasks = [ + run: { env -> + input('Promote beta to production ?') + if ( env.DRYRUN == 'false' ) fastlane('android', 'production') + } + ] + } }