Created
July 8, 2014 18:54
-
-
Save samplenull/d8a566124ae76f7695ab to your computer and use it in GitHub Desktop.
Jenkins Extensible Choice Branch select
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 gettags = "git ls-remote [email protected]:mycomp/myrepo.git".execute() | |
def tags = [] | |
def t1 = [] | |
gettags.text.eachLine {tags.add(it)} | |
for(i in tags) { | |
def branch = i.split()[1].replaceAll('\\^\\{\\}', '').replaceAll('refs/heads/', '') | |
if (branch != 'HEAD'){ | |
t1.add(branch) | |
} | |
} | |
t1 = t1.unique() | |
return t1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment