Update Jenkinsfile

This commit is contained in:
lwj9812 2024-03-08 14:54:57 +09:00 committed by GitHub
parent 73b262411b
commit 29cc2534e7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

47
Jenkinsfile vendored
View file

@ -10,17 +10,54 @@ pipeline {
steps {
echo 'Git clone'
git url: 'https://github.com/lwj9812/spring-petclinic.git',
branch: 'efficient-webjars'
}
}
}
post {
branch: 'efficient-webjars'
}
post {
success {
echo 'Git Clone Success!!'
}
failure {
echo 'Git Clone Fail'
}
}
}
stage('Mvnen Build') {
steps {
echo 'Maven Build'
sh 'mvn -Dmaven.test.failure.igmore=ture clean package '
}
post {
success {
junit 'target/surefire-reports/**/*.xml'
}
}
}
stage('SSH Publish') {
steps {
echo 'SSH publish'
sshPublisher(publishers: [sshPublisherDesc(configName: 'target',
transfers: [sshTransfer(cleanRemote: false,
excludes: '',
execCommand: '''
fuser -k 8080/tcp
export BUILD_ID=Pipeline-Test
nohup java -jar /home/ubuntu/deploy/spring-petclinic-2.4.0.BUILD-SNAPSHOT.jar >> nohup.out 2>&1 &''',
execTimeout: 120000,
flatten: false,
makeEmptyDirs: false,
noDefaultExcludes: false,
patternSeparator: '[, ]+',
remoteDirectory: 'deploy',
remoteDirectorySDF: false,
removePrefix: 'target',
sourceFiles: 'target/*.jar')],
usePromotionTimestamp: false,
useWorkspaceInPromotion: false, verbose: false)])
}
}
}
}