-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
42 lines (37 loc) · 1.04 KB
/
Copy pathJenkinsfile
File metadata and controls
42 lines (37 loc) · 1.04 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
pipeline {
agent any
stages {
stage('Checkout') {
steps {
// GitHub에서 코드를 가져옵니다.
checkout scm
}
}
stage('Permission') {
steps {
// 맥/리눅스 환경에서 gradle 실행 권한을 부여합니다.
sh 'chmod +x gradlew'
}
}
stage('Build') {
steps {
// 프로젝트를 빌드하고 jar 파일을 생성합니다.
sh './gradlew clean build'
sh 'chmod +x gradlew'
}
}
stage('Test') {
steps {
// 테스트 코드를 실행합니다.
sh './gradlew test'
}
}
}
post {
success {
// 빌드 성공 시 생성된 jar 파일을 젠킨스에 보관합니다.
archiveArtifacts artifacts: 'build/libs/*.jar', fingerprint: true
echo 'Build and Test Finished Successfully!'
}
}
}