-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
100 lines (88 loc) · 2.42 KB
/
Jenkinsfile
File metadata and controls
100 lines (88 loc) · 2.42 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
pipeline {
agent any // 사용 가능한 에이전트에서 이 파이프라인 또는 해당 단계를 실행
stages {
stage('Clone') {
steps {
cleanWs()
git branch: 'develop',
url: 'https://github.com/CSlOl/cs101.git',
credentialsId: 'junpark36'
}
post {
success {
echo 'Clone Success'
}
failure {
echo 'Clone Failed'
}
}
}
stage('Build') {
steps {
dir('backend'){
sh './gradlew clean build'
}
}
post {
success {
echo 'Gradle Build Success'
}
failure {
echo 'Gradle Build Failed'
}
}
}
stage('Docker Cleanup') {
steps {
echo 'Docker Cleanup Start'
sh 'docker stop cs101-be'
sh 'docker rmi cs101-be'
}
post {
success {
echo 'Docker Cleanup Success'
}
failure {
echo 'Docker Cleanup Failed'
}
}
}
stage('Dockerizing'){
steps{
dir('backend'){
echo 'Backend Image Bulid Start'
sh 'docker build -t cs101-be .'
}
}
post {
success {
echo 'Bulid Docker Image Success'
}
failure {
echo 'Bulid Docker Image Failed'
}
}
}
stage('Deploy') {
steps {
sh 'docker run -d --rm -p 8080:80 -e CS101_DB_URL=$CS101_DB_URL -e CS101_DB_USERNAME=$CS101_DB_USERNAME -e CS101_DB_PASSWORD=$CS101_DB_PASSWORD -e SALT=$SALT --name cs101-be cs101-be'
}
post {
success {
echo 'Deploy Success'
}
failure {
echo 'Deploy Failed'
}
}
}
}
post {
success {
echo 'Pipeline Success'
}
failure {
echo 'Pipeline Failed'
}
}
}