Last active
March 19, 2017 09:36
-
-
Save tonywangcn/2ba20c758db53cc4f23a3f548bf63dc3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@parallel | |
def install(): | |
cmd = "celery -A test_celery worker --app=test_celery.celeryapp:app --concurrency=10 --loglevel=debug" | |
run("apt-get install dtach && apt-get install -y python-pip && pip install celery && pip install requests && pip install pymongo") | |
with settings(warn_only=True): | |
runResult = run("mkdir -p /root/code/test_celery") | |
if runResult.return_code == 1: | |
print 'file exists' | |
put("./test_celery/celeryapp.py", "/root/code/test_celery") | |
put("./test_celery/run_tasks.py", "/root/code/test_celery") | |
put("./test_celery/tasks.py", "/root/code/test_celery") | |
put("./test_celery/ua.txt", "/root/code/test_celery") | |
put("./test_celery/__init__.py", "/root/code/test_celery") | |
with cd("/root/code"): | |
result = run("ls -l") | |
run('dtach -n `mktemp -u /tmp/%s.XXXX` %s' % ('dtach', cmd)) | |
return result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment