-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathJenkinsfile
More file actions
38 lines (33 loc) · 936 Bytes
/
Jenkinsfile
File metadata and controls
38 lines (33 loc) · 936 Bytes
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
pipeline {
agent any
environment {
DOCKER_IMAGE = 'your-docker-repo/your-spring-boot-app:latest' // 도커 이미지 경로
KUBECONFIG = '/Users/jeongchan-u/.kube/config' // Kubeconfig 파일 경로
}
stages {
stage('Build') {
steps {
// Docker 이미지 빌드
sh 'docker build -t $DOCKER_IMAGE .'
}
}
stage('Test') {
steps {
// 예: 그레이들 테스트
sh './gradlew test'
}
}
stage('Push Docker Image') {
steps {
// Docker 이미지 푸시
sh 'docker push $DOCKER_IMAGE'
}
}
stage('Deploy to Kubernetes') {
steps {
// Kubernetes에 배포
sh 'kubectl apply -f kubernetes/k8s-deployment.yaml'
}
}
}
}