Speed up install

This commit is contained in:
VirtuBox
2019-09-02 19:50:01 +02:00
parent 9a95af3cbb
commit 43f633e2af

113
install
View File

@@ -107,16 +107,16 @@ unset LANG
export LANG='en_US.UTF-8' export LANG='en_US.UTF-8'
export LC_ALL='C.UTF-8' export LC_ALL='C.UTF-8'
[ -z "$wo_travis" ] && {
apt-get update -qq
}
command_exists() { command_exists() {
command -v "$@" > /dev/null 2>&1 command -v "$@" > /dev/null 2>&1
} }
if ! command_exists curl; then if command_exists curl; then
apt-get -y install curl -qq if [ -z "$wo_travis" ]; then
apt-get update -qq &
else
apt-get update && apt-get -y install curl -qq
fi
fi fi
if [ -f ./setup.py ]; then if [ -f ./setup.py ]; then
@@ -823,43 +823,45 @@ else
fi fi
fi fi
wo_lib_echo "Installing wo dependencies " | tee -ai $wo_install_log wo_lib_echo "Installing wo dependencies " | tee -ai $wo_install_log
wo_install_dep wo_install_dep &
wo_timesync wo_timesync &
wo_lib_echo "Backing-up WO install" | tee -ai $wo_install_log wo_lib_echo "Backing-up WO install" | tee -ai $wo_install_log
wo_backup_wo wo_backup_wo &
secure_wo_db secure_wo_db &
wo_lib_echo "Installing WordOps " | tee -ai $wo_install_log wo_lib_echo "Installing WordOps " | tee -ai $wo_install_log
wo_clean wo_clean &
wait
if [ "$wo_travis" = "y" ]; then if [ "$wo_travis" = "y" ]; then
wo_install_travis wo_install_travis &
else else
if [ -f "$HOME/.gitconfig" ]; then if [ -f "$HOME/.gitconfig" ]; then
wo_install >> $wo_install_log 2>&1 wo_install >> $wo_install_log 2>&1 &
else else
wo_install wo_install
fi fi
fi fi
wo_update_latest wo_update_latest &
if [ ! -d /opt/acme/.sh ]; then if [ ! -d /opt/acme/.sh ]; then
wo_lib_echo "Updating acme.sh" | tee -ai $wo_install_log wo_lib_echo "Updating acme.sh" | tee -ai $wo_install_log
wo_install_acme_sh wo_install_acme_sh &
fi fi
wo_lib_echo "Applying Kernel tweaks" | tee -ai $wo_install_log wo_lib_echo "Applying Kernel tweaks" | tee -ai $wo_install_log
wo_tweak_kernel wo_tweak_kernel &
if [ ! -f /opt/wo-kernel.sh ]; then if [ ! -f /opt/wo-kernel.sh ]; then
wo_lib_echo "Adding systemd service tweak" | tee -ai $wo_install_log wo_lib_echo "Adding systemd service tweak" | tee -ai $wo_install_log
wo_systemd_tweak wo_systemd_tweak &
fi fi
if [ -x /usr/sbin/nginx ]; then if [ -x /usr/sbin/nginx ]; then
wo_nginx_tweak wo_nginx_tweak &
fi fi
if [ -d /etc/systemd/system/mariadb.service.d ]; then if [ -d /etc/systemd/system/mariadb.service.d ]; then
wo_mariadb_tweak wo_mariadb_tweak &
fi fi
wo_cheat_install wo_cheat_install &
wo_domain_suffix wo_domain_suffix &
wo_lib_echo "Running post-install steps " | tee -ai $wo_install_log wo_lib_echo "Running post-install steps " | tee -ai $wo_install_log
wo_update_wp_cli wo_update_wp_cli &
wait
else else
# 2 - Migration from EEv3 # 2 - Migration from EEv3
if [ -x /usr/local/bin/ee ]; then if [ -x /usr/local/bin/ee ]; then
@@ -870,47 +872,50 @@ else
fi fi
fi fi
wo_lib_echo "Installing wo dependencies " | tee -ai $wo_install_log wo_lib_echo "Installing wo dependencies " | tee -ai $wo_install_log
wo_install_dep >> $wo_install_log 2>&1 wo_install_dep >> $wo_install_log 2>&1 &
wo_timesync >> $wo_install_log 2>&1 wo_timesync >> $wo_install_log 2>&1 &
wo_lib_echo "Backing-up EE install" | tee -ai $wo_install_log wo_lib_echo "Backing-up EE install" | tee -ai $wo_install_log
wo_backup_ee >> $wo_install_log 2>&1 wo_backup_ee >> $wo_install_log 2>&1 &
wo_lib_echo "Removing EasyEngine cronjob" | tee -ai $wo_install_log wo_lib_echo "Removing EasyEngine cronjob" | tee -ai $wo_install_log
wo_remove_ee_cron >> $wo_install_log 2>&1 wo_remove_ee_cron >> $wo_install_log 2>&1 &
wo_lib_echo "Syncing WO database" | tee -ai $wo_install_log wo_lib_echo "Syncing WO database" | tee -ai $wo_install_log
wo_sync_db >> $wo_install_log 2>&1 wo_sync_db >> $wo_install_log 2>&1 &
secure_wo_db >> $wo_install_log 2>&1 secure_wo_db >> $wo_install_log 2>&1 &
wait
wo_lib_echo "Installing WordOps " | tee -ai $wo_install_log wo_lib_echo "Installing WordOps " | tee -ai $wo_install_log
if [ -f "$HOME/.gitconfig" ]; then if [ -f "$HOME/.gitconfig" ]; then
wo_install >> $wo_install_log 2>&1 wo_install >> $wo_install_log 2>&1 &
else else
wo_install | tee -ai $wo_install_log wo_install | tee -ai $wo_install_log
fi fi
if command_exists nginx; then if command_exists nginx; then
wo_lib_echo "Upgrading Nginx" | tee -ai $wo_install_log wo_lib_echo "Upgrading Nginx" | tee -ai $wo_install_log
wo_upgrade_nginx >> $wo_install_log 2>&1 wo_upgrade_nginx >> $wo_install_log 2>&1 &
fi fi
wo_update_latest >> $wo_install_log 2>&1 wait
wo_update_latest >> $wo_install_log 2>&1 &
wo_lib_echo "Installing acme.sh" | tee -ai $wo_install_log wo_lib_echo "Installing acme.sh" | tee -ai $wo_install_log
wo_install_acme_sh >> $wo_install_log 2>&1 wo_install_acme_sh >> $wo_install_log 2>&1 &
wo_lib_echo "Applying Kernel tweaks" | tee -ai $wo_install_log wo_lib_echo "Applying Kernel tweaks" | tee -ai $wo_install_log
wo_tweak_kernel >> $wo_install_log 2>&1 wo_tweak_kernel >> $wo_install_log 2>&1 &
if [ ! -f /opt/wo-kernel.sh ]; then if [ ! -f /opt/wo-kernel.sh ]; then
wo_lib_echo "Adding systemd service tweak" | tee -ai $wo_install_log wo_lib_echo "Adding systemd service tweak" | tee -ai $wo_install_log
wo_systemd_tweak wo_systemd_tweak &
fi fi
if command_exists nginx; then if command_exists nginx; then
wo_nginx_tweak wo_nginx_tweak &
fi fi
if [ -d /etc/systemd/system/mariadb.service.d ]; then if [ -d /etc/systemd/system/mariadb.service.d ]; then
wo_mariadb_tweak wo_mariadb_tweak &
fi fi
wo_domain_suffix >> $wo_install_log wo_domain_suffix >> $wo_install_log &
wo_lib_echo "Running post-install steps " | tee -ai $wo_install_log wo_lib_echo "Running post-install steps " | tee -ai $wo_install_log
{ {
wo_git_init wo_git_init &
wo_update_wp_cli wo_update_wp_cli &
wo_cheat_install wo_cheat_install &
} >> $wo_install_log } >> $wo_install_log
wait
wo_lib_echo "Cleaning-up EE previous install" | tee -ai $wo_install_log wo_lib_echo "Cleaning-up EE previous install" | tee -ai $wo_install_log
wo_clean_ee >> $wo_install_log wo_clean_ee >> $wo_install_log
else else
@@ -919,38 +924,40 @@ else
[ -z "$wo_travis" ] && { [ -z "$wo_travis" ] && {
wo_dist_upgrade >> $wo_install_log wo_dist_upgrade >> $wo_install_log
} }
wo_install_dep >> $wo_install_log wo_install_dep >> $wo_install_log &
wo_timesync >> $wo_install_log wo_timesync >> $wo_install_log &
wait
wo_lib_echo "Installing WordOps " | tee -ai $wo_install_log wo_lib_echo "Installing WordOps " | tee -ai $wo_install_log
if [ "$wo_travis" = "y" ]; then if [ "$wo_travis" = "y" ]; then
wo_install_travis | tee -ai $wo_install_log wo_install_travis | tee -ai $wo_install_log &
else else
if [ -f "$HOME/.gitconfig" ]; then if [ -f "$HOME/.gitconfig" ]; then
wo_install >> $wo_install_log 2>&1 wo_install >> $wo_install_log 2>&1 &
else else
wo_install | tee -ai $wo_install_log wo_install | tee -ai $wo_install_log
fi fi
fi fi
if [ "$ufw" = "y" ]; then if [ "$ufw" = "y" ]; then
wo_lib_echo "Configuring UFW" | tee -ai $wo_install_log wo_lib_echo "Configuring UFW" | tee -ai $wo_install_log
wo_ufw_setup wo_ufw_setup &
fi fi
wo_lib_echo "Applying Kernel tweaks" | tee -ai $wo_install_log wo_lib_echo "Applying Kernel tweaks" | tee -ai $wo_install_log
wo_tweak_kernel >> $wo_install_log 2>&1 wo_tweak_kernel >> $wo_install_log 2>&1 &
if [ ! -f /opt/wo-kernel.sh ]; then if [ ! -f /opt/wo-kernel.sh ]; then
wo_lib_echo "Adding systemd service tweak" | tee -ai $wo_install_log wo_lib_echo "Adding systemd service tweak" | tee -ai $wo_install_log
wo_systemd_tweak >> $wo_install_log 2>&1 wo_systemd_tweak >> $wo_install_log 2>&1 &
fi fi
wo_lib_echo "Installing acme.sh" | tee -ai $wo_install_log wo_lib_echo "Installing acme.sh" | tee -ai $wo_install_log
wo_lib_echo "Running post-install steps " | tee -ai $wo_install_log wo_lib_echo "Running post-install steps " | tee -ai $wo_install_log
{ {
wo_install_acme_sh wo_install_acme_sh &
secure_wo_db secure_wo_db &
wo_cheat_install wo_cheat_install &
wo_domain_suffix wo_domain_suffix &
wo_git_init wo_git_init &
wo_update_wp_cli wo_update_wp_cli &
} >> $wo_install_log } >> $wo_install_log
wait
fi fi
fi fi