Skip to content

Commit c3edf9b

Browse files
committed
Adding a script to determine which test server to use as a backend for the current branch
1 parent 8f77f47 commit c3edf9b

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

.github/get-release-server.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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

0 commit comments

Comments
 (0)