Jenkinsfile 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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 clean package"
  18. }
  19. }
  20. stage('SonarQube Analysis') {
  21. steps {
  22. sh 'sonar-scanner'
  23. }
  24. }
  25. stage('Import to Webapps')
  26. steps {
  27. sh 'cp ./target/BI.war /apache-tomcat9/webapps'
  28. }
  29. stage('Start Tomcat9'){
  30. steps {
  31. sh '/apache-tomcat9/bin/startup.sh'
  32. }
  33. }
  34. stage('Deliver'){
  35. steps {
  36. input message: 'Finished using the server site? (Click "Proceed" to continue)'
  37. }
  38. }
  39. }
  40. post {
  41. always {
  42. cleanWs()
  43. }
  44. }
  45. }