Browse Source

Update 'Jenkinsfile'

main
william 4 days ago
parent
commit
b271de936e
  1. 10
      Jenkinsfile

10
Jenkinsfile

@ -7,11 +7,11 @@ pipeline {
git(url: 'http://git.abilityell.com/william/react-project.git', branch: 'main')
withEnv(['CI=false']) { //ignore warning
sh 'npm install'
sh 'npm run build'
bat 'npm install'
bat 'npm run build'
}
sh '''
bat '''
echo "build react ..."
pwd
ls -l build
@ -20,14 +20,14 @@ pipeline {
}
stage('Test') {
steps {
sh 'mvn test'
bat 'mvn test'
}
}
stage("Deploy React App") {
when { expression { false } }
steps {
withCredentials([sshUserPrivateKey(credentialsId: 'docker-ssh', keyFileVariable: 'SSH_KEY')]) {
sh '''
bat '''
scp -i $SSH_KEY -o StrictHostKeyChecking=no -r build/* $DOCKER_HOST:/var/www/html/
ssh -i $SSH_KEY -o StrictHostKeyChecking=no $DOCKER_HOST 'chmod -R 755 /var/www/html/*'

Loading…
Cancel
Save