-
Notifications
You must be signed in to change notification settings - Fork 1
/
backdrop_step_5.sh
executable file
·46 lines (44 loc) · 1.25 KB
/
backdrop_step_5.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
#!/bin/bash
#
# script to Upgrade Backdrop and any modules on the Local Servers
#
# 2023-03-06 - Upgraded for bee from drush
#
PATH=$HOME/.local/bin:$HOME/bin:$PATH
pattern="$1"
result=0
for _dir in "${HOME}"/apps/*"${pattern}"; do
echo "${_dir}"
cd "${_dir}" || exit
FOLDER=$(basename "$PWD")
# echo "${FOLDER}"
./backupEssentials "${FOLDER}"
cd "${_dir}/web" || exit
# ------------------------------------------------------------
echo "Checking Upgrade Core is REALLY necessary"
mkdir "/dev/shm/core_tmp"
bee dl-core "/dev/shm/core_tmp"
read -ra latest_array <<< $(cat "/dev/shm/core_tmp/core/profiles/standard/standard.info" | grep 'version = 1')
echo "${latest_array[2]}"
if [ "${latest_array[2]}" != "${version}" ]; then
echo "Upgrading Core"
mv core "core_${version}"
mv /dev/shm/core_tmp/core .
else
echo "Core Upgrade Not Necessary"
fi
rm -fr /dev/shm/core_tmp
echo ""
echo "Upgrade Modules & Themes"
bee update -y
echo ""
bee updb -y
bee cc all
cd "${_dir}" || exit
./exportConfigSync
git add -A
git commit -am "Upgraded Backdrop Core & Modules as required"
done
echo "Now check that all is well with the site before deleting the core_${version} folder"
echo "THen merging and push to dev & prod"
exit ${result}