Advertisement
Guest User

Untitled

a guest
Nov 7th, 2019
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. pipeline {
  2. agent {
  3. // Run on a build agent where we have the Android SDK installed
  4. label 'master'
  5. }
  6. options {
  7. // Stop the build early in case of compile or test failures
  8. skipStagesAfterUnstable()
  9. }
  10. stages {
  11. stage('Compile') {
  12. steps {
  13. // Compile the app and its dependencies
  14. sh './gradlew compileDebugSources'
  15. }
  16. }
  17. stage('Build APK') {
  18. steps {
  19. // Finish building and packaging the APK
  20. sh './gradlew assembleDebug'
  21.  
  22. // Archive the APKs so that they can be downloaded from Jenkins
  23. archiveArtifacts '**/*.apk'
  24. }
  25. }
  26. stage('Static analysis') {
  27. steps {
  28. // Run Lint and analyse the results
  29. sh './gradlew lintDebug'
  30. androidLint pattern: '**/lint-results-*.xml'
  31. }
  32. }
  33. stage('Deploy') {
  34. when {
  35. // Only execute this stage when building from the `beta` branch
  36. branch 'beta'
  37. }
  38. steps {
  39. // Build the app in release mode, and sign the APK using the environment variables
  40. sh './gradlew assembleRelease'
  41.  
  42. // Archive the APKs so that they can be downloaded from Jenkins
  43. archiveArtifacts '**/*.apk'
  44.  
  45. // Upload the APK to Google Play
  46. //androidApkUpload googleCredentialsId: 'Google Play', apkFilesPattern: '**/*-release.apk', trackName: 'beta'
  47. }
  48. }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement