0
모든 단계 및 상태 및 실패 및/또는 목록에 대한 전자 메일을 보내려합니다. 나는 try {}에서 코드를 래핑했고 어떤 실패라도 잡았다. 내 콘솔 출력에 전자 메일이 적절한 전자 메일로 전송되었지만 수신하지 못했다고 표시됩니다 ... Jenkins의 내 구성에서 Jenkins 위치, 전자 메일 알림 및 확장 전자 메일 알림을 설정했습니다. 전자 메일 알림이 제대로 작동하고 확장 전자 메일 알림에 동일한 자격 증명을 추가했음을 확인했습니다. 여기 내 콘솔 아웃 넣어 : 나는 이메일을 수신하지 못하는 이유젠킨스 단계에 대한 전자 메일 알림 설정 : 파이프 라인 스크립트
node('Dobby') {
try {
notifyBuild('STARTED')
stage('Checkout') {
checkout([$class: 'SubversionSCM',
additionalCredentials: [],
excludedCommitMessages: '',
excludedRegions: '',
excludedRevprop: '',
excludedUsers: 'buildbot',
filterChangelog: false,
ignoreDirPropChanges: false,
includedRegions: '',
locations: [[credentialsId: 'aPpr0pR1at3.CrDEnt1Al5.83',
depthOption: 'infinity',
ignoreExternalsOption: true,
local: '.',
remote: "http://jenkins.svn.link.edu/svn/my/repo"]],
workspaceUpdater: [$class: 'UpdateUpdater']])
}
stage('Build webApp') {
bat 'C:/"Program Files (x86)/Microsoft Visual Studio"/2017/Community/MSBuild/15.0/Bin/MSBuild.exe webApp/webApp.sln /m /p:VisualStudioVersion=15.0' //msbuild
}
stage('Test: Check if IIS webApp ON') {
bat 'C:/"Program Files (x86)"/NUnit.org/nunit-console/nunit3-console.exe SeleniumNunit/SeleniumNunit/bin/Debug/SeleniumNunit.dll'
}
} catch (e) {
// If there was an exception thrown, the build failed
currentBuild.result = "FAILED"
throw e
} finally {
// Success or failure, always send notifications
notifyBuild(currentBuild.result)
}
}
def notifyBuild(String buildStatus = 'STARTED') {
// build status of null means successful
buildStatus = buildStatus ?: 'SUCCESSFUL'
emailext(
to: '[email protected]',
subject: "${buildStatus}: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]'",
body: "details",
recipientProviders: [[$class: 'DevelopersRecipientProvider']]
)
}
당신은 어떤 이유를 식별 할 수 있습니다 아래에있는 내 코드를 참조하시기 바랍니다
Running on Dobby in D:Pipelinefolder
[Pipeline] {
[Pipeline] emailext
Sending email to: [email protected]
[Pipeline] stage
[Pipeline] { (Checkout)
[Pipeline] checkout
및
Results (nunit3) saved as TestResult.xml
[Pipeline] }
[Pipeline] // stage
[Pipeline] emailext
Sending email to: [email protected]
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
를?