Jenkinsfile 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. }
  30. stage('Start Tomcat9'){
  31. steps {
  32. sh '/apache-tomcat9/bin/startup.sh'
  33. }
  34. }
  35. stage('Deliver'){
  36. steps {
  37. input message: 'Finished using the server site? (Click "Proceed" to continue)'
  38. }
  39. }
  40. }
  41. post {
  42. always {
  43. cleanWs()
  44. }
  45. }
  46. }