Add non interactive install and fix release number
This commit is contained in:
@@ -55,3 +55,4 @@ script:
|
||||
- sudo wo info || sudo tail -n50 /var/log/wo/wordops.log
|
||||
- sudo tree -L 2 /etc/nginx
|
||||
- sudo cat /var/www/wpredis.net/wp-config.php
|
||||
- sudo wo update --force || sudo tail -n50 /var/log/wo/wordops.log
|
||||
|
||||
@@ -12,6 +12,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
|
||||
### v3.9.5.2 - 2019-06-16
|
||||
|
||||
#### Added
|
||||
|
||||
- Non-interactive install/upgrade
|
||||
|
||||
#### Fixed
|
||||
|
||||
- WP_CACHE_KEY_SALT set twice
|
||||
|
||||
36
install
36
install
@@ -7,7 +7,7 @@
|
||||
# Copyright (c) 2019 - WordOps
|
||||
# This script is licensed under M.I.T
|
||||
# -------------------------------------------------------------------------
|
||||
# Version 3.9.5.1 - 2019-05-10
|
||||
# Version 3.9.5.2 - 2019-06-16
|
||||
# -------------------------------------------------------------------------
|
||||
readonly wo_version_old="2.2.3"
|
||||
readonly wo_version_new="3.9.5.2"
|
||||
@@ -70,6 +70,9 @@ while [ "$#" -gt 0 ]; do
|
||||
--travis)
|
||||
wo_travis="y"
|
||||
;;
|
||||
-s | --silent)
|
||||
wo_silent="y"
|
||||
;;
|
||||
*) # positional args
|
||||
;;
|
||||
esac
|
||||
@@ -193,21 +196,7 @@ wo_install_dep() {
|
||||
|
||||
locale-gen en
|
||||
} >> "$wo_install_log" 2>&1
|
||||
# Support PFS
|
||||
# if [ -f /etc/nginx/nginx.conf ]; then
|
||||
# # Replace previous ciphers
|
||||
# new_ciphers="EECDH+CHACHA20:EECDH+AESGCM:EECDH+AES"
|
||||
# sed -i "s/ssl_ciphers\ \(\"\|.\|'\)\(.*\)\(\"\|.\|'\);/ssl_ciphers \"$new_ciphers\";/" /etc/nginx/nginx.conf
|
||||
# # Change the TLS protocols
|
||||
# sed -i "s/ssl_protocols\ \(.*\);/ssl_protocols TLSv1.2;/" /etc/nginx/nginx.conf
|
||||
# fi
|
||||
|
||||
# # Let's Encrypt .well-known folder setup
|
||||
# if [ ! -d /var/www/html/.well-known/acme-challenge ]; then
|
||||
# mkdir -p /var/www/html/.well-known/acme-challenge
|
||||
# chown -R www-data:www-data /var/www/html /var/www/html/.well-known
|
||||
# chmod 750 /var/www/html /var/www/html/.well-known
|
||||
# fi
|
||||
}
|
||||
|
||||
###
|
||||
@@ -427,6 +416,9 @@ wo_install() {
|
||||
fi
|
||||
cd /tmp/WordOps || exit 1
|
||||
} >> "$wo_install_log" 2>&1
|
||||
if [ "$wo_silent" = "y" ] || [ "$wo_force_install" = "y" ]; then
|
||||
[ ! -f $HOME/.gitconfig ] && { bash -c 'echo -e "[user]\n\tname = $USER\n\temail = root@$HOSTNAME" > $HOME/.gitconfig'; }
|
||||
fi
|
||||
python3 setup.py install
|
||||
}
|
||||
|
||||
@@ -435,7 +427,7 @@ wo_upgrade_nginx() {
|
||||
{
|
||||
|
||||
if [ -d /var/lib/wo-backup/nginx ]; then
|
||||
tar -I pigz "$NGINX_BACKUP_FILE" /var/lib/wo-backup/nginx
|
||||
/bin/tar -I pigz "$NGINX_BACKUP_FILE" /var/lib/wo-backup/nginx
|
||||
rm -rf /var/lib/wo-backup/nginx
|
||||
fi
|
||||
# backup nginx conf
|
||||
@@ -464,7 +456,7 @@ wo_upgrade_nginx() {
|
||||
# import the respository key for updates
|
||||
apt-key add - < /tmp/nginx-wo.key
|
||||
rm -f /tmp/nginx-wo.key
|
||||
sudo apt-get update
|
||||
sudo apt-get update -qq
|
||||
|
||||
if [ -f /etc/nginx/common/release ]; then
|
||||
CHECK_NGINX_UPSTREAM_VERSION=$(grep "$wo_version_new" /etc/nginx/common/release)
|
||||
@@ -681,8 +673,12 @@ wo_tweak_kernel() {
|
||||
if [ -x /usr/local/bin/wo ]; then
|
||||
if ! {
|
||||
wo -v 2>&1 | grep $wo_version_new
|
||||
}; then
|
||||
} || [ "$wo_force_install" = "y" ]; then
|
||||
if [ -z "$wo_silent" ] && [ -z "$wo_force_install" ]; then
|
||||
echo -e "Update WordOps to $wo_version_new (y/n): " && read -r WO_ANSWER
|
||||
else
|
||||
WO_ANSWER="y"
|
||||
fi
|
||||
if [ "$WO_ANSWER" = "y" ] || [ "$WO_ANSWER" = "Y" ]; then
|
||||
wo_lib_echo "Installing wo dependencies " | tee -ai $wo_install_log
|
||||
wo_install_dep | tee -ai $wo_install_log
|
||||
@@ -717,7 +713,11 @@ if [ -x /usr/local/bin/wo ]; then
|
||||
else
|
||||
# 2 - Migration from EEv3
|
||||
if [ -x /usr/local/bin/ee ]; then
|
||||
if [ -z "$wo_silent" ] && [ -z "$wo_force_install" ]; then
|
||||
echo -e "Migrate from EasyEngine to WordOps (y/n): " && read -r WO_ANSWER
|
||||
else
|
||||
WO_ANSWER="y"
|
||||
fi
|
||||
if [ "$WO_ANSWER" = "y" ] || [ "$WO_ANSWER" = "Y" ]; then
|
||||
wo_lib_echo "Installing wo dependencies " | tee -ai $wo_install_log
|
||||
wo_install_dep | tee -ai $wo_install_log
|
||||
|
||||
@@ -19,15 +19,27 @@ class WOUpdateController(CementBaseController):
|
||||
aliases_only = True
|
||||
stacked_type = 'nested'
|
||||
description = ('update WordOps to latest version')
|
||||
usage = "wo update"
|
||||
arguments = [
|
||||
(['--force'],
|
||||
dict(help='Force WordOps update', action='store_true')),
|
||||
]
|
||||
usage = "wo update [options]"
|
||||
|
||||
@expose(hide=True)
|
||||
def default(self):
|
||||
if (not (self.app.pargs.force)):
|
||||
self.update_wordops
|
||||
if (self.app.pargs.force):
|
||||
self.force_update_wordops
|
||||
|
||||
filename = "woupdate" + time.strftime("%Y%m%d-%H%M%S")
|
||||
WODownload.download(self, [["https://raw.githubusercontent.com/"
|
||||
"WordOps/WordOps/master/install",
|
||||
"/tmp/{0}".format(filename),
|
||||
"update script"]])
|
||||
|
||||
@expose(hide=True)
|
||||
def update_wordops(self):
|
||||
try:
|
||||
Log.info(self, "updating WordOps, please wait...")
|
||||
os.system("bash /tmp/{0}".format(filename))
|
||||
@@ -38,6 +50,18 @@ class WOUpdateController(CementBaseController):
|
||||
Log.debug(self, str(e))
|
||||
Log.error(self, "WordOps update failed !")
|
||||
|
||||
@expose(hide=True)
|
||||
def force_update_wordops(self):
|
||||
try:
|
||||
Log.info(self, "updating WordOps, please wait...")
|
||||
os.system("bash /tmp/{0} --force".format(filename))
|
||||
except OSError as e:
|
||||
Log.debug(self, str(e))
|
||||
Log.error(self, "WordOps update failed !")
|
||||
except Exception as e:
|
||||
Log.debug(self, str(e))
|
||||
Log.error(self, "WordOps update failed !")
|
||||
|
||||
|
||||
def load(app):
|
||||
# register the plugin class.. this only happens if the plugin is enabled
|
||||
|
||||
Reference in New Issue
Block a user