Jenkinsfile 938 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. pipeline {
  2. agent any
  3. stages {
  4. stage('检出') {
  5. steps {
  6. checkout([$class: 'GitSCM',
  7. branches: [[name: GIT_BUILD_REF]],
  8. userRemoteConfigs: [[
  9. url: GIT_REPO_URL,
  10. credentialsId: CREDENTIALS_ID
  11. ]]])
  12. }
  13. }
  14. stage('编译构建') {
  15. agent {
  16. docker {
  17. reuseNode 'true'
  18. registryUrl 'https://coding-public-docker.pkg.coding.net'
  19. image 'public/docker/android:29'
  20. }
  21. }
  22. post {
  23. always {
  24. sh './gradlew assembleDebug'
  25. }
  26. }
  27. steps {
  28. sh './gradlew clean && rm -rf ./app/build/'
  29. }
  30. }
  31. stage('上传到 Generic') {
  32. steps {
  33. codingArtifactsGeneric(credentialsId: "${CODING_ARTIFACTS_CREDENTIALS_ID}", withBuildProps: true, files: 'app/build/outputs/apk/**/*.apk', repoName: "${GENERIC_REPO_NAME}", version: "${CI_BUILD_NUMBER}")
  34. }
  35. }
  36. }
  37. }