Commits

theoden committed d7af4e5

* Project.remove fixed

  • Participants
  • Parent commits 960c2d6
  • Branches multiple web-servers

Comments (0)

Files changed (2)

File fab_deploy/apps.py

         # nothing to do in a static site case
         pass
 
+    @task_method
+    def remove(self):
+        """ Removes application traces.
+        
+        Is prohibited to remove app's code since several appications may share
+        single VCS repository.
+        """
+        self.frontend.disable_config()
+
 
 class WebApp(StaticSite):
     __metaclass__ = ABCMeta
             self.backend.touch()
         else:
             self.backend.restart()
+
+    @task_method
+    def remove(self):
+        """ Removes application traces.
         
+        Is prohibited to remove app's code since several appications may share
+        single VCS repository.
+        """
+        super(WebApp, self).remove()
+        self.backend.disable_config()
+
     @task_method
     @abstractmethod
     def update_config(self, restart=True):

File fab_deploy/project.py

             message = "Do you wish to undeploy host %s?" % env.hosts[0]
             if not console.confirm(message, default=False):
                 abort("Aborting.")
-        @utils.run_as_sudo
-        def wipe_web():
-            sudo('rm -f /etc/nginx/sites-enabled/' + env.conf['INSTANCE_NAME'])
-            sudo('a2dissite ' + env.conf['INSTANCE_NAME'])
-            sudo('invoke-rc.d nginx reload')
-            sudo('invoke-rc.d apache2 reload')
-        wipe_web()
+        for app in env.conf.APPS:
+            app.remove()
+        # remove project sources
         run('rm -rf %s' % env.conf.SRC_DIR)
+        # remove parts of project's virtualenv
         for folder in ['bin', 'include', 'lib', 'src']:
             run('rm -rf %s' % env.conf.ENV_DIR + '/' + folder)