[dd-ctl] Adapt update subcommand with all actions

This way existing installations can just run ./dd-ctl update and have a
working environment with the latest version.
mejoras_instalacion
Evilham 2022-08-08 11:58:04 +02:00
parent e3b1513725
commit 3fa0d48858
No known key found for this signature in database
GPG Key ID: AE3EE30D970886BF
1 changed files with 13 additions and 19 deletions

32
dd-ctl
View File

@ -49,7 +49,6 @@ help() {
Example: ./dd.ctl [operation] [arguments]
For a new installation, you usually will want to run:
./dd-ctl repo-update
./dd-ctl prerequisites
./dd-ctl securize
./dd-ctl all
@ -67,7 +66,7 @@ help() {
Generate .orig and .patch files to compare with upstream: ./dd-ctl genpatches
Rescan nextcloud data folders: ./dd-ctl nextcloud-scan
Install all prerequisites for installation: ./dd-ctl prerequisites
Update repository: ./dd-ctl repo-update [branch-name] (defaults to main)
Update DD to latest version: ./dd-ctl update [branch-name] (defaults to main)
Restart api if changes applied (development): ./dd-ctl restart-api
Update SAML certificates: ./dd-ctl saml
Set secure passwords in dd.conf: ./dd-ctl securize
@ -154,25 +153,20 @@ prerequisites_pwd(){
apt-get install -y dictionaries-common wamerican
}
update_repo(){
ddupdate(){
# Bring down services
./dd-ctl down
# Switch to latest version
git fetch && git checkout $REPO_BRANCH
git pull --rebase --autostash
# Needed for dd-apps submodules...
git submodule update --init --recursive
# Remove old repositories
for old_dir in isard-apps isard-sso; do
if [ -d "${old_dir}" ]; then
mkdir -p _old
mv "${old_dir}" "_old/${old_dir}_$(date +'%Y-%m-%d_%H-%M')"
fi
done
# Cleanup
for old_dir in isard-apps isard-sso; do
git submodule deinit "${old_dir}" || true
if [ -d "${old_dir}" ]; then
rmdir "${old_dir}"
fi
done
# Rebuild containers
./dd-ctl build
# Upgrade plugins
./dd-ctl upgrade-plugins
# Reapply customisations if needed
./dd-ctl customize
}
build_compose(){
@ -788,8 +782,8 @@ case "$OPERATION" in
prerequisites_docker
prerequisites_pwd
;;
repo-update)
update_repo
update|repo-update)
ddupdate
;;
reset-data|reset-1714)
cat <<-EOF