Jenkinsfile 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. pipeline {
  2. agent {label '132'}
  3. stages {
  4. stage('Stop Server') {
  5. steps {
  6. catchError(buildResult: 'SUCCESS') {
  7. sh 'target/o2server/stop_linux.sh'
  8. }
  9. }
  10. }
  11. stage('init') {
  12. steps {
  13. sh 'npm install'
  14. sh 'npm run clear'
  15. }
  16. }
  17. stage('dependency') {
  18. steps {
  19. sh 'npm run preperation:linux'
  20. }
  21. }
  22. stage('build') {
  23. parallel {
  24. stage('build server') {
  25. steps {
  26. sh 'id'
  27. sh 'npm run build_server'
  28. }
  29. }
  30. stage('build web') {
  31. steps {
  32. sh 'npm run build_web'
  33. }
  34. }
  35. }
  36. }
  37. stage('deploy') {
  38. steps {
  39. sh 'npm run deploy:linux'
  40. sh 'chmod 777 target/o2server/*.sh'
  41. }
  42. }
  43. stage('run') {
  44. steps {
  45. sh 'JENKINS_NODE_COOKIE=dontKillMe nohup target/o2server/start_linux.sh > nohup.out &'
  46. }
  47. }
  48. }
  49. }