Jenkinsfile 1.2 KB

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