From eca3c7471e83fa0f13a64c287372a5c9f6ddf7c2 Mon Sep 17 00:00:00 2001 From: seongtaemin Date: Fri, 6 Feb 2026 14:17:46 +0900 Subject: [PATCH 1/8] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 12a0b7d..d736a71 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # fastcampus-jenkins # fastcampus-jenkins + From 72e3462770302de6c1edc8c62522b3952b8199b7 Mon Sep 17 00:00:00 2001 From: seongtaemin Date: Mon, 9 Feb 2026 14:33:15 +0900 Subject: [PATCH 2/8] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index d736a71..a03fd59 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ # fastcampus-jenkins # fastcampus-jenkins + From d72e628c07344510d079b112512f9050759f963f Mon Sep 17 00:00:00 2001 From: seongtaemin Date: Wed, 11 Feb 2026 11:17:49 +0900 Subject: [PATCH 3/8] Update Jenkinsfile-build --- Jenkinsfile-build | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/Jenkinsfile-build b/Jenkinsfile-build index f52ed39..5d000c3 100644 --- a/Jenkinsfile-build +++ b/Jenkinsfile-build @@ -18,7 +18,7 @@ pipeline { // 빌드를 5개만 유지 buildDiscarder logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '5', numToKeepStr: '5') // github 프로젝트 설정 - githubProjectProperty(displayName: '', projectUrlStr: 'https://github.com/fastcampus-jenkins/fastcampus-jenkins') + githubProjectProperty(displayName: '', projectUrlStr: 'https://github.com/seongtaemin/fastcampus-jenkins') } @@ -56,7 +56,21 @@ pipeline { } } } - + + + stage('Checkout') { + steps { + checkout scmGit( + branches: [[name: "${params.BRANCH}"]], + userRemoteConfigs: [[ + // credential id 는 http://localhost:8080/pipeline-syntax/ 에서 checkout step 생성을 통해 확인 가능 + credentialsId: 'github-ssh', + url: 'git@github.com:seongtaemin/fastcampus-jenkins.git'] + ], + extensions: [[$class: 'SparseCheckoutPaths', sparseCheckoutPaths: [[path: 'projects/spring-app']]]] + ) + } + } stage('Build') { steps { @@ -70,11 +84,7 @@ pipeline { } } - stage('SonarScanner') { - when { - environment name: "GIT_BRANCH", value: "origin/main" - } steps { // sonarqube 환경하에서, 실행 withSonarQubeEnv("sonarqube-server") { @@ -104,9 +114,8 @@ pipeline { junit '**/test-results/**/*.xml' jacoco sourcePattern: '**/src/main/kotlin' mineRepository() - emailext attachLog: true, body: email_content(), subject: email_subject(), to: 'junoyoon@gmail.com' + emailext attachLog: true, body: email_content(), subject: email_subject(), to: 'taemni.seong@gmail.com' slackSend channel: "#jenkins", message: "${custom_msg(currentBuild.currentResult)}" - } success { @@ -150,4 +159,3 @@ def groovy_script() { return "$BRANCH 가 빌드 됩니다." }''' } - From 305b291bcbebcfb25729911d29fcda03a2b2794f Mon Sep 17 00:00:00 2001 From: seongtaemin Date: Wed, 11 Feb 2026 13:40:38 +0900 Subject: [PATCH 4/8] Update Jenkinsfile-build --- Jenkinsfile-build | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/Jenkinsfile-build b/Jenkinsfile-build index 5d000c3..ef54283 100644 --- a/Jenkinsfile-build +++ b/Jenkinsfile-build @@ -58,20 +58,6 @@ pipeline { } - stage('Checkout') { - steps { - checkout scmGit( - branches: [[name: "${params.BRANCH}"]], - userRemoteConfigs: [[ - // credential id 는 http://localhost:8080/pipeline-syntax/ 에서 checkout step 생성을 통해 확인 가능 - credentialsId: 'github-ssh', - url: 'git@github.com:seongtaemin/fastcampus-jenkins.git'] - ], - extensions: [[$class: 'SparseCheckoutPaths', sparseCheckoutPaths: [[path: 'projects/spring-app']]]] - ) - } - } - stage('Build') { steps { // dir 은 디렉토리 이동 @@ -85,6 +71,9 @@ pipeline { } stage('SonarScanner') { + when { + environment name: "GIT_BRANCH", value: "origin/main" + } steps { // sonarqube 환경하에서, 실행 withSonarQubeEnv("sonarqube-server") { From c8fa88892d404e19acd4a98d267973ef6bc754c2 Mon Sep 17 00:00:00 2001 From: seongtaemin Date: Wed, 11 Feb 2026 14:03:34 +0900 Subject: [PATCH 5/8] Update Jenkinsfile-deploy --- Jenkinsfile-deploy | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Jenkinsfile-deploy b/Jenkinsfile-deploy index 3406586..96d2dad 100644 --- a/Jenkinsfile-deploy +++ b/Jenkinsfile-deploy @@ -17,14 +17,14 @@ pipeline { // stages > stage > steps 순으로 구성 stages { - stage("Checking Deployment") { - when { - environment name: 'ARE_YOU_SURE', value: 'false' - } - steps { - error('Executed mistakenly.') - } - } + stage("Checking Deployment") { + when { + environment name: 'ARE_YOU_SURE', value: 'false' + } + steps { + error('Executed mistakenly.') + } + } stage('Copying from upstream.') { steps { From bfb8c22eaf6a5e219e73bb3b30aab5731c4c1403 Mon Sep 17 00:00:00 2001 From: seongtaemin Date: Wed, 11 Feb 2026 14:28:48 +0900 Subject: [PATCH 6/8] Update Jenkinsfile-pr --- Jenkinsfile-pr | 94 +++++++++++++++++++++++--------------------------- 1 file changed, 43 insertions(+), 51 deletions(-) diff --git a/Jenkinsfile-pr b/Jenkinsfile-pr index d142f9c..f867fdf 100644 --- a/Jenkinsfile-pr +++ b/Jenkinsfile-pr @@ -1,67 +1,59 @@ pipeline { - // 어떠한 에이전트에서도 실행 가능함을 표현 agent any - - options { - // 빌드를 5개만 유지 - buildDiscarder logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '5', numToKeepStr: '5') - // github 프로젝트 설정 - githubProjectProperty(displayName: '', projectUrlStr: 'https://github.com/fastcampus-jenkins/fastcampus-jenkins') + buildDiscarder logRotator( + artifactDaysToKeepStr: '', + artifactNumToKeepStr: '', + daysToKeepStr: '5', + numToKeepStr: '5' + ) + githubProjectProperty( + displayName: '', + projectUrlStr: 'https://github.com/seongtaemin/fastcampus-jenkins' + ) } - - // stages > stage > steps 순으로 구성 stages { stage('Prepare') { steps { - // 어떤 환경변수가 주입되는지 확인 sh "printenv" script { - properties([ - // https://www.jenkins.io/doc/pipeline/steps/params/pipelinetriggers/ - pipelineTriggers([ - // PR builder trigger + pipelineTriggers([ + [ + $class : 'GhprbTrigger', + adminlist : 'seongtaemin', + cron : "*/15 * * * *", + permitAll : false, + useGitHubHooks: true, + triggerPhrase : '.*(test this|build this|deploy this).*', + gitHubAuthId : 'ed41fbed-bd5b-48dc-bd22-ac30bb535b1e', + extensions : [ [ - $class : 'GhprbTrigger', - adminlist : 'junoyoon', - cron: "*/15 * * * *", - permitAll : false, - useGitHubHooks: true, - triggerPhrase : '.*(test this|build this|deploy this).*', - gitHubAuthId : '0e0e7b1f-09c0-4380-bf6c-c07409bd9f99', // Jenkins 설정 > System > GitHub Pull Request Builder > Auth ID 에서 확인 가능 - extensions : [ - [ - $class : 'GhprbSimpleStatus', - commitStatusContext: 'jenkins', - showMatrixStatus : false - ] - ] + $class : 'GhprbSimpleStatus', + commitStatusContext: 'jenkins', + showMatrixStatus : false ] - ]) - ]) + ] + ] + ]) + ]) } } } - stage('Build') { steps { - // dir 은 디렉토리 이동 - dir("projects/spring-app") { - // withGradle 을 하면, Gradle 로그를 해석 - withGradle { - sh "./gradlew build" - } - } + dir("projects/spring-app") { + withGradle { + sh "./gradlew build" + } + } } } - } - // post 는 stage 마다 실행시킬 수도 있고, 전체 stages가 완료된 다음에 실행 시킬 수도 있음 post { always { scanForIssues tool: ktLint(pattern: '**/ktlint/**/*.xml') @@ -71,17 +63,17 @@ pipeline { success { script { - script { - if ((env.ghprbCommentBody ?: "").contains("deploy this")) { - archiveArtifacts artifacts: 'projects/spring-app/build/libs/*-SNAPSHOT.jar' - build( - job: 'pipeline-deploy', - parameters: [booleanParam(name: 'ARE_YOU_SURE', value: "true")], - wait: false, - propagate: false - ) - } - } + if ((env.ghprbCommentBody ?: "").contains("deploy this")) { + archiveArtifacts artifacts: 'projects/spring-app/build/libs/*-SNAPSHOT.jar' + build( + job: 'pipeline-deploy', + parameters: [ + booleanParam(name: 'ARE_YOU_SURE', value: true) + ], + wait: false, + propagate: false + ) + } } } } From 5b3a131be8f86aa75dfb123cba036297cfaf4ade Mon Sep 17 00:00:00 2001 From: seongtaemin Date: Wed, 11 Feb 2026 14:36:06 +0900 Subject: [PATCH 7/8] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index a03fd59..d736a71 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,3 @@ # fastcampus-jenkins # fastcampus-jenkins - From 96367992264d99018b25720e895659a32d49e5c7 Mon Sep 17 00:00:00 2001 From: seongtaemin Date: Wed, 11 Feb 2026 14:36:34 +0900 Subject: [PATCH 8/8] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index d736a71..fc7f097 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ # fastcampus-jenkins # fastcampus-jenkins + + +