cd: html test 4
All checks were successful
nathanwoodburn/woodburn/pipeline/head This commit looks good
All checks were successful
nathanwoodburn/woodburn/pipeline/head This commit looks good
This commit is contained in:
parent
96a5de48a5
commit
625359566d
8
Jenkinsfile
vendored
8
Jenkinsfile
vendored
@ -4,13 +4,13 @@ pipeline {
|
|||||||
stages {
|
stages {
|
||||||
stage('Check HTML Files') {
|
stage('Check HTML Files') {
|
||||||
steps {
|
steps {
|
||||||
// Search for occurrences of "filename.html"
|
// Search for occurrences of the file name with the .html extension
|
||||||
script {
|
script {
|
||||||
def fileExists = false
|
def fileExists = false
|
||||||
|
|
||||||
// Find files with "filename.html" occurrences
|
// Find files with occurrences of the file name with the .html extension
|
||||||
def affectedFiles = sh(
|
def affectedFiles = sh(
|
||||||
script: 'find . -type f -name "*.html" -print0 | xargs -0 grep -l ".html"',
|
script: 'find . -type f -name "*.html" -exec grep -l "{}" "{}" \\;',
|
||||||
returnStdout: true
|
returnStdout: true
|
||||||
).trim()
|
).trim()
|
||||||
|
|
||||||
@ -21,7 +21,7 @@ pipeline {
|
|||||||
|
|
||||||
// Fail the build and display the affected files
|
// Fail the build and display the affected files
|
||||||
if (fileExists) {
|
if (fileExists) {
|
||||||
error("Error: Found occurrences of '.html' in the following files:\n${affectedFiles}")
|
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