Created
September 22, 2017 05:15
-
-
Save toshke/c22e5b924f061cb067ae895accb0da32 to your computer and use it in GitHub Desktop.
jenkins declarative pipeline in place sort
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
@NonCPS | |
def nonCpsTest() { | |
def list = [ | |
['CreationDate': '200'], | |
['CreationDate': '300'], | |
['CreationDate': '100'], | |
] | |
def rval = list.sort true, { it['CreationDate'] } | |
echo "Rval=$rval" | |
echo "List=$list" | |
} | |
pipeline { | |
agent any | |
stages { | |
stage('default'){ | |
steps { | |
script { | |
nonCpsTest() | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment