1
에서 쉬 방법의 출력을 보내 내가 쉘 명령을 실행하는 Jenkinsfile을 가지고 있고 나는 slackSend
방법의 message:
로 그 sh
방법의 출력을 보내려고합니다.캡처하고 Jenkinsfile
다음과 같은 내용이 있지만 슬랙 채널에 메시지가 비어 있습니다. 내가 메시지 섹션에서 참조 할 수있는 방식으로 출력을 캡처하는 방법을 확실하지 않다 : 좀 더 연구 한 후
node {
checkout scm
stage 'run shell command'
def shell_command = sh "ls -l"
def shell_output = apply_cluster
stage 'notify slack-notification'
slackSend channel: '#slack-notifications', color: 'good', message: shell_output, teamDomain: 'company', token: env.SLACK_TOKEN
}
가능한 복제 [젠킨스 파이프 라인 플러그인 : 쉘을 실행하고 출력을 구문 분석] (http://stackoverflow.com/questions/36304131/jenkins-pipeline-plugin-execute-shell- 및 구문 분석 출력) – Pom12