Commits

Vladimir Mihailenco committed 2409a79

Activate version with one command instead of two

  • Participants
  • Parent commits 1635b1c

Comments (0)

Files changed (1)

File fabdeploy/version.py

     'work_on',
     'purge_old',
     'purge_tmp',
+    'purge',
 ]
 
 
                 '%(last_version_link)s %(previous_version_link)s' % self.conf)
 
         # save last version
-        run('rm --force %(last_version_link)s' % self.conf)
-        run('ln --symbolic %(version_path)s %(last_version_link)s' % self.conf)
+        run('ln '
+            '--symbolic '
+            '--force '
+            '--no-target-directory '
+            '%(version_path)s '
+            '%(last_version_link)s' % self.conf)
 
         # activate current version
-        run('rm --force %(active_version_link)s' % self.conf)
         run('ln '
             '--symbolic '
+            '--force '
+            '--no-target-directory '
             '%(version_path)s %(active_version_link)s' % self.conf)
 
         run('touch %(version_data_file)s' % self.conf)
             self.purge(old_versions)
 
 purge_old = PurgeOld()
+
+
+class Purge(Task):
+    def do(self):
+        purge_tmp.run()
+        purge_old.run()
+
+purge = Purge()