Skip to content

CI/CD 통합

개요

모든 CI/CD 파이프라인에 푸시 알림과 승인 게이트를 추가. 모두 의존성 없이 오픈소스.


CLI

단일 파일 셸 도구. 모든 CI/CD, 크론 작업, 터미널에서 사용 가능. curl과 jq 필요.

설치

curl -fsSL https://raw.githubusercontent.com/qq418716640/botbell-cli/main/botbell -o /usr/local/bin/botbell
chmod +x /usr/local/bin/botbell
export BOTBELL_TOKEN="bt_your_token"

보내기

botbell send "Deploy succeeded ✅"

승인 게이트

botbell approve "Deploy to production?" --timeout 300

GitHub Action

GitHub 워크플로우에 BotBell 알림과 승인 게이트를 추가.

빌드 결과 알림

workflow.yml
- uses: botbell/notify-action@v1
  with:
    token: ${{ secrets.BOTBELL_TOKEN }}
    title: "✅ Build Passed"
    message: "#${{ github.run_number }} on ${{ github.ref_name }}"

배포 전 승인 게이트

workflow.yml
- uses: botbell/notify-action@v1
  with:
    token: ${{ secrets.BOTBELL_TOKEN }}
    mode: approve
    message: "Deploy #${{ github.run_number }} to production?"
    timeout: "1800"

Jenkins 공유 라이브러리

notify와 approve 두 메서드로 BotBell을 Jenkins 파이프라인에 통합.

설정: 글로벌 파이프라인 라이브러리로 Git 저장소를 지정하여 추가.

Jenkinsfile
@Library('botbell') _

pipeline {
    agent any
    environment {
        BOTBELL_TOKEN = credentials('botbell-token')
    }
    stages {
        stage('Deploy Approval') {
            steps {
                script {
                    botbell.approve(message: "Deploy to production?")
                }
            }
        }
    }
    post {
        success {
            script {
                botbell.notify(
                    title: "✅ Deploy Success",
                    message: "#${BUILD_NUMBER} deployed",
                )
            }
        }
    }
}