Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pipeline {
- agent {
- // Run on a build agent where we have the Android SDK installed
- label 'master'
- }
- options {
- // Stop the build early in case of compile or test failures
- skipStagesAfterUnstable()
- }
- stages {
- stage('Compile') {
- steps {
- // Compile the app and its dependencies
- sh './gradlew compileDebugSources'
- }
- }
- stage('Build APK') {
- steps {
- // Finish building and packaging the APK
- sh './gradlew assembleDebug'
- // Archive the APKs so that they can be downloaded from Jenkins
- archiveArtifacts '**/*.apk'
- }
- }
- stage('Static analysis') {
- steps {
- // Run Lint and analyse the results
- sh './gradlew lintDebug'
- androidLint pattern: '**/lint-results-*.xml'
- }
- }
- stage('Deploy') {
- when {
- // Only execute this stage when building from the `beta` branch
- branch 'beta'
- }
- steps {
- // Build the app in release mode, and sign the APK using the environment variables
- sh './gradlew assembleRelease'
- // Archive the APKs so that they can be downloaded from Jenkins
- archiveArtifacts '**/*.apk'
- // Upload the APK to Google Play
- //androidApkUpload googleCredentialsId: 'Google Play', apkFilesPattern: '**/*-release.apk', trackName: 'beta'
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement