Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
configuration
Commits
9898062b
Commit
9898062b
authored
Aug 28, 2014
by
John Jarvis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adds a utility script to get rc branches
parent
f1407cd5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
68 additions
and
0 deletions
+68
-0
util/jenkins/get-rc-branches.sh
+68
-0
No files found.
util/jenkins/get-rc-branches.sh
0 → 100755
View file @
9898062b
#!/bin/bash
usage
()
{
prog
=
$(
basename
"
$0
"
)
cat
<<
EOF
This will clone a repo and look for release
candidate branches that will be returned as
a sorted list in json to be
parsed by the dynamic choice jenkins plugin
Usage:
$prog
-v add verbosity (set -x)
-n echo what will be done
-h this
-r repo to look in
-f filter string for branch list
Example:
$prog
-r https://github.com/edx/edx-platform -f "rc/"
EOF
}
while
getopts
"vnhr:f:"
opt
;
do
case
$opt
in
v
)
set
-x
shift
;;
h
)
usage
exit
0
;;
n
)
noop
=
"echo Would have run: "
shift
;;
r
)
repo
=
$OPTARG
;;
f
)
filter
=
$OPTARG
;;
esac
done
if
[[
-z
$repo
||
-z
$filter
]]
;
then
echo
'Need to specify a filter and a repo'
usage
exit
1
fi
repo_basename
=
$(
basename
"
$repo
"
)
cd
/var/tmp
if
[[
!
-d
$repo_basename
]]
;
then
$noop
git clone
"
$repo
"
"
$repo_basename
"
--mirror
else
$noop
cd
"/var/tmp/
$repo_basename
"
$noop
git fetch
fi
$noop
cd
"/var/tmp/
$repo_basename
"
if
[[
-z
$noop
]]
;
then
python
-c
'import sys, json; print json.dumps([line.lstrip().rstrip() for line in sys.stdin])'
< <
(
git branch
-a
|
grep
"
$filter
"
| sort
-r
| head
)
else
echo
"Would have checked for branches using filter
$filter
"
fi
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment