File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ if [ $# -ne 1 ]; then
4+ echo " Usage: $0 OC_VERSION"
5+ echo " eg: $0 r/16.x -> Returns the current correct server for r/16.x"
6+ exit 1
7+ fi
8+
9+ git clone https://github.com/opencast/opencast.git ~ /opencast
10+ cd ~ /opencast
11+
12+ # Get the list of *all* branches in the format remotes/origin/r/N.m
13+ # grep for r/N.x
14+ # then use cut to remove remotes/origin
15+ ary=( ` git branch -a | grep ' r/[0-9]*.x' | head -n 3 | cut -f 3- -d ' /' ` )
16+
17+ # Iterate through the array above.
18+ # If the script input matches the first item, spit out develop
19+ # If the script iput matches hte second item... etc
20+ # If it doesn't match anything, then don't say anything
21+ for i in " ${! ary[@]} "
22+ do
23+ if [[ " ${ary[$i]} " = " $1 " ]]; then
24+ if [[ $i -eq 0 ]]; then
25+ echo " develop.opencast.org"
26+ elif [[ $i -eq 1 ]]; then
27+ echo " stable.opencast.org"
28+ elif [[ $i -eq 2 ]]; then
29+ echo " legacy.opencast.org"
30+ fi
31+ fi
32+ done
You can’t perform that action at this time.
0 commit comments