This commit is contained in:
parent
6cfd279b0a
commit
f026612db2
@ -18,10 +18,10 @@ jobs:
|
||||
run: |
|
||||
for file in *.html; do
|
||||
if grep -q "$file" "$file"; then
|
||||
echo "File $file contains $file!"
|
||||
echo "File $file contains canonical tag with .html!"
|
||||
exit 1
|
||||
else
|
||||
echo "File $file does not contain $file!"
|
||||
echo "File $file is correct!"
|
||||
fi
|
||||
done
|
||||
|
||||
|
25
Jenkinsfile
vendored
25
Jenkinsfile
vendored
@ -1,25 +0,0 @@
|
||||
pipeline {
|
||||
agent any
|
||||
|
||||
stages {
|
||||
stage('Verify canonical tags') {
|
||||
steps {
|
||||
script {
|
||||
def fileExists = false
|
||||
def affectedFiles = sh(
|
||||
script: 'find . -type f -name "*.html" -exec grep -l "{}" "{}" \\;',
|
||||
returnStdout: true
|
||||
).trim()
|
||||
// If affectedFiles is not empty, set fileExists to true
|
||||
if (affectedFiles) {
|
||||
fileExists = true
|
||||
}
|
||||
if (fileExists) {
|
||||
mail bcc: '', body: 'Woodburn website canonical tages incorrect.', cc: '', from: 'noreply@woodburn.au', replyTo: 'noreply@woodburn.au', subject: 'Woodburn failed', to: 'jenkins@woodburn.au'
|
||||
error("Error: Found occurrences of file names with the .html extension in the following files:\n${affectedFiles}")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user