Jenkinsfile 944 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. pipeline {
  2. agent {
  3. dockerfile {
  4. filename 'Dockerfile'
  5. registryUrl 'https://registry.docker-cn.com'
  6. args '-p 84:84 -p 8081:8080 --security-opt apparmor=unconfined'
  7. }
  8. }
  9. stages {
  10. stage('Confirm to Proceed') {
  11. steps {
  12. input message: 'Proceed? (Click "Proceed" to continue)'
  13. }
  14. }
  15. stage('Maven Test and Deploy') {
  16. steps {
  17. sh "mvn -version"
  18. sh "mvn test"
  19. sh "mvn deploy"
  20. }
  21. }
  22. stage('SonarQube Analysis') {
  23. steps {
  24. sh 'sonar-scanner'
  25. }
  26. }
  27. stage('Deliver'){
  28. steps {
  29. input message: 'Finished using the server site? (Click "Proceed" to continue)'
  30. }
  31. }
  32. }
  33. post {
  34. always {
  35. cleanWs()
  36. }
  37. }
  38. }