diff --git a/Jenkinsfile b/Jenkinsfile index b725429..74ccc48 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -55,7 +55,7 @@ // With the credentials, prepare the relevant environment withCredentials([usernamePassword(usernamePasswordMap)]){ - if (platform == 'android' ) { + if (platform == 'android' ) { envMap = [ 'SKIP_SLOW_FASTLANE_WARNING=YES', 'FASTLANE_SKIP_UPDATE_CHECK=YES', @@ -65,9 +65,9 @@ 'JAVA_HOME=/usr/java/latest', 'SLAVE_AAPT_TIMEOUT=15', ] - } else { - error "Unknown platform '${plateform}'" - } + } else { + error "Unknown platform '${plateform}'" + } // Now only calling Fastlane withEnv(envMap) { @@ -178,47 +178,48 @@ } 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 != 'true' ) 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 != 'true' ) fastlane('android', 'beta') - } - ] - } - - lazyStage { - name = 'production' - tasks = [ - run: { env -> - input('Promote beta to production ?') - if ( env.DRYRUN != 'true' ) fastlane('android', 'production') - } - ] - } + lazyStage { + name = 'release' + input = input('Release to alpha ?') + 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 != 'true' ) fastlane('android', 'alpha') + gitUpdateChangelogs(currentVersion.code) + gitTag("${currentVersion.name}-${currentVersion.code}") + gitUpdateVersion(nextVersion.name, nextVersion.code) + }) + }, + on: 'android', + ] + } + + lazyStage { + name = 'acceptance' + input = input('Promote alpha to beta ?') + tasks = [ + run: { env -> + if ( env.DRYRUN != 'true' ) fastlane('android', 'beta') + } + ] + } + + lazyStage { + name = 'production' + input = input('Promote beta to production ?') + tasks = [ + run: { env -> + if ( env.DRYRUN != 'true' ) fastlane('android', 'production') + } + ] + } }