Created
May 10, 2017 07:46
-
-
Save DEAD10CC/163db4d24568686a00f0c356b181e160 to your computer and use it in GitHub Desktop.
Preparation script for Jenkins Git branch selection
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
| #!/usr/bin/env bash | |
| export branches_filename=branches.properties | |
| export branches=${HOME}/${branches_filename} | |
| git fetch --all | |
| git remote prune origin | |
| echo -ne "branches=" > ${branches} | |
| git branch -r | awk '/origin\/feature|bugfix/{printf "%s,", $1 }' | head -n 1 >> ${branches} | |
| echo "" >> ${branches} | |
| scp ${branches} jenkins@slave-1:~/${branches_filename} |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Original credits: http://www.sourceprojects.org/jenkins-and-the-git-branch-selection