aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mac.com>2015-11-27 10:16:06 +0200
committerFilipp Lepalaan <filipp@mac.com>2015-11-27 10:16:06 +0200
commit57c46eff8a61a56658242306d139e86b84f01f5d (patch)
treec45520aa7d8894f43d7660a0c35da0fc69053b90
parentfbc56b5be6443bc681ab67283ab7a3e68b3d68c9 (diff)
downloadServo-57c46eff8a61a56658242306d139e86b84f01f5d.tar.gz
Servo-57c46eff8a61a56658242306d139e86b84f01f5d.tar.bz2
Servo-57c46eff8a61a56658242306d139e86b84f01f5d.zip
Added self update
-rw-r--r--servo/management/commands/selfupdate.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/servo/management/commands/selfupdate.py b/servo/management/commands/selfupdate.py
new file mode 100644
index 0000000..d985041
--- /dev/null
+++ b/servo/management/commands/selfupdate.py
@@ -0,0 +1,17 @@
+# -*- coding: utf-8 -*-
+
+import os.path
+from subprocess import call
+from django.conf import settings
+from django.core.management.base import BaseCommand
+
+
+class Command(BaseCommand):
+
+ help = "Updates this Servo installation"
+
+ def handle(self, *args, **options):
+ mc = os.path.join(settings.BASE_DIR, 'manage.py')
+ call(['git', 'pull', 'origin', 'master'])
+ call([mc, 'migrate', '--no-initial-data'])
+ call([mc, 'clearsessions'])