Last active
August 10, 2023 03:34
-
-
Save ftclausen/7e746ddf5d18247a9692897b944f26b1 to your computer and use it in GitHub Desktop.
Jenkins pipeline very simple mock steps to test things in a standalone script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For a more realistic simulation see https://stackoverflow.com/questions/50165079/mocking-jenkins-pipeline-steps | |
def readFile( Map args ) { | |
def file = args.file | |
def encoding = args.file ?: 'UTF-8' | |
return new File( file ).text | |
} | |
def sh( String command ) { | |
println command | |
} | |
def dir( String dir, Closure code ) { | |
println "cd $dir" | |
code.call() | |
} | |
def echo( String msg ) { | |
echo msg | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment