Jenkins World

Sunday, 7 June 2020

Check if a file exists in jenkins pipeline

def exists = fileExists 'file'

if (exists) {
    echo 'Yes'
} else {
    echo 'No'
}

from : https://stackoverflow.com/questions/38534781/check-if-a-file-exists-in-jenkins-pipeline
Posted by Ryoko at 23:39
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

About Me

Ryoko
View my complete profile

Blog Archive

  • ▼  2020 (15)
    • ►  July (2)
    • ▼  June (9)
      • How do I make curl ignore the proxy?
      • Replace one substring for another string in shell ...
      • Loop through an array of strings in Bash?
      • In Bash, how can I check if a string begins with s...
      • Print array elements on separate lines in Bash?
      • Create array in loop from number of arguments
      • Run bash command on jenkins pipeline
      • Is there a better way to write this null check, an...
      • Check if a file exists in jenkins pipeline
    • ►  May (3)
    • ►  March (1)
Awesome Inc. theme. Powered by Blogger.