Jenkinsfile 993 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. pipeline {
  2. agent {
  3. dockerfile {
  4. filename 'Dockerfile'
  5. registryUrl 'https://registry.docker-cn.com'
  6. args '-p 8081:8080 --security-opt apparmor=unconfined'
  7. }
  8. }
  9. stages {
  10. stage('Maven Test and Deploy') {
  11. steps {
  12. sh "mvn clean install"
  13. }
  14. }
  15. stage('SonarQube Analysis') {
  16. steps {
  17. sh 'sonar-scanner'
  18. }
  19. }
  20. stage('Import to Webapps'){
  21. steps {
  22. sh 'cp ./target/BI.war /apache-tomcat9/webapps'
  23. }
  24. }
  25. stage('Start Tomcat9'){
  26. steps {
  27. sh '/apache-tomcat9/bin/catalina.sh run'
  28. }
  29. }
  30. stage('Deliver'){
  31. steps {
  32. input message: 'Finished using the server site? (Click "Proceed" to continue)'
  33. }
  34. }
  35. }
  36. post {
  37. always {
  38. cleanWs()
  39. }
  40. }
  41. }