Ich versuche, den Inhalt einiger bestimmter Protokolldateien im Nachrichtentext anzufügen, während die Ausführung eines Auftrags per E-Mail fehlgeschlagen ist.Anfügen von Protokolldateien in Benachrichtigungs-Mail im Jenkins-Pipeline-Workflow
stage("Checkout Fusion Source") {
parallel 'A': {
node('LinuxNode') {
try {
echo "Hello World(Linux)"
} catch (Exception e) {
mail body: 'Failed!',
subject: 'Job has failed in Linux!',
to: '[email protected]',
attachmentsPattern: '/path/to/log/file/log_linux.out'
}
mail body: 'Passed!',
subject: 'Job has passed in Linux!',
to: '[email protected]',
attachmentsPattern: '/path/to/log/file/log_linux.out'
}
}, 'B': {
node('AixNode') {
try {
echo "Hello World(AIX)"
} catch (Exception e) {
mail body: 'Failed!',
subject: 'Job has failed in AIX!',
to: '[email protected]',
attachmentsPattern: '/path/to/log/file/log_aix.out'
}
mail body: 'Passed!',
subject: 'Job has passed in AIX!',
to: '[email protected]',
attachmentsPattern: '/path/to/log/file/log_aix.out'
}
}
}
Diese attachmentsPattern
hilft nicht für das gleiche. P.S. Meine Jenkins Version ist 2.46.3
.