-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathjenkinsfile_ws_dev
More file actions
37 lines (31 loc) · 1.05 KB
/
jenkinsfile_ws_dev
File metadata and controls
37 lines (31 loc) · 1.05 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
/* pipeline 변수 설정 */
def app
node {
// github 로부터 소스코드 다운로드
stage('Checkout') {
checkout scm
}
// mvn 툴 선언하는 stage, 필자의 경우 maven 3.6.0을 사용중
stage('Ready'){
echo "Ready to build"
echo "${env.BUILD_NUMBER}"
echo "${env.GIT_COMMIT}"
}
//dockerfile기반 빌드하는 stage ,git소스 root에 dockerfile이 있어야한다
stage('Build image'){
app = docker.build("harbor.cu.ac.kr/dcucode_dev/ssh-ws-server", "-f Dockerfile_ws .")
}
stage('Push image') {
docker.withRegistry("https://harbor.cu.ac.kr", "harbor") {
app.push("latest")
app.push("${env.BUILD_NUMBER}")
}
}
stage('Kubernetes deploy') {
sh "kubectl delete -f /services/dcucode/ssh-server/ssh-ws-server_dev_only_con.yaml -n dcucode-dev"
sh "kubectl apply -f /services/dcucode/ssh-server/ssh-ws-server_dev_only_con.yaml -n dcucode-dev"
}
stage('Complete') {
sh "echo 'The end'"
}
}