문서의 선택한 두 판 사이의 차이를 보여줍니다.
| 양쪽 이전 판 이전 판 다음 판 | 이전 판 | ||
|
ci:jenkins:pipeline [2018/11/28 14:01] kwon37xi [Git Branch Parameter] |
ci:jenkins:pipeline [2022/05/30 23:10] (현재) kwon37xi [lint] |
||
|---|---|---|---|
| 줄 8: | 줄 8: | ||
| * [[https:// | * [[https:// | ||
| * [[https:// | * [[https:// | ||
| + | |||
| + | ===== Snippet Generator ===== | ||
| + | * '' | ||
| + | |||
| + | ===== lint ===== | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | * [[ci: | ||
| + | |||
| + | ===== 기본 환경변수 ===== | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| ===== Build Parameter | ===== Build Parameter | ||
| 줄 74: | 줄 87: | ||
| ===== Git Branch Parameter ===== | ===== Git Branch Parameter ===== | ||
| * Git Branch 를 Job Parameter로 지정하고자 한다면, **Lightweight checkout**을 꺼야 한다. | * Git Branch 를 Job Parameter로 지정하고자 한다면, **Lightweight checkout**을 꺼야 한다. | ||
| - | * '' | + | * '' |
| <code groovy> | <code groovy> | ||
| stage(' | stage(' | ||
| 줄 81: | 줄 94: | ||
| changelog: true, | changelog: true, | ||
| url: ' | url: ' | ||
| - | branch: params.GIT_BRANCH?:' | + | branch: params.GIT_BRANCH |
| credentialsId: | credentialsId: | ||
| } | } | ||
| } | } | ||
| </ | </ | ||
| + | |||
| + | ===== Pipeline 에서 입력 값 받기 ===== | ||
| + | * [[https:// | ||
| + | * **입력 값은 '' | ||
| + | |||
| + | ===== JUnit 테스트 결과 메일/ | ||
| + | * [[https:// | ||
| + | * 호출하는 메소드가 금지돼 있어서 whitelist 에 추가 필요해 보임. Build 로그 메시지를 잘 보면, whitelist에 추가 시킬수 있는 admin 페이지로의('' | ||
| + | * 그 뒤에 계속해서 메소드 하나하나마다 추가하라고 나오므로 '' | ||
| + | <?xml version=' | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | </ | ||
| + | * 선언적 파이프라인 구성시에 최상단에('' | ||
| + | |||
| + | <code groovy> | ||
| + | import jenkins.model.* | ||
| + | import hudson.tasks.test.AbstractTestResultAction | ||
| + | |||
| + | String testResultMessage = ' | ||
| + | |||
| + | pipeline { | ||
| + | stages { | ||
| + | |||
| + | stage(' | ||
| + | steps { | ||
| + | junit ' | ||
| + | |||
| + | script { | ||
| + | AbstractTestResultAction testResultAction = currentBuild.rawBuild.getAction(AbstractTestResultAction.class) | ||
| + | if (testResultAction != null) { | ||
| + | def totalNumberOfTests = testResultAction.totalCount | ||
| + | def failedNumberOfTests = testResultAction.failCount | ||
| + | def failedDiff = testResultAction.failureDiffString | ||
| + | def skippedNumberOfTests = testResultAction.skipCount | ||
| + | def passedNumberOfTests = totalNumberOfTests - failedNumberOfTests - skippedNumberOfTests | ||
| + | testResultMessage = " | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | post { | ||
| + | failure { | ||
| + | slackSend(channel: | ||
| + | - 테스트 실패 : ${testResultMessage} | ||
| + | """ | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ===== parallel pipeline ===== | ||
| + | * [[https:// | ||
| + | * 여러 장비를 [[ci: | ||
| + | * [[https:// | ||
| + | |||
| + | ===== 참조 ===== | ||
| + | * [[https:// | ||