def start(action='rebuild'): if action == 'rebuild': command = 'up -d --build' else: command = action myrun( "cd %s && SRCDIR=. DATADIR=%s HTTPPORT=%s HTTPPORTPMA=8888 docker-compose -p %s %s" % (env.deploy_dir, env.data_dir, env.http_port, env.project, command))
def update_cron(): #myrun("cd %s/cron && chmod +x sync*" % env.deploy_dir ) process_template("cron-sample", "cron-tab", { 'DEPLOY_DIR': env.deploy_dir, 'HOME_DIR': env.home }) put("cron-tab", "%s/cron/cron-tab" % env.deploy_dir) myrun("crontab %s/cron/cron-tab" % env.deploy_dir)
def prepare_conf(password="******"): myrun( "ln -sf %s/wp-content/plugins/memcached-redux/object-cache.php %s/wp-content/object-cache.php" % (env.deploy_dir, env.deploy_dir)) process_template("wp-config.prod.php", "wp-config.php", { 'PASSWORD': password, 'MEMCACHED_URI': env.memcached }) put("wp-config.php", "%s/wp-config.php" % env.deploy_dir)
def update_config(): myrun("cd %s && " % (env.deploy_dir))
def update(): myrun("cd %s && git pull -r" % (env.deploy_dir))
def clone(): myrun("cd %s && git clone %s" % (env.home, env.repo))
def flash_memcache(): myrun("sudo systemctl restart memcached")
def flash_http_cache(): myrun("sudo rm -r -f /dev/shm/fastcgi_temp ") myrun("sudo rm -r -f /dev/shm/fastcgi_cache ") myrun("sudo systemctl reload nginx")
def link_data(): myrun("ln -fs %s/uploads %s/wp-content/uploads" % (env.data_dir, env.deploy_dir))
def mysql(): myrun("docker exec -ti %s_mysql_1 mysql -A -uroot -ppassword wordpress" % env.project)