woodburn/Jenkinsfile

25 lines
1021 B
Plaintext
Raw Normal View History

2023-07-13 17:19:45 +10:00
pipeline {
agent any
stages {
2023-07-13 18:59:59 +10:00
stage('Verify canonical tags') {
2023-07-13 17:19:45 +10:00
steps {
2023-07-13 18:08:03 +10:00
script {
2023-07-13 18:36:36 +10:00
def fileExists = false
def affectedFiles = sh(
2023-07-13 18:39:45 +10:00
script: 'find . -type f -name "*.html" -exec grep -l "{}" "{}" \\;',
2023-07-13 18:36:36 +10:00
returnStdout: true
).trim()
2023-07-13 18:08:03 +10:00
// If affectedFiles is not empty, set fileExists to true
if (affectedFiles) {
fileExists = true
}
2023-07-13 18:36:36 +10:00
if (fileExists) {
2023-07-13 19:45:15 +10:00
mail bcc: '', body: 'Woodburn website canonical tages incorrect.', cc: '', from: 'noreply@woodburn.au', replyTo: 'noreply@woodburn.au', subject: 'Woodburn failed', to: 'jenkins@woodburn.au'
2023-07-13 18:39:45 +10:00
error("Error: Found occurrences of file names with the .html extension in the following files:\n${affectedFiles}")
2023-07-13 18:08:03 +10:00
}
}
2023-07-13 17:19:45 +10:00
}
}
}
}