forked from f-lab-edu/i-dol-u
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile-cd
More file actions
48 lines (44 loc) · 1.36 KB
/
Jenkinsfile-cd
File metadata and controls
48 lines (44 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
pipeline {
agent any
stages {
stage('Git Checkout') {
steps {
checkout scm
echo 'Git Checkout Success!'
}
}
stage('Test') {
steps {
sh './gradlew test'
echo 'test success'
}
}
stage('Build') {
steps {
sh './gradlew clean build'
echo 'build success'
}
}
stage('Deploy') {
steps([$class: 'BapSshPromotionPublishPlugin']) {
sshPublisher(
continueOnError: false, failOnError: true,
publishers: [
sshPublisherDesc(
configName: 'nginx-server',
verbose: true,
transfers: [
sshTransfer(
sourceFiles: "build/libs/*.jar",
removePrefix: "build/libs",
remoteDirectory: "app",
execCommand: "sh ~/app/deploy.sh >&1 ${JASYPT_PASSWORD} ${SERVER_1} ${SERVER_2}"
)
]
)
]
)
}
}
}
}