-
Notifications
You must be signed in to change notification settings - Fork 0
/
run-change-stable-testing-targets.sh
executable file
·97 lines (85 loc) · 1.98 KB
/
run-change-stable-testing-targets.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#!/bin/bash
#
# Steps:
# 1. Add "stable24" to all testing matrixes as server versions that contain "master"
# 2. If an "include" or "exclude" rule exists for "master" copy that for "stable24"
BRANCH=$1
VERSION=$2
if ! [[ "$BRANCH" ]]; then
echo "Missing target branch"
exit 1
fi
if ! [[ "$VERSION" ]]; then
echo "Missing nextcloud version"
exit 1
fi
STILL_SKIP="0"
SKIP_UNTIL=$3
if [[ "$SKIP_UNTIL" ]]; then
STILL_SKIP="1"
fi
cd Branched/
for dir in ./*/
do
dir=${dir%*/}
if [[ "$SKIP_UNTIL" = "${dir##*/}" ]]; then
STILL_SKIP="0"
fi
if [[ "$STILL_SKIP" = "0" ]]; then
echo "#"
echo "#"
echo -e "# \033[1;35m${dir##*/}\033[0m"
echo "#"
echo "#"
cd ${dir##*/}
../../change-stable-testing-targets.sh $BRANCH $VERSION
cd ..
else
echo -e "\033[1;35m🏳 Skipping ${dir##*/}\033[0m"
fi
done
cd ../
cd Stable/
for dir in ./*/
do
dir=${dir%*/}
if [[ "$SKIP_UNTIL" = "${dir##*/}" ]]; then
STILL_SKIP="0"
fi
if [[ "$STILL_SKIP" = "0" ]]; then
echo "#"
echo "#"
echo -e "# \033[1;35m${dir##*/}\033[0m"
echo "#"
echo "#"
cd ${dir##*/}
../../create-stable-branch.sh $BRANCH
../../change-stable-testing-targets.sh $BRANCH $VERSION
cd ..
else
echo -e "\033[1;35m🏳 Skipping ${dir##*/}\033[0m"
fi
done
cd ../
cd Multibranch/
for dir in ./*/
do
dir=${dir%*/}
if [[ "$SKIP_UNTIL" = "${dir##*/}" ]]; then
STILL_SKIP="0"
fi
if [[ "$STILL_SKIP" = "0" ]]; then
echo "#"
echo "#"
echo -e "# \033[1;35m${dir##*/}\033[0m"
echo "#"
echo "#"
cd ${dir##*/}
DEFAULT_BRANCH=$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@')
../../change-stable-testing-targets.sh $DEFAULT_BRANCH $VERSION
cd ..
else
echo -e "\033[1;35m🏳 Skipping ${dir##*/}\033[0m"
fi
done
cd ../