diff --git a/deploys/ops-manual/05-deployment.md b/deploys/ops-manual/05-deployment.md index 43f7bd5..0bd560f 100644 --- a/deploys/ops-manual/05-deployment.md +++ b/deploys/ops-manual/05-deployment.md @@ -227,9 +227,12 @@ pipeline { stages { stage('Checkout') { steps { - slackSend channel: '#product_infra', color: '#439FE0', tokenCredentialId: 'slack-token', - message: "πŸš€ *react* λΉŒλ“œ μ‹œμž‘ (`${env.BRANCH_NAME}`)\n<${env.BUILD_URL}|λΉŒλ“œ #${env.BUILD_NUMBER}>" checkout scm + script { + env.GIT_COMMIT_MSG = sh(script: "git log -1 --pretty=format:'%s'", returnStdout: true).trim() + } + slackSend channel: '#product_infra', color: '#439FE0', tokenCredentialId: 'slack-token', + message: "πŸš€ *react* λΉŒλ“œ μ‹œμž‘ (`${env.BRANCH_NAME}`)\n${env.GIT_COMMIT_MSG}\n<${env.BUILD_URL}|λΉŒλ“œ #${env.BUILD_NUMBER}>" } } @@ -298,7 +301,7 @@ pipeline { when { branch 'main' } steps { slackSend channel: '#product_deploy', color: '#FF9800', tokenCredentialId: 'slack-token', - message: "πŸ”” *react* 운영 배포 승인 λŒ€κΈ° 쀑\nStage: https://stage.sam.it.kr\n<${env.BUILD_URL}input|μŠΉμΈν•˜λŸ¬ κ°€κΈ°>" + message: "πŸ”” *react* 운영 배포 승인 λŒ€κΈ° 쀑\n${env.GIT_COMMIT_MSG}\nStage: https://stage.sam.it.kr\n<${env.BUILD_URL}input|μŠΉμΈν•˜λŸ¬ κ°€κΈ°>" timeout(time: 24, unit: 'HOURS') { input message: 'Stage 확인 ν›„ 운영 배포λ₯Ό μ§„ν–‰ν•˜μ‹œκ² μŠ΅λ‹ˆκΉŒ?\nStage: https://stage.sam.it.kr', ok: '운영 배포 μ§„ν–‰' @@ -340,11 +343,11 @@ pipeline { post { success { slackSend channel: '#product_infra', color: 'good', tokenCredentialId: 'slack-token', - message: "βœ… *react* 배포 성곡 (`${env.BRANCH_NAME}`)\n<${env.BUILD_URL}|λΉŒλ“œ #${env.BUILD_NUMBER}>" + message: "βœ… *react* 배포 성곡 (`${env.BRANCH_NAME}`)\n${env.GIT_COMMIT_MSG}\n<${env.BUILD_URL}|λΉŒλ“œ #${env.BUILD_NUMBER}>" } failure { slackSend channel: '#product_infra', color: 'danger', tokenCredentialId: 'slack-token', - message: "❌ *react* 배포 μ‹€νŒ¨ (`${env.BRANCH_NAME}`)\n<${env.BUILD_URL}|λΉŒλ“œ #${env.BUILD_NUMBER}>" + message: "❌ *react* 배포 μ‹€νŒ¨ (`${env.BRANCH_NAME}`)\n${env.GIT_COMMIT_MSG}\n<${env.BUILD_URL}|λΉŒλ“œ #${env.BUILD_NUMBER}>" } } } @@ -410,9 +413,12 @@ pipeline { stages { stage('Checkout') { steps { - slackSend channel: '#product_infra', color: '#439FE0', tokenCredentialId: 'slack-token', - message: "πŸš€ *api* λΉŒλ“œ μ‹œμž‘ (`${env.BRANCH_NAME}`)\n<${env.BUILD_URL}|λΉŒλ“œ #${env.BUILD_NUMBER}>" checkout scm + script { + env.GIT_COMMIT_MSG = sh(script: "git log -1 --pretty=format:'%s'", returnStdout: true).trim() + } + slackSend channel: '#product_infra', color: '#439FE0', tokenCredentialId: 'slack-token', + message: "πŸš€ *api* λΉŒλ“œ μ‹œμž‘ (`${env.BRANCH_NAME}`)\n${env.GIT_COMMIT_MSG}\n<${env.BUILD_URL}|λΉŒλ“œ #${env.BUILD_NUMBER}>" } } @@ -452,7 +458,7 @@ pipeline { when { branch 'main' } steps { slackSend channel: '#product_deploy', color: '#FF9800', tokenCredentialId: 'slack-token', - message: "πŸ”” *api* 운영 배포 승인 λŒ€κΈ° 쀑\nStage API: https://stage-api.sam.it.kr\n<${env.BUILD_URL}input|μŠΉμΈν•˜λŸ¬ κ°€κΈ°>" + message: "πŸ”” *api* 운영 배포 승인 λŒ€κΈ° 쀑\n${env.GIT_COMMIT_MSG}\nStage API: https://stage-api.sam.it.kr\n<${env.BUILD_URL}input|μŠΉμΈν•˜λŸ¬ κ°€κΈ°>" timeout(time: 24, unit: 'HOURS') { input message: 'Stage 확인 ν›„ 운영 배포λ₯Ό μ§„ν–‰ν•˜μ‹œκ² μŠ΅λ‹ˆκΉŒ?\nStage API: https://stage-api.sam.it.kr', ok: '운영 배포 μ§„ν–‰' @@ -498,11 +504,11 @@ pipeline { post { success { slackSend channel: '#product_infra', color: 'good', tokenCredentialId: 'slack-token', - message: "βœ… *api* 배포 성곡 (`${env.BRANCH_NAME}`)\n<${env.BUILD_URL}|λΉŒλ“œ #${env.BUILD_NUMBER}>" + message: "βœ… *api* 배포 성곡 (`${env.BRANCH_NAME}`)\n${env.GIT_COMMIT_MSG}\n<${env.BUILD_URL}|λΉŒλ“œ #${env.BUILD_NUMBER}>" } failure { slackSend channel: '#product_infra', color: 'danger', tokenCredentialId: 'slack-token', - message: "❌ *api* 배포 μ‹€νŒ¨ (`${env.BRANCH_NAME}`)\n<${env.BUILD_URL}|λΉŒλ“œ #${env.BUILD_NUMBER}>" + message: "❌ *api* 배포 μ‹€νŒ¨ (`${env.BRANCH_NAME}`)\n${env.GIT_COMMIT_MSG}\n<${env.BUILD_URL}|λΉŒλ“œ #${env.BUILD_NUMBER}>" script { if (env.BRANCH_NAME == 'main') { sshagent(credentials: ['deploy-ssh-key']) { @@ -625,9 +631,12 @@ pipeline { stages { stage('Checkout') { steps { - slackSend channel: '#product_infra', color: '#439FE0', tokenCredentialId: 'slack-token', - message: "πŸš€ *mng* λΉŒλ“œ μ‹œμž‘ (`${env.BRANCH_NAME}`)\n<${env.BUILD_URL}|λΉŒλ“œ #${env.BUILD_NUMBER}>" checkout scm + script { + env.GIT_COMMIT_MSG = sh(script: "git log -1 --pretty=format:'%s'", returnStdout: true).trim() + } + slackSend channel: '#product_infra', color: '#439FE0', tokenCredentialId: 'slack-token', + message: "πŸš€ *mng* λΉŒλ“œ μ‹œμž‘ (`${env.BRANCH_NAME}`)\n${env.GIT_COMMIT_MSG}\n<${env.BUILD_URL}|λΉŒλ“œ #${env.BUILD_NUMBER}>" } } @@ -671,11 +680,11 @@ pipeline { post { success { slackSend channel: '#product_infra', color: 'good', tokenCredentialId: 'slack-token', - message: "βœ… *mng* 배포 성곡 (`${env.BRANCH_NAME}`)\n<${env.BUILD_URL}|λΉŒλ“œ #${env.BUILD_NUMBER}>" + message: "βœ… *mng* 배포 성곡 (`${env.BRANCH_NAME}`)\n${env.GIT_COMMIT_MSG}\n<${env.BUILD_URL}|λΉŒλ“œ #${env.BUILD_NUMBER}>" } failure { slackSend channel: '#product_infra', color: 'danger', tokenCredentialId: 'slack-token', - message: "❌ *mng* 배포 μ‹€νŒ¨ (`${env.BRANCH_NAME}`)\n<${env.BUILD_URL}|λΉŒλ“œ #${env.BUILD_NUMBER}>" + message: "❌ *mng* 배포 μ‹€νŒ¨ (`${env.BRANCH_NAME}`)\n${env.GIT_COMMIT_MSG}\n<${env.BUILD_URL}|λΉŒλ“œ #${env.BUILD_NUMBER}>" script { if (env.BRANCH_NAME == 'main') { sshagent(credentials: ['deploy-ssh-key']) {