Commits

Benoit C committed 52be1c4

adds a reset task

  • Participants
  • Parent commits 29d23b5

Comments (0)

Files changed (1)

File src/fabfile.py

         sudo("ln -sFf %s/%s %s" % (conf.get("av"), env.project_name, conf.get("en")))
 
 
-
 @Permissions("normal_user", env)
 @ConfChecker("django", env)
 def django_settings():
     conf = env.yaml.get('django')
     with cd("%(doc_root)s" % conf):
         run("cp deploy/%s-settings.py %s/settings_local.py" % (env.type, conf.get('src_dir')))
-        sed("%s/settings_local.py" % conf.get('src_dir'), "DOCUMENT_ROOT", "%s" % env.path)
+        sed("%s/settings_local.py" % conf.get('src_dir'), "DOCUMENT_ROOT", "%s" % conf.get('src_dir'))
 
 
 @Permissions("normal_user", env)
         for package in dist_conf.get('packages'):
             sudo("apt-get install %s" % package)
 
+@Permissions("sudo_user", env)
+@ConfChecker("distro", env)
+def delete_database():
+    db = env.yaml.get('database')
+    mysql.drop_database(db)
+
+@Permissions("sudo_user", env)
+@ConfChecker("distro", env)
+def delete_repos():
+    conf = env.yaml.get('project')
+    run("rm -Rf %(doc_root)s" % conf)
+    
 
 def update():
     """updates the code and everything else"""
     
     virtualenv()
 
-    #install_httpd_vhost()
+    install_httpd_vhost()
 
     # install django configuration
     django_settings()
 
     update_database()
-    return
-
+ 
 
     # start/restart the wsgi/fcgi process
     wsgi_restart()
     # install the database schema
     install_database()
 
-
-
     # start/restart the wsgi/fcgi process
     wsgi_restart()
 
     services_restart()
 
 
+def reset():
+    delete_repos()
+    delete_database()