Browse Source

Merge branch 'stable' into mail

bugfixes
Mitesh Shah 11 years ago
parent
commit
70d5dd9af3
  1. 3
      CHANGELOG.txt
  2. 3
      README.md
  3. 22
      bin/update
  4. 2
      config/bash_completion.d/ee
  5. 2
      config/easyengine/ee.conf
  6. 3
      src/lib/ee_lib_mysql_info.sh
  7. 18
      src/lib/ee_lib_variables.sh
  8. 6
      src/modules/site/create/ee_mod_setup_database.sh

3
CHANGELOG.txt

@ -1,3 +1,6 @@
v 2.0.2 - July 21, 2014
- Remote MySQL Support
v 2.0.1 - July 21, 2014
- Fixed wp-cli installation #289

3
README.md

@ -1,3 +1,6 @@
[![Stories in Ready](https://badge.waffle.io/rtcamp/easyengine.png?label=ready&title=Ready)](https://waffle.io/rtcamp/easyengine)
[![Stories in Progress](https://badge.waffle.io/rtcamp/easyengine.png?label=in%20progress&title=In%20Progress)](https://waffle.io/rtcamp/easyengine)
<img src="https://d3qt5vpr7p9rgn.cloudfront.net/wp-content/uploads/2013/08/easy-engine-logo-2-RS1.png" alt="EasyEngine Logo" align="right" />
[![Travis Build Status](https://travis-ci.org/rtCamp/easyengine.svg "Travis Build Status")] (https://travis-ci.org/rtCamp/easyengine)

22
bin/update

@ -143,7 +143,7 @@ if [[ $EE_CURRENT_VERSION < $EE_LATEST_VERSION ]]; then
|| ee_lib_error "Unable to copy EasyEngine (ee) man page, exit status = " $?
if [[ $EE_CURRENT_VERSION < 2.0.0 ]]; then
if [[ $EE_CURRENT_VERSION < 1.9.0 ]]; then
# EasyEngine (ee) config file
cp -av /etc/easyengine/ee.conf /etc/easyengine/ee.bak &>> $EE_UPDATE_LOG
cp -av /tmp/easyengine/config/easyengine/ee.conf /etc/easyengine/ &>> $EE_UPDATE_LOG \
@ -155,6 +155,9 @@ if [[ $EE_CURRENT_VERSION < $EE_LATEST_VERSION ]]; then
for ee_include in $(find /usr/local/lib/easyengine/ -iname "*.sh"); do
source $ee_include
done
# Avoid re-source and readonly errors
ee_source=1
# Lets modify the $EE_COMMAND_LOG value
# So all the logs write in $EE_UPDATE_LOG
@ -382,12 +385,15 @@ if [[ $EE_CURRENT_VERSION < $EE_LATEST_VERSION ]]; then
fi
fi
if [[ $EE_CURRENT_VERSION < 2.0.1 ]]; then
if [[ $EE_CURRENT_VERSION > 1.9.0 ]]; then
# Lets re-used our functions
# Include library
for ee_include in $(find /usr/local/lib/easyengine/ -iname "*.sh"); do
source $ee_include
done
if [ -z $ee_source ]; then
for ee_include in $(find /usr/local/lib/easyengine/ -iname "*.sh"); do
source $ee_include
done
fi
if [[ $EE_CURRENT_VERSION = 2.0.0 ]]; then
dpkg -l | grep php5-fpm &>> $EE_UPDATE_LOG
@ -399,6 +405,12 @@ if [[ $EE_CURRENT_VERSION < $EE_LATEST_VERSION ]]; then
# Install WP-CLI
ee_ven_install_wpcli
fi
# Update EasyEngine current version
EE_CURRENT_VERSION="2.0.1"
fi
if [[ $EE_CURRENT_VERSION = 2.0.1 ]]; then
sed -i 's/host =.*/grant-host = localhost/' /etc/easyengine/ee.conf
fi
fi

2
config/bash_completion.d/ee

@ -87,7 +87,7 @@ function EE_AUTO()
*)
if [ "$PREVIOUS2" = "create" ]; then
COMPREPLY=( $( compgen -W "--html --php --wp --wpsubdir --wpsubdomain" -- $CURRENT ) )
COMPREPLY=( $( compgen -W "--html --php --mysql --wp --wpsubdir --wpsubdomain" -- $CURRENT ) )
elif [ "$PREVIOUS2" = "delete" ]; then
COMPREPLY=( $( compgen -W "--db --all --files --no-prompt" -- $CURRENT ) )
fi

2
config/easyengine/ee.conf

@ -6,7 +6,7 @@
ip-address =
[mysql]
host = localhost
grant-host = localhost
db-name = false
db-user = false

3
src/lib/ee_lib_mysql_info.sh

@ -12,8 +12,7 @@ function ee_lib_mysql_info()
local ee_mysql_max_used_connections=$(mysql -e "show global status" | grep Max_used_connections | awk '{print($2)}')
ee_lib_echo
ee_lib_echo "MySQL ($ee_mysql_version):"
ee_lib_echo_escape "user\t\t\t\t \033[37m$EE_MYSQL_USER"
ee_lib_echo "MySQL ($ee_mysql_version) on $EE_MYSQL_HOST:"
ee_lib_echo_escape "port\t\t\t\t \033[37m$ee_mysql_port"
ee_lib_echo_escape "wait_timeout\t\t\t \033[37m$ee_mysql_wait_timeout"
ee_lib_echo_escape "interactive_timeout\t\t \033[37m$ee_mysql_interactive_timeout"

18
src/lib/ee_lib_variables.sh

@ -1,7 +1,7 @@
# Define global variables
# EasyEngine version
readonly EE_VERSION='2.0.1'
readonly EE_VERSION='2.0.2'
# WP-CLI version
readonly EE_WP_CLI_VERSION='0.16.0'
@ -39,17 +39,15 @@ else
fi
# Find out MySQL hostname
if [ -z $($EE_CONFIG_GET mysql.host) ]; then
if [ -z $(git config --file $HOME/.my.cnf client.host) ]; then
readonly EE_MYSQL_HOST=localhost
else
readonly EE_MYSQL_HOST=$($EE_CONFIG_GET mysql.host)
readonly EE_MYSQL_HOST=$(git config --file $HOME/.my.cnf client.host)
fi
# Find out MySQL login
if [ -f ~/.my.cnf ];then
readonly EE_MYSQL_USER=$(cat ~/.my.cnf | grep user | cut -d'=' -f2)
readonly EE_MYSQL_PASS=$(cat ~/.my.cnf | grep pass | cut -d'=' -f2 | sed -e 's/^"//' -e 's/"$//')
elif [ -f /root/.my.cnf ];then
readonly EE_MYSQL_USER=$(cat /root/.my.cnf | grep user | cut -d'=' -f2)
readonly EE_MYSQL_PASS=$(cat /root/.my.cnf | grep pass | cut -d'=' -f2 | sed -e 's/^"//' -e 's/"$//')
# Find out MySQL client-host to setup grants
if [ -z $($EE_CONFIG_GET mysql.grant-host) ]; then
readonly EE_MYSQL_GRANT_HOST=localhost
else
readonly EE_MYSQL_GRANT_HOST=$($EE_CONFIG_GET mysql.grant-host)
fi

6
src/modules/site/create/ee_mod_setup_database.sh

@ -51,16 +51,16 @@ function ee_mod_setup_database()
fi
# Create MySQL database
echo -e "EE_DB_NAME = $EE_DB_NAME \nEE_DB_USER = $EE_DB_USER \nEE_DB_PASS = $EE_DB_PASS" &>> $EE_COMMAND_LOG
echo -e "EE_DB_NAME = $EE_DB_NAME \nEE_DB_USER = $EE_DB_USER \nEE_DB_PASS = $EE_DB_PASS \nEE_MYSQL_HOST = $EE_MYSQL_HOST \nEE_MYSQL_GRANT_HOST = $EE_MYSQL_GRANT_HOST" &>> $EE_COMMAND_LOG
mysql -e "create database \`$EE_DB_NAME\`" \
|| ee_lib_error "Unable to create $EE_DB_NAME database, exit status = " $?
# Create MySQL User
mysql -e "create user '$EE_DB_USER'@'$EE_MYSQL_HOST' identified by '$EE_DB_PASS'" \
mysql -e "create user '$EE_DB_USER'@'$EE_MYSQL_GRANT_HOST' identified by '$EE_DB_PASS'" \
|| ee_lib_error "Unable to create $EE_DB_USER database user, exit status = " $?
# Grant permission
mysql -e "grant all privileges on \`$EE_DB_NAME\`.* to '$EE_DB_USER'@'$EE_MYSQL_HOST'" \
mysql -e "grant all privileges on \`$EE_DB_NAME\`.* to '$EE_DB_USER'@'$EE_MYSQL_GRANT_HOST'" \
|| ee_lib_error "Unable to grant privileges for $EE_DB_USER database user, exit status = " $?
mysql -e "flush privileges"
}

Loading…
Cancel
Save