Browse Source

ee site command finished

old-stable
Mitesh Shah 11 years ago
parent
commit
932c437381
  1. 9
      .travis.yml
  2. 55
      bin/easyengine
  3. 18
      bin/ee
  4. 2
      src/modules/site/ee_mod_site_edit.sh

9
.travis.yml

@ -41,8 +41,13 @@ script:
- sudo bash ee site create wpsubdirwpfc.com --wpsubdirectory --wpfc
- sudo bash ee site create wpsubdomainwpfc.com --wpfc --wpsubdom
- sudo cat /var/log/easyengine/*
- sudo mysql -e "show databases";
- sudo bash ee site delete wwpsubdomainwpsc.com --files --no-prompt
- sudo bash ee site delete wpwpfc.com --db --no-prompt
- sudo bash ee site delete wpsubdirwpfc.com --all --no-prompt
- sudo bash ee site delete wpsubdomainwpfc.com --no-prompt
- sudo mysql -e "show databases";
- sudo cat /var/log/easyengine/*
- sudo wp --allow-root --info

55
bin/easyengine

@ -235,7 +235,22 @@ elif [ "$EE_FIRST" = "site" ]; then
ee_lib_service nginx reload
# Git commit
ee_lib_git /etc/nginx/ "Enable website: $EE_DOMAIN"
ee_lib_git /etc/nginx/ "Disable website: $EE_DOMAIN"
elif [ "$EE_SECOND" = "edit" ]; then
# Check the website name is empty or not
EE_DOMAIN_CHECK=$EE_THIRD
ee_lib_check_domain
# Edit the NGINX configuration for $EE_DOMAIN
ee_mod_site_edit "$EE_THIRD"
if [ $(cd /etc/nginx; git status -s /etc/nginx/sites-available/$EE_DOMAIN | wc -l) -ne 0 ]; then
# Git commit
ee_lib_git /etc/nginx/ "Edit website: $EE_DOMAIN"
# Execute: service nginx reload
ee_lib_service nginx reload
fi
elif [ "$EE_SECOND" = "create" ]; then
# Configure variables
EE_DOMAIN_CHECK=$EE_THIRD
@ -383,6 +398,44 @@ elif [ "$EE_FIRST" = "site" ]; then
ee_lib_echo_info "Successfully created new website: http://$EE_WWW_DOMAIN"
fi
fi
elif [ "$EE_SECOND" = "delete" ]; then
# Check the website name is empty or not
EE_DELETE_ARGS=$EE_FOURTH
EE_DOMAIN_CHECK=$EE_THIRD
ee_lib_check_domain
# Use default whenever possible
# ee site delete example.com
# ee site delete example.com --no-prompt
if [ "$EE_DELETE_ARGS" = "" ]; then
EE_DELETE_ARGS="--all"
elif [ "$EE_DELETE_ARGS" = "--no-prompt" ]; then
EE_DELETE_ARGS="--all"
EE_FIFTH="--no-prompt"
fi
if [ "$EE_DELETE_ARGS" = "--db" ]; then
# Delete MySQL database
ee_mod_delete_database $EE_FIFTH
elif [ "$EE_DELETE_ARGS" = "--files" ]; then
# Delete webroot
ee_mod_delete_webroot $EE_FIFTH
elif [ "$EE_DELETE_ARGS" = "--all" ]; then
# Delete MySQL database
ee_mod_delete_database $EE_FIFTH
# Delete webroot
ee_mod_delete_webroot $EE_FIFTH
# Delete NGINX configuration file
ee_mod_delete_nginxconf $EE_FIFTH
# Git commit
ee_lib_git /etc/nginx/ "Delete website: $EE_DOMAIN"
# Execute: service nginx reload
ee_lib_service nginx reload
fi
fi
fi

18
bin/ee

@ -1617,28 +1617,28 @@ then
# Check SITENAME Is Empty Or Not
EE_DOMAIN_CHECK=$EE_THIRD
SITEDELETEARG=$4
EE_DELETE_ARGS=$4
ee_lib_check_domain
# USE DEFAULT WHEN POSSIBLES
if [ "$SITEDELETEARG" = "" ]
if [ "$EE_DELETE_ARGS" = "" ]
then
SITEDELETEARG=--all
EE_DELETE_ARGS=--all
fi
if [ "$SITEDELETEARG" = "--db" ]
if [ "$EE_DELETE_ARGS" = "--db" ]
then
# Remove Database
ee_mod_delete_database
elif [ "$SITEDELETEARG" = "--files" ]
elif [ "$EE_DELETE_ARGS" = "--files" ]
then
# Remove Webroot
ee_mod_delete_webroot
elif [ "$SITEDELETEARG" = "--all" ]
elif [ "$EE_DELETE_ARGS" = "--all" ]
then
# Remove All Database And Webroot
@ -1653,10 +1653,10 @@ then
# Take Nginx Configuration In Git Version Control
EE_GIT_DIR=/etc/nginx
EE_GIT_MESSAGE="Delete Website With $SITEDELETEARG Option: $EE_DOMAIN"
EE_GIT_MESSAGE="Delete Website With $EE_DELETE_ARGS Option: $EE_DOMAIN"
ee_lib_git_commit
elif [ "$SITEDELETEARG" = "--all---no-prompt" ]
elif [ "$EE_DELETE_ARGS" = "--all---no-prompt" ]
then
# Remove All Database And Webroot
@ -1671,7 +1671,7 @@ then
# Take Nginx Configuration In Git Version Control
EE_GIT_DIR=/etc/nginx
EE_GIT_MESSAGE="Delete Website With $SITEDELETEARG Option: $EE_DOMAIN"
EE_GIT_MESSAGE="Delete Website With $EE_DELETE_ARGS Option: $EE_DOMAIN"
ee_lib_git_commit
fi

2
src/modules/site/ee_mod_site_edit.sh

@ -2,5 +2,5 @@
function ee_mod_site_edit()
{
sensible-editor /etc/nginx/sites-available/$EE_DOMAIN $EE_VIM 2> /dev/null
sensible-editor /etc/nginx/sites-available/$EE_DOMAIN $1 2> /dev/null
}

Loading…
Cancel
Save