Commit d82667c2 authored by Joachim Mathes's avatar Joachim Mathes

TASK: Adjust rsync and task order in fabfile

parent 33efeb79
'''
fabric file proserver-box
fabric file for proserver-box
'''
from fabric.api import *
......@@ -35,9 +35,11 @@ def acquire_database_password():
acquire_private_key_of_box()
env.database_password = run('php -r \'$configuration=include("/var/www/typo3/typo3conf/LocalConfiguration.php"); echo $configuration["DB"]["Connections"]["Default"]["password"];\'').stdout.strip()
print env.database_password
@runs_once
@with_settings(user='proserver')
def acquire_private_key_of_box():
'''
Acquire private key of vagrant box
......@@ -67,7 +69,8 @@ def inject_and_initialize_project():
print(cyan(inject_and_initialize_project.__doc__))
rsync_project(
remote_dir='/var/www/t3o',
remote_dir='/var/www/t3o/',
local_dir='./',
exclude='.git')
with cd("/var/www/t3o"):
......@@ -106,7 +109,7 @@ def download_and_import_database():
run('curl -LsO https://vpro0100.proserver.punkt.de/sql/t3o.sql.gz')
run('mysql -u root -p%s -e "CREATE DATABASE IF NOT EXISTS t3o"' % (mysql_root_password))
run('mysql -u root -p%s -e "GRANT ALL ON t3o.* TO t3o@localhost identified by \'%s\'"' % (mysql_root_password, env.database_password))
run("gunzip < t3o.sql.gz | mysql -u root -p%s" % (mysql_root_password))
run("gunzip < t3o.sql.gz | mysql -u root -p%s t3o" % (mysql_root_password))
@with_settings(user='vagrant')
......@@ -134,8 +137,9 @@ def initialize_proserver_box():
abort(red('Project seems to be initialized already.'))
prepare_user_proserver()
download_and_import_database()
inject_and_initialize_project()
acquire_database_password()
download_and_import_database()
restart_phpfpm()
download_initialized_project()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment