From baaf2d9ec8efaf38bd8367cd3f9a23220705f7bd Mon Sep 17 00:00:00 2001 From: gau1991 Date: Mon, 19 Jan 2015 12:00:22 +0530 Subject: [PATCH] Now using packages variables as package name and WPCLI is updated to v0.18.0 --- ee/cli/plugins/stack.py | 22 ++++++++++++++-------- ee/core/variables.py | 12 ++++++++++++ 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/ee/cli/plugins/stack.py b/ee/cli/plugins/stack.py index 103f96f7..69177dd7 100644 --- a/ee/cli/plugins/stack.py +++ b/ee/cli/plugins/stack.py @@ -166,7 +166,7 @@ class EEStackController(CementBaseController): nc.savef('/etc/nginx/nginx.conf') # Custom Nginx configuration by EasyEngine - data = dict(version='EasyEngine 3.0.1') + data = dict(version=EEVariables.ee_version) Log.debug(self, 'writting the nginx configration to ' 'file /etc/nginx/conf.d/ee-nginx.conf ') ee_nginx = open('/etc/nginx/conf.d/ee-nginx.conf', 'w') @@ -932,12 +932,14 @@ class EEStackController(CementBaseController): Log.debug(self, "Setting apt_packages variable for mail") apt_packages = apt_packages + EEVariables.ee_mail packages = packages + [["https://github.com/opensolutions/" - "ViMbAdmin/archive/3.0.10.tar.gz", + "ViMbAdmin/archive/{0}.tar.gz" + .format(EEVariables.ee_vimbadmin), "/tmp/vimbadmin.tar.gz", "ViMbAdmin"], ["https://github.com/roundcube/" "roundcubemail/releases/download/" - "1.0.4/roundcubemail-1.0.4.tar.gz", + "{0}/roundcubemail-{0}.tar.gz" + .format(EEVariables.ee_roundcube), "/tmp/roundcube.tar.gz", "Roundcube"]] @@ -975,8 +977,10 @@ class EEStackController(CementBaseController): Log.debug(self, "Setting packages variable for WPCLI") if not EEShellExec.cmd_exec(self, "which wp"): packages = packages + [["https://github.com/wp-cli/wp-cli/" - "releases/download/v0.17.1/" - "wp-cli.phar", "/usr/bin/wp", + "releases/download/v{0}/" + "wp-cli-{0}.phar" + "".format(EEVariables.ee_wp_cli), + "/usr/bin/wp", "WP_CLI"]] else: Log.info(self, "WP-CLI is allready installed") @@ -989,7 +993,8 @@ class EEStackController(CementBaseController): if self.app.pargs.adminer: Log.debug(self, "Setting packages variable for Adminer ") packages = packages + [["http://downloads.sourceforge.net/" - "adminer/adminer-4.1.0.php", + "adminer/adminer-{0}.php" + "".format(EEVariables.ee_adminer), "/var/www/22222/" "htdocs/db/adminer/index.php", "Adminer"]] @@ -1043,11 +1048,12 @@ class EEStackController(CementBaseController): EESwap.add(self) Log.debug(self, "Updating apt-cache") EEAptGet.update(self) - Log.debug(self, "Installing all apt_packages") + Log.debug(self, "Installing following: {0}" + .format(apt_packages)) print(apt_packages) EEAptGet.install(self, apt_packages) if len(packages): - Log.debug(self, "Downloading all packages") + Log.debug(self, "Downloading following: {0}".format(packages)) EEDownload.download(self, packages) Log.debug(self, "Calling post_pref") self.post_pref(apt_packages, packages) diff --git a/ee/core/variables.py b/ee/core/variables.py index 9077de93..0a3f2bc3 100644 --- a/ee/core/variables.py +++ b/ee/core/variables.py @@ -13,6 +13,16 @@ class EEVariables(): config = configparser.ConfigParser() config.read(os.path.expanduser("~")+'/.gitconfig') + # EasyEngine version + ee_version = "3.0.0" + + # EasyEngine packages versions + ee_wp_cli = "0.18.0" + ee_adminer = "4.1.0" + ee_roundcube = "1.0.4" + ee_vimbadmin = "3.0.10" + + # Current date and time of System ee_date = datetime.datetime.now().strftime('%d%b%Y%H%M%S') # EasyEngine core variables @@ -23,8 +33,10 @@ class EEVariables(): # Get FQDN of system ee_fqdn = socket.getfqdn() + # EasyEngien default webroot path ee_webroot = '/var/www/' + # PHP5 user ee_php_user = 'www-data' # Get git user name and EMail