File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed
Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -8,18 +8,22 @@ pipeline {
88 }
99 stage('Build') {
1010 steps {
11- sh "./gradlew clean bootJar"
11+ dir('photi-server') {
12+ sh "./gradlew clean bootJar"
13+ }
1214 }
1315 }
1416 stage('Deploy') {
1517 steps {
16- sshagent(credentials: ["$EC2_CREDENTIALS_ID"]) {
17- sh '''
18- ssh -o StrictHostKeyChecking=no ubuntu@$EC2_DEV_PRIVATE_IP
19- scp build/libs/*.jar ubuntu@$EC2_DEV_PRIVATE_IP:/home/ubuntu
20- ssh ubuntu@$EC2_DEV_PRIVATE_IP "sh photi-script.sh" &
21- '''
22- }
18+ dir('photi-server/build/libs') {
19+ sshagent(credentials: ["$EC2_CREDENTIALS_ID"]) {
20+ sh '''
21+ ssh -o StrictHostKeyChecking=no ubuntu@$EC2_DEV_PRIVATE_IP
22+ scp server-0.0.1-SNAPSHOT.jar ubuntu@$EC2_DEV_PRIVATE_IP:/home/ubuntu
23+ ssh ubuntu@$EC2_DEV_PRIVATE_IP "sh photi-script.sh" &
24+ '''
25+ }
26+ }
2327 }
2428 }
2529 }
You can’t perform that action at this time.
0 commit comments