-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
60 lines (53 loc) · 1.89 KB
/
Jenkinsfile
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
49
50
51
52
53
54
55
56
57
58
59
60
pipeline {
agent any
stages {
stage('build') {
steps {
catchError() {
sh '''cp ../properties/firebase-service-key.json ./src/main/resources
cp ../properties/application.properties ./src/main/resources
./gradlew build -x test'''
}
}
}
stage('docker push') {
steps {
catchError() {
sh 'docker build -t xodhkd36/yapp-server-test .'
sh 'docker push xodhkd36/yapp-server-test'
}
}
}
stage('SSH transfer') {
steps {
sshPublisher(failOnError: true, publishers: [
sshPublisherDesc(
configName: "dotoriham",
verbose: true,
transfers: [
sshTransfer(
sourceFiles: "run.zsh",
removePrefix: "",
remoteDirectory: "",
execCommand: "sh run.zsh"
)
]
)
])
}
}
}
environment {
SLACK_CHANNEL = 'team-web-2'
SUCCESS_COLOR = '#00FF00'
FAIL_COLOR = '#FF0000'
}
post {
success {
slackSend(channel: SLACK_CHANNEL, color: SUCCESS_COLOR, message: "배포 성공: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})")
}
failure {
slackSend(channel: SLACK_CHANNEL, color: FAIL_COLOR, message: "배포 실패: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})")
}
}
}