Jenkinsfile 612 B

123456789101112131415161718192021222324252627282930
  1. pipeline {
  2. agent any
  3. stages {
  4. stage('Install Deps and build project') {
  5. steps {
  6. sh 'rm -rf node_modules/'
  7. sh 'npm install'
  8. sh 'npm run build'
  9. }
  10. }
  11. stage('Run Unit Tests') {
  12. steps {
  13. sh 'npm test'
  14. }
  15. }
  16. stage('Deploy Project To Nginx') {
  17. steps {
  18. echo "Deploy project"
  19. sh "cp -rp dist/* /var/www/html/"
  20. sh 'service nginx restart'
  21. echo "success"
  22. }
  23. }
  24. }
  25. }