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