Jenkinsfile

Signed-off-by: wodnr533 <wodnr533@naver.com>
This commit is contained in:
wodnr533 2025-12-08 12:33:15 +09:00 committed by GitHub
parent e4c4ff2176
commit 131d82a270
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

25
Jenkinsfile vendored
View file

@ -13,7 +13,7 @@ pipeline {
stages{
stage('Git Clone'){
steps {
git url: 'https://github.com/sjh4616/spring-petclinic.git', branch: 'main'
git url: 'https://github.com/wodnr533/spring-petclinic.git'
}
}
stage('Maven Build'){
@ -44,27 +44,10 @@ pipeline {
sh 'docker rmi wodnr8174/spring-petclinic:$BUILD_NUMBER wodnr8174/spring-petclinic:latest'
}
}
stage('Publish Over SSH') {
stage('Kubernetes Deploy') {
steps {
sshPublisher(publishers: [sshPublisherDesc(configName: 'WEB01',
transfers: [sshTransfer(cleanRemote: false,
excludes: '',
execCommand: '''
fuser -k 8080/tcp
export BUILD_ID=WEB01
nohup java -jar /home/web01/deploy/spring-petclinic-3.5.0-SNAPSHOT.jar >> nohup.out 2>&1 &''',
execTimeout: 120000,
flatten: false,
makeEmptyDirs: false,
noDefaultExcludes: false,
patternSeparator: '[, ]+',
remoteDirectory: '',
remoteDirectorySDF: false,
removePrefix: 'target',
sourceFiles: 'target/*.jar')],
usePromotionTimestamp: false,
useWorkspaceInPromotion: false,
verbose: false)])
sh "kubectl set image deployment/petclinic workload=wodnr8174/spring-petclinic:latest"
sh 'kubectl apply -f petclinic.yml'
}
}
}