Created
June 24, 2020 01:17
-
-
Save lepffm/e9d47446321a8a07cc66d032ced3927b to your computer and use it in GitHub Desktop.
jenkinsfile paser example with modeldefinition plugin ( jenkins script console)
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
def str = ''' | |
pipeline { | |
agent any | |
stages { | |
stage('Hello') { | |
steps { | |
echo 'Hello World' | |
sh 'pwd' | |
} | |
} | |
} | |
} | |
''' | |
def pipdef = org.jenkinsci.plugins.pipeline.modeldefinition.parser.Converter.scriptToPipelineDef(str) | |
println 'stage='+pipdef.stages.stages.collect{it.name}.join() | |
return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment