Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 
 

42 строки
1.4 KiB

  1. pipeline {
  2. agent any
  3. stages {
  4. stage('检出') {
  5. steps {
  6. checkout([$class: 'GitSCM', branches: [[name: env.GIT_BUILD_REF]],
  7. userRemoteConfigs: [[url: env.GIT_REPO_URL, credentialsId: env.CREDENTIALS_ID]]])
  8. }
  9. }
  10. stage('构建') {
  11. steps {
  12. sh 'mvn -version'
  13. echo '构建中...'
  14. sh 'mvn -U clean package -Dmaven.test.skip=true'
  15. echo '构建完成.'
  16. archiveArtifacts(artifacts: '**/target/*.jar', fingerprint: true)
  17. }
  18. }
  19. stage('测试') {
  20. steps {
  21. echo '单元测试中...'
  22. echo '单元测试完成.'
  23. writeFile(file: 'TEST-demo.junit4.AppTest.xml', text: '''
  24. <testsuite name="demo.junit4.AppTest" time="0.053" tests="3" errors="0" skipped="0" failures="0">
  25. <properties>
  26. </properties>
  27. <testcase name="testApp" classname="demo.junit4.AppTest" time="0.003"/>
  28. <testcase name="test1" classname="demo.junit4.AppTest" time="0"/>
  29. <testcase name="test2" classname="demo.junit4.AppTest" time="0"/>
  30. </testsuite>
  31. ''')
  32. junit '*.xml'
  33. }
  34. }
  35. stage('部署') {
  36. steps {
  37. echo '部署中...'
  38. echo '部署完成'
  39. }
  40. }
  41. }
  42. }