Implementing Continuous Integration(CI) with Jenkins - thought-corner/backend-roadmap GitHub Wiki
Jenkins์ Git Repository ์ฐ๊ฒฐํ๊ธฐ
SCM : Git
Repository URL : ๋ ํฌ์งํ ๋ฆฌ URL
Branch Specifier : */main ํน์ */master๊ณผ ๊ฐ์ ๋ฐฐํฌํ ๋ธ๋์น๋ช
Script Path : Jenkinsfile(๋์๋ฌธ์ ์ฃผ์)
pipeline {
agent any
stages {
stage('Build') {
// Docker ์ปจํ
์ด๋์์ ๊ฒฉ๋ฆฌ๋ ํ๊ฒฝ์ผ๋ก ๋น๋ ์คํ
agent {
docker {
image 'gradle:8-jdk17'
}
}
steps {
// ์บ์ ์ ๊ฑฐ ํ ๋น๋ํ์ฌ ๊นจ๋ํ ์ํ ๋ณด์ฅ
sh 'gradle clean build'
}
}
}
}
Jenkins์์ JUnit5 ํ
์คํธ ๋ณด๊ณ ์ ๊ฒ์
pipeline {
agent any
stages {
stage('Build') {
steps {
sh './gradlew clean build'
}
}
}
post {
always {
// JUnit ํ
์คํธ ๊ฒฐ๊ณผ๋ฅผ Jenkins ๋์๋ณด๋์ ์์ง ๋ฐ ํ์
junit 'build/test-results/test/*.xml'
}
}
}
์ ์ฒด ํ์ดํ๋ผ์ธ ํ๋ฆ ์ ๋ฆฌ