Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- Inbound
- dbeaver
- 파이참
- constructor
- pycharm
- 내부클래스
- has-a
- lambda
- node.js
- down casting
- shebang
- 얕은 복사
- Stream
- extends
- Java
- 셔뱅
- 깊은 복사
- public static final
- generic programming
- 스트림
- arraycopy
- singletone
- 엔드포인트
- access modifier
- identityHashCode
- Wrapper class
- 자바
- parameter group
- finalize
- Up Casting
Archives
- Today
- Total
٩(๑•̀o•́๑)و
17. Jenkins - Slack 연동 본문
1. Jenkins에서 slack 플러그인 설치
2. slack app directory에서 jenkins 추가
3. Jenkins 설정 변경
case1) 파이프라인이 freestyle로 작성된 경우,
이 경우는 빌드 환경 메뉴 안에 빌드 후 조치로 slack notification 옵션이 존재한다.
이제 빌드를 클릭하면, 정상적으로 빌드에 대한 노티를 확인할 수 있다.
case2) pipeline 으로 작성하여, 파이프라인 전체가 Jenkinsfile에 있을 경우,
이 경우는 동일하게 슬랙 노티에 대한 부분도 Jenkinsfile에 기재해야한다.
pipeline {
agent any
# 슬랙 채널 설정
environment {
SLACK_CHANNEL = '#jenkins'
}
stages {
# 파이프라인 시작시, 슬랙 노티 발송
stage('Start') {
steps {
slackSend (channel: SLACK_CHANNEL, color: '#FFFF00', message: "STARTED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})")
}
}
stage('git scm update') {
steps {
git url: 'https://github.com/11mia/docker-hello-world.git'
}
}
stage('build'){
steps {
nodejs(nodeJSInstallationName: 'nodejs'){
sh 'npm install'
sh 'npm run'
}
}
}
}
# 파이프라인 종료 후, 결과에 대한 노티 발송
post {
success {
slackSend (channel: SLACK_CHANNEL, color: '#00FF00', message: "SUCCESSFUL: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})")
}
failure {
slackSend (channel: SLACK_CHANNEL, color: '#FF0000', message: "FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})")
}
}
}
# 어디까지 했나
'Container Infrastructure > Side Project_202108' 카테고리의 다른 글
18. Prometheus, Grafana (0) | 2021.08.30 |
---|---|
16. Jenkins PipeLine 작성 (0) | 2021.08.30 |
15. Jenkins (0) | 2021.08.30 |
14. NFS 설치 (0) | 2021.08.29 |
13. Helm (0) | 2021.08.29 |