Jenkinsfile 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. pipeline {
  2. agent {
  3. dockerfile {
  4. filename 'Dockerfile'
  5. registryUrl 'https://registry.docker-cn.com'
  6. args '-p 80:80 -p 81:81 -p 82:82 --security-opt apparmor=unconfined'
  7. }
  8. }
  9. stages {
  10. stage('SonarQube Analysis') {
  11. steps {
  12. sh 'sonar-scanner'
  13. }
  14. }
  15. stage('Build Dev Gitbook') {
  16. steps {
  17. sh 'gitbook install ./gitbook/dev'
  18. sh 'gitbook build ./gitbook/dev'
  19. }
  20. }
  21. stage('Build Product Gitbook') {
  22. steps {
  23. sh 'gitbook install ./gitbook/product'
  24. sh 'gitbook build ./gitbook/product'
  25. }
  26. }
  27. stage('Install') {
  28. steps {
  29. sh 'cnpm install'
  30. }
  31. }
  32. stage('Build'){
  33. steps {
  34. sh 'npm run build'
  35. }
  36. }
  37. stage('Deliver'){
  38. steps {
  39. sh 'echo $! > .pidfile'
  40. sh 'service nginx start'
  41. input message: 'Finished using the web site? (Click "Proceed" to continue)'
  42. }
  43. }
  44. }
  45. post {
  46. always {
  47. cleanWs()
  48. }
  49. }
  50. }