-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdepsAllQuickManualUpgrade.sh
executable file
·50 lines (46 loc) · 1.67 KB
/
depsAllQuickManualUpgrade.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
#!/usr/bin/env bash
source pluginUpdatesOne.sh
# shellcheck disable=SC2154
if [ ${#versions[@]} -ne ${#pluginsArr[@]} ]; then
echo "Cannot retrieve latest plugin versions. Aborting execution..."
exit 0
fi
# shellcheck disable=SC2154
version_command="${versions[${pluginsArr[0]}]} ${versions[${pluginsArr[1]}]} ${versions[${pluginsArr[2]}]} ${versions[${pluginsArr[3]}]} ${versions[${pluginsArr[4]}]} ${versions[${pluginsArr[5]}]} ${versions[${pluginsArr[6]}]} ${versions[${pluginsArr[7]}]} ${versions[${pluginsArr[8]}]}"
branch_name="update-quick"
remote_name="origin"
cd ..
for item in *; do
if [[ -d "$item" ]]; then
cd "${item}" || exit
if [ -f Makefile ]; then
if grep -q "^deps-quick-update:" Makefile; then
echo "---*** Quick Update Makefile command found in $item ***---"
if git show-ref --verify --quiet refs/heads/master; then
git checkout master
fi
if git show-ref --verify --quiet refs/heads/main; then
git checkout main
fi
git pull
git fetch -p
make deps-quick-update "PARAMS=${version_command}"
if ! git diff --quiet || ! git diff --cached --quiet; then
if ! git ls-remote --exit-code --heads "$remote_name" "$branch_name"; then
git checkout -b $branch_name
git commit -am "quick updates"
git push -u origin $branch_name
if git show-ref --verify --quiet refs/heads/master; then
git checkout master
fi
if git show-ref --verify --quiet refs/heads/main; then
git checkout main
fi
fi
fi
fi
fi
cd ..
fi
done
cd project-signer || exit