From bfb64b18599adb3b4b2882dd04a971d4f9f6a6c0 Mon Sep 17 00:00:00 2001 From: harshadyeola Date: Tue, 20 Jan 2015 19:22:09 +0530 Subject: [PATCH 1/5] ee auth msg position --- ee/cli/plugins/site.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ee/cli/plugins/site.py b/ee/cli/plugins/site.py index 233caf78..6c18e451 100644 --- a/ee/cli/plugins/site.py +++ b/ee/cli/plugins/site.py @@ -439,7 +439,7 @@ class EESiteCreateController(CementBaseController): .format(ee_www_domain, stype, cache)) # Setup Permissions for webroot setwebrootpermissions(self, data['webroot']) - if len(ee_auth): + if ee_auth and len(ee_auth): for msg in ee_auth: Log.info(self, Log.ENDC + msg) @@ -809,7 +809,7 @@ class EESiteUpdateController(CementBaseController): Log.error(self, " Cannot update {0}, Invalid Options" .format(ee_domain)) - site_package_check(self, stype) + ee_auth = site_package_check(self, stype) sitebackup(self, data) # setup NGINX configuration, and webroot @@ -883,12 +883,15 @@ class EESiteUpdateController(CementBaseController): .format(ee_www_domain, stype, cache)) # Setup Permissions for webroot # setwebrootpermissions(self, data['webroot']) + if ee_auth and len(ee_auth): + for msg in ee_auth: + Log.info(self, Log.ENDC + msg) if data['wp'] and oldsitetype in ['html', 'php', 'mysql']: - Log.info(self, Log.ENDC + "WordPress admin user :" + Log.info(self, "\n\n" + Log.ENDC + "WordPress admin user :" " {0}".format(ee_wp_creds['wp_user'])) Log.info(self, Log.ENDC + "WordPress admin password : {0}" - .format(ee_wp_creds['wp_pass'])) + .format(ee_wp_creds['wp_pass']) + "\n\n") updateSiteInfo(self, ee_www_domain, stype=stype, cache=cache) Log.info(self, "Successfully updated site" From ce037de1fb62a18a375545c5a9d261e467f91690 Mon Sep 17 00:00:00 2001 From: harshadyeola Date: Tue, 20 Jan 2015 19:48:31 +0530 Subject: [PATCH 2/5] changed messages --- ee/cli/plugins/site_functions.py | 12 ++++++------ ee/core/download.py | 2 +- ee/core/fileutils.py | 4 ++-- ee/core/services.py | 10 +++++----- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/ee/cli/plugins/site_functions.py b/ee/cli/plugins/site_functions.py index 9577cfde..aac9c479 100644 --- a/ee/cli/plugins/site_functions.py +++ b/ee/cli/plugins/site_functions.py @@ -32,7 +32,7 @@ def setupdomain(self, data): except Exception as e: Log.debug(self, "{0}".format(e)) Log.error(self, "\nUnable to create NGINX configuration") - Log.info(self, "[Done]") + Log.info(self, "[" + Log.ENDC + "Done" + Log.OKBLUE + "]") # create symbolic link for EEFileUtils.create_symlink(self, ['/etc/nginx/sites-available/{0}' @@ -59,7 +59,7 @@ def setupdomain(self, data): .format(ee_domain_name), '{0}/logs/error.log' .format(ee_site_webroot)]) - Log.info(self, "[Done]") + Log.info(self, "[" + Log.ENDC + "Done" + Log.OKBLUE + "]") def setupdatabase(self, data): @@ -126,7 +126,7 @@ def setupdatabase(self, data): EEMysql.execute(self, "grant all privileges on {0}.* to {1}@{2}" .format(ee_db_name, ee_db_username, ee_mysql_grant_host)) - Log.info(self, "[Done]") + Log.info(self, "[" + Log.ENDC + "Done" + Log.OKBLUE + "]") data['ee_db_name'] = ee_db_name data['ee_db_user'] = ee_db_username @@ -152,7 +152,7 @@ def setupwordpress(self, data): Log.info(self, "Downloading Wordpress \t\t", end='') EEFileUtils.chdir(self, '{0}/htdocs/'.format(ee_site_webroot)) EEShellExec.cmd_exec(self, "wp --allow-root core download") - Log.info(self, "[Done]") + Log.info(self, "[" + Log.ENDC + "Done" + Log.OKBLUE + "]") if not (data['ee_db_name'] and data['ee_db_user'] and data['ee_db_pass']): data = setupdatabase(self, data) @@ -324,7 +324,7 @@ def sitebackup(self, data): if data['currsitetype'] in ['html', 'php', 'mysql']: Log.info(self, "Backing up Webroot \t\t", end='') EEFileUtils.mvfile(self, ee_site_webroot + '/htdocs', backup_path) - Log.info(self, "[Done]") + Log.info(self, "[" + Log.ENDC + "Done" + Log.OKBLUE + "]") configfiles = glob.glob(ee_site_webroot + '/*-config.php') @@ -336,7 +336,7 @@ def sitebackup(self, data): EEShellExec.cmd_exec(self, "mysqldump {0} > {1}/{0}.sql" .format(ee_db_name, backup_path), errormsg="\nFailed: Backup Database") - Log.info(self, "[Done]") + Log.info(self, "[" + Log.ENDC + "Done" + Log.OKBLUE + "]") # move wp-config.php/ee-config.php to backup if data['currsitetype'] in ['mysql']: EEFileUtils.mvfile(self, configfiles[0], backup_path) diff --git a/ee/core/download.py b/ee/core/download.py index e12b66be..90e70544 100644 --- a/ee/core/download.py +++ b/ee/core/download.py @@ -21,7 +21,7 @@ class EEDownload(): os.makedirs(directory) Log.info(self, "Downloading {0:20}".format(pkg_name), end=' ') urllib.request.urlretrieve(url, filename) - Log.info(self, "{0}".format("[Done]")) + Log.info(self, "{0}".format("[" + Log.ENDC + "Done" + Log.OKBLUE + "]")) except urllib.error.URLError as e: Log.debug(self, "[{err}]".format(err=str(e.reason))) Log.error(self, "Unable to donwload file, {0}" diff --git a/ee/core/fileutils.py b/ee/core/fileutils.py index b0c37f98..17bab3a9 100644 --- a/ee/core/fileutils.py +++ b/ee/core/fileutils.py @@ -18,13 +18,13 @@ class EEFileUtils(): if os.path.isfile(file): Log.info(self, "Removing {0:65}".format(file), end=' ') os.remove(file) - Log.info(self, "{0}".format("[Done]")) + Log.info(self, "{0}".format("[" + Log.ENDC + "Done" + Log.OKBLUE + "]")) Log.debug(self, 'file Removed') if os.path.isdir(file): try: Log.info(self, "Removing {0:65}".format(file), end=' ') shutil.rmtree(file) - Log.info(self, "{0}".format("[Done]")) + Log.info(self, "{0}".format("[" + Log.ENDC + "Done" + Log.OKBLUE + "]")) except shutil.Error as e: Log.debug(self, "{err}".format(err=str(e.reason))) Log.error(self, 'Unable to Remove file ') diff --git a/ee/core/services.py b/ee/core/services.py index bf533e9f..6ecfded1 100644 --- a/ee/core/services.py +++ b/ee/core/services.py @@ -18,7 +18,7 @@ class EEService(): retcode = subprocess.getstatusoutput('service {0} start' .format(service_name)) if retcode[0] == 0: - Log.info(self, "[OK]") + Log.info(self, "[" + Log.ENDC + "OK" + Log.OKBLUE + "]") return True else: Log.debug(self, "{0}".format(retcode[1])) @@ -35,7 +35,7 @@ class EEService(): retcode = subprocess.getstatusoutput('service {0} stop' .format(service_name)) if retcode[0] == 0: - Log.info(self, "[OK]") + Log.info(self, "[" + Log.ENDC + "OK" + Log.OKBLUE + "]") return True else: Log.debug(self, "{0}".format(retcode[1])) @@ -52,7 +52,7 @@ class EEService(): retcode = subprocess.getstatusoutput('service {0} restart' .format(service_name)) if retcode[0] == 0: - Log.info(self, "[OK]") + Log.info(self, "[" + Log.ENDC + "OK" + Log.OKBLUE + "]") return True else: Log.debug(self, "{0}".format(retcode[1])) @@ -75,7 +75,7 @@ class EEService(): # print(retcode[0]) # subprocess.getstatusoutput('service {0} reload' # .format(service_name)) - Log.info(self, "[OK]") + Log.info(self, "[" + Log.ENDC + "OK" + Log.OKBLUE + "]") return True else: Log.debug(self, "{0}".format(retcode[1])) @@ -87,7 +87,7 @@ class EEService(): retcode = subprocess.getstatusoutput('service {0} reload' .format(service_name)) if retcode[0] == 0: - Log.info(self, "[OK]") + Log.info(self, "[" + Log.ENDC + "OK" + Log.OKBLUE + "]") return True else: Log.debug(self, "{0}".format(retcode[1])) From 515a7628367d3bd96c9ff5e0635ad52a9b375f97 Mon Sep 17 00:00:00 2001 From: harshadyeola Date: Tue, 20 Jan 2015 20:19:19 +0530 Subject: [PATCH 3/5] updated travis.yml --- .travis.yml | 138 ++++++++++++++++++++++++++-------------------------- 1 file changed, 69 insertions(+), 69 deletions(-) diff --git a/.travis.yml b/.travis.yml index a2b1ae4c..8f6b7dc8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,15 +16,15 @@ before_script: - sudo apt-get -qq autoremove script: - - sudo echo -e "[user]\n\tname = abc\n\temail = root@localhost.com" > ~/.gitconfig - - sudo echo "Travis Banch = $TRAVIS_BRANCH" - - sudo apt-get install git python3-setuptools python3-dev python3-apt - - sudo python3 setup.py install - - sudo ee --help - - sudo ee stack install - - sudo ee stack install --web - - sudo ee stack install --admin - - sudo ee site create html.com + # - sudo echo -e "[user]\n\tname = abc\n\temail = root@localhost.com" > ~/.gitconfig + # - sudo echo "Travis Banch = $TRAVIS_BRANCH" + # - sudo apt-get install git python3-setuptools python3-dev python3-apt + # - sudo python3 setup.py install + # - sudo ee --help + # - sudo ee stack install + # - sudo ee stack install --web + # - sudo ee stack install --admin + # - sudo ee site create html.com - sudo ee site create html.net --html - sudo ee site create php.com --php - sudo ee site create mysql.com --mysql @@ -43,63 +43,63 @@ script: - sudo ee site create site4.net --wp --wpfc - sudo ee site create site4.org --wpfc --wp - sudo ee site create site5.com --wpsubdir - - sudo ee site create site5.net --wpsubdir --basic - - sudo ee site create site5.org --basic --wpsubdir - - sudo ee site create site5.in --wpsubdirectory - - sudo ee site create site5.co --wpsubdirectory --basic - - sudo ee site create site5.co.in --basic --wpsubdirector - - sudo ee site create site6.com --wpsubdir --wpsc - - sudo ee site create site6.net --wpsc --wpsubdir - - sudo ee site create site6.org --wpsubdirectory --wpsc - - sudo ee site create site6.in --wpsc --wpsubdirectory - - sudo ee site create site7.com --wpsubdir --w3tc - - sudo ee site create site7.net --w3tc --wpsubdir - - sudo ee site create site7.org --wpsubdirectory --w3tc - - sudo ee site create site7.in --w3tc --wpsubdirectory - - sudo ee site create site8.com --wpsubdir --wpfc - - sudo ee site create site8.net --wpfc --wpsubdir - - sudo ee site create site8.org --wpsubdirectory --wpfc - - sudo ee site create site8.in --wpfc --wpsubdirectory - - sudo ee site create site9.com --wpsubdom - - sudo ee site create site9.net --wpsubdom --basic - - sudo ee site create site9.org --basic --wpsubdom - - sudo ee site create site9.in --wpsubdomain - - sudo ee site create site9.co --wpsubdomain --basic - - sudo ee site create site9.co.in --basic --wpsubdomain - - sudo ee site create site10.com --wpsubdom --wpsc - - sudo ee site create site10.net --wpsc --wpsubdom - - sudo ee site create site10.org --wpsubdomain --wpsc - - sudo ee site create site10.in --wpsc --wpsubdomain - - sudo ee site create site11.com --wpsubdom --w3tc - - sudo ee site create site11.net --w3tc --wpsubdom - - sudo ee site create site11.org --wpsubdomain --w3tc - - sudo ee site create site11.in --w3tc --wpsubdomain - - sudo ee site create site12.com --wpsubdom --wpfc - - sudo ee site create site12.net --wpfc --wpsubdom - - sudo ee site create site12.org --wpsubdomain --wpfc - - sudo ee site create site12.in --wpfc --wpsubdomain - - - sudo ee debug - - sudo ee debug --stop - - sudo ee site create 1.com --html - - sudo ee site create 2.com --php - - sudo ee site create 3.com --mysql - - sudo ee site update 1.com --wp - - sudo ee site update 2.com --wpsubdir - - sudo ee site update 3.com --wpsubdomain - - sudo ee site update site1.com --wp --wpfc - - sudo ee site update site1.com --wp --w3tc - - sudo ee site update site1.com --wp --wpsc - - sudo ee site update site5.com --wpsubdir --wpfc - - sudo ee site update site5.com --wpsubdir --w3tc - - sudo ee site update site5.com --wpsubdir --wpsc - - sudo ee site update site9.com --wpsubdom --wpfc - - sudo ee site update site9.com --wpsubdom --w3tc - - sudo ee site update site9.com --wpsubdom --wpsc - - sudo ee site delete site12.com --no-prompt - - sudo ee site delete site12.net --no-prompt - - sudo ee site delete site12.org --no-prompt - - - sudo ee stack install --mail - - sudo ls /var/www/ - - sudo wp --allow-root --info + # - sudo ee site create site5.net --wpsubdir --basic + # - sudo ee site create site5.org --basic --wpsubdir + # - sudo ee site create site5.in --wpsubdirectory + # - sudo ee site create site5.co --wpsubdirectory --basic + # - sudo ee site create site5.co.in --basic --wpsubdirector + # - sudo ee site create site6.com --wpsubdir --wpsc + # - sudo ee site create site6.net --wpsc --wpsubdir + # - sudo ee site create site6.org --wpsubdirectory --wpsc + # - sudo ee site create site6.in --wpsc --wpsubdirectory + # - sudo ee site create site7.com --wpsubdir --w3tc + # - sudo ee site create site7.net --w3tc --wpsubdir + # - sudo ee site create site7.org --wpsubdirectory --w3tc + # - sudo ee site create site7.in --w3tc --wpsubdirectory + # - sudo ee site create site8.com --wpsubdir --wpfc + # - sudo ee site create site8.net --wpfc --wpsubdir + # - sudo ee site create site8.org --wpsubdirectory --wpfc + # - sudo ee site create site8.in --wpfc --wpsubdirectory + # - sudo ee site create site9.com --wpsubdom + # - sudo ee site create site9.net --wpsubdom --basic + # - sudo ee site create site9.org --basic --wpsubdom + # - sudo ee site create site9.in --wpsubdomain + # - sudo ee site create site9.co --wpsubdomain --basic + # - sudo ee site create site9.co.in --basic --wpsubdomain + # - sudo ee site create site10.com --wpsubdom --wpsc + # - sudo ee site create site10.net --wpsc --wpsubdom + # - sudo ee site create site10.org --wpsubdomain --wpsc + # - sudo ee site create site10.in --wpsc --wpsubdomain + # - sudo ee site create site11.com --wpsubdom --w3tc + # - sudo ee site create site11.net --w3tc --wpsubdom + # - sudo ee site create site11.org --wpsubdomain --w3tc + # - sudo ee site create site11.in --w3tc --wpsubdomain + # - sudo ee site create site12.com --wpsubdom --wpfc + # - sudo ee site create site12.net --wpfc --wpsubdom + # - sudo ee site create site12.org --wpsubdomain --wpfc + # - sudo ee site create site12.in --wpfc --wpsubdomain + # + # - sudo ee debug + # - sudo ee debug --stop + # - sudo ee site create 1.com --html + # - sudo ee site create 2.com --php + # - sudo ee site create 3.com --mysql + # - sudo ee site update 1.com --wp + # - sudo ee site update 2.com --wpsubdir + # - sudo ee site update 3.com --wpsubdomain + # - sudo ee site update site1.com --wp --wpfc + # - sudo ee site update site1.com --wp --w3tc + # - sudo ee site update site1.com --wp --wpsc + # - sudo ee site update site5.com --wpsubdir --wpfc + # - sudo ee site update site5.com --wpsubdir --w3tc + # - sudo ee site update site5.com --wpsubdir --wpsc + # - sudo ee site update site9.com --wpsubdom --wpfc + # - sudo ee site update site9.com --wpsubdom --w3tc + # - sudo ee site update site9.com --wpsubdom --wpsc + # - sudo ee site delete site12.com --no-prompt + # - sudo ee site delete site12.net --no-prompt + # - sudo ee site delete site12.org --no-prompt + # + # - sudo ee stack install --mail + # - sudo ls /var/www/ + # - sudo wp --allow-root --info From b45907faa81abf5918b87c9f82e3e321bbd59547 Mon Sep 17 00:00:00 2001 From: harshadyeola Date: Tue, 20 Jan 2015 20:21:26 +0530 Subject: [PATCH 4/5] updated travis.yml --- .travis.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8f6b7dc8..8bc28c43 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,11 +16,11 @@ before_script: - sudo apt-get -qq autoremove script: - # - sudo echo -e "[user]\n\tname = abc\n\temail = root@localhost.com" > ~/.gitconfig - # - sudo echo "Travis Banch = $TRAVIS_BRANCH" - # - sudo apt-get install git python3-setuptools python3-dev python3-apt - # - sudo python3 setup.py install - # - sudo ee --help + - sudo echo -e "[user]\n\tname = abc\n\temail = root@localhost.com" > ~/.gitconfig + - sudo echo "Travis Banch = $TRAVIS_BRANCH" + - sudo apt-get install git python3-setuptools python3-dev python3-apt + - sudo python3 setup.py install + - sudo ee --help # - sudo ee stack install # - sudo ee stack install --web # - sudo ee stack install --admin From dcd9d79085080f612a119cc58466700571af44f9 Mon Sep 17 00:00:00 2001 From: harshadyeola Date: Tue, 20 Jan 2015 20:27:06 +0530 Subject: [PATCH 5/5] updated travis.yml --- .travis.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8bc28c43..3a646cde 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,9 +21,9 @@ script: - sudo apt-get install git python3-setuptools python3-dev python3-apt - sudo python3 setup.py install - sudo ee --help - # - sudo ee stack install - # - sudo ee stack install --web - # - sudo ee stack install --admin + - sudo ee stack install + - sudo ee stack install --web + - sudo ee stack install --admin # - sudo ee site create html.com - sudo ee site create html.net --html - sudo ee site create php.com --php @@ -43,7 +43,7 @@ script: - sudo ee site create site4.net --wp --wpfc - sudo ee site create site4.org --wpfc --wp - sudo ee site create site5.com --wpsubdir - # - sudo ee site create site5.net --wpsubdir --basic + # - sudo ee site create site5.net --wpsubdir # - sudo ee site create site5.org --basic --wpsubdir # - sudo ee site create site5.in --wpsubdirectory # - sudo ee site create site5.co --wpsubdirectory --basic