1. Jenkins Plugin 설치

Mattermost Notification 설치

Untitled

2. Mattermost Webhook 설정

Jenkins 알림 받을 채널 선택 및 채널 고정

Untitled

3. Jenkins System 설정

System → Global Mattermost Notifier Settings

Untitled

4. Jenkins Scripts 설정

아래는 예시 파일로 stages 아래 post 내 mattermostSend에 팀 에 알맞게 수정하여 사용

pipeline {
    agent any
    stages {
        stage('test') {
            steps {
             echo 'Jenkins Mattermost Connection' 
            }
        }
    }
    
    post {
        success {
        	script {
                mattermostSend (color: 'good', 
                message: "배포 성공   :gmqwhr_:   [우리팀URL]()",
                )
            }
        }
        failure {
        	script {
                mattermostSend (color: 'danger', 
                message: "배포 실패   :please1: "
                )
            }
        }
    }
}

5. 사용 결과

Untitled