pipeline { agent any stages { stage('Build') { steps { echo 'Building the Vue project...' sh 'npm install' sh 'npm run build' } } stage('Test') { steps { echo 'Running tests...' sh 'npm run test' } } stage('Deploy') { steps { echo 'Deploying the project...' sh 'scp -P 10222 -r gyhl/* root@36.139.25.238:/opt/data/standard/nginx/www' // Optional: Restart Nginx if needed // sh 'ssh -p 10222 root@36.139.25.238 "systemctl restart nginx"' } } } post { always { echo 'Pipeline completed.' } } }