Commit 01ceadd5 by Őry Máté

fab: add cleanup function

fixes #340
parent 8eb07036
...@@ -107,6 +107,7 @@ def update_portal(test=False): ...@@ -107,6 +107,7 @@ def update_portal(test=False):
"Update and restart portal+manager" "Update and restart portal+manager"
with _stopped("portal", "manager"): with _stopped("portal", "manager"):
pull() pull()
pip("circle", "~/circle/requirements.txt") pip("circle", "~/circle/requirements.txt")
migrate() migrate()
compile_things() compile_things()
...@@ -126,10 +127,15 @@ def update_node(): ...@@ -126,10 +127,15 @@ def update_node():
with _stopped("node", "agentdriver", "monitor-client"): with _stopped("node", "agentdriver", "monitor-client"):
pull("~/vmdriver") pull("~/vmdriver")
pip("vmdriver", "~/vmdriver/requirements/production.txt") pip("vmdriver", "~/vmdriver/requirements/production.txt")
pull("~/agentdriver") pull("~/agentdriver")
pip("agentdriver", "~/agentdriver/requirements.txt") pip("agentdriver", "~/agentdriver/requirements.txt")
pull("~/monitor-client") pull("~/monitor-client")
pip("monitor-client", "~/monitor-client/requirements.txt") pip("monitor-client", "~/monitor-client/requirements.txt")
@parallel @parallel
...@@ -151,6 +157,18 @@ def checkout(vmdriver="master", agent="master"): ...@@ -151,6 +157,18 @@ def checkout(vmdriver="master", agent="master"):
run("git checkout %s" % agent) run("git checkout %s" % agent)
def cleanup():
"Clean pyc files of portal"
def _cleanup(dir="~/circle/circle"):
"Clean pyc files"
with cd("~/circle/circle"):
run("find -name '*.py[co]' -exec rm -f {} +")
def _stop_services(*services): def _stop_services(*services):
"Stop given services (warn only if not running)" "Stop given services (warn only if not running)"
with settings(warn_only=True): with settings(warn_only=True):
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 sign in to comment