How can I get a result similar to git for-each-ref on jenkins pipline? I have tried using git plugin for jenkins, but it seems to have only information about current branch. I have also tried using external groovy script, but it doesn't seem to have this ability. To my understanding, there is something on python called GitPython, but it requires a higher version of python than there is available on Jenkins. When I run the following
def branches = git for-each-ref --sort=committerdate refs/heads/ --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) (%(color:green)%(committerdate:relative)%(color:reset))'
I get
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
WorkflowScript: 21: expecting '}', found 'git for-each-ref --sort=committerdate refs/heads/ --format=' @ line 21, column 21.