[ADD] script deployment: show and copy addons directory for docker prod
This commit is contained in:
parent
327870a175
commit
a66dd727fa
2 changed files with 39 additions and 0 deletions
28
script/deployment/copy_all_addons.sh
Executable file
28
script/deployment/copy_all_addons.sh
Executable file
|
|
@ -0,0 +1,28 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# © 2021-2024 TechnoLibre (http://www.technolibre.ca)
|
||||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||||
|
|
||||||
|
datetime=$(date +%Y-%m-%d_%H-%M-%S)
|
||||||
|
backup_dir="backup_$datetime"
|
||||||
|
mkdir -p "$backup_dir"
|
||||||
|
|
||||||
|
for dir in */; do
|
||||||
|
if [ -d "$dir/addons/addons" ]; then
|
||||||
|
mkdir -p "$backup_dir/$dir"
|
||||||
|
|
||||||
|
# Support when addons is a symlink, copy the target directory
|
||||||
|
if [ -L "$dir/addons/addons" ]; then
|
||||||
|
source_dir=$(readlink -f "$dir/addons/addons")
|
||||||
|
else
|
||||||
|
source_dir="$dir/addons/addons"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo $source_dir
|
||||||
|
|
||||||
|
# Copy directory of addons
|
||||||
|
cp -r "$source_dir" "$backup_dir/$dir/addons"
|
||||||
|
|
||||||
|
# Copy docker-compose.yml
|
||||||
|
cp "$dir/docker-compose.yml" "$backup_dir/$dir/"
|
||||||
|
fi
|
||||||
|
done
|
||||||
11
script/deployment/show_all_addons.sh
Executable file
11
script/deployment/show_all_addons.sh
Executable file
|
|
@ -0,0 +1,11 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# © 2021-2024 TechnoLibre (http://www.technolibre.ca)
|
||||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||||
|
|
||||||
|
for dir in */; do
|
||||||
|
if [ -d "$dir/addons/addons" ]; then
|
||||||
|
echo "Directory : $dir"
|
||||||
|
|
||||||
|
find "$dir/addons/addons" -type f -print
|
||||||
|
fi
|
||||||
|
done
|
||||||
Loading…
Reference in a new issue