Skip to content
This repository has been archived by the owner on Jan 25, 2018. It is now read-only.

Commit

Permalink
Merge pull request #11 from jasonthomas/celery
Browse files Browse the repository at this point in the history
Deploy app to celery hosts and restart service. Add amqplib requirement for celery
  • Loading branch information
kumar303 committed Dec 13, 2012
2 parents 0b6e7b7 + 063fad1 commit e453ee8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions requirements/prod.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
amqplib==1.0.2
Babel==0.9.6
Django==1.4.3
anyjson==0.3.3
Expand Down
2 changes: 2 additions & 0 deletions scripts/update/commander_settings.py.dist
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ UPDATE_REF = "origin/master"
UPDATE_VENDOR_REF = "origin/master"

WEB_HOSTGROUP="addons-dev"
CELERY_HOSTGROUP = ''
CELERY_SERVICE = ''

SSH_KEY="/root/keys/addons-updater"

Expand Down
10 changes: 10 additions & 0 deletions scripts/update/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@ def update_code(ctx, ref='origin/master'):
ctx.local("git submodule foreach 'git submodule sync --quiet'")
ctx.local("git submodule foreach 'git submodule update --init --recursive'")


@task
@hostgroups(settings.CELERY_HOSTGROUP, remote_kwargs={'ssh_key': settings.SSH_KEY})
def update_celery(ctx):
ctx.remote(settings.REMOTE_UPDATE_SCRIPT)
if getattr(settings, 'CELERY_SERVICE', False):
ctx.remote("/sbin/service %s restart" % settings.CELERY_SERVICE)


@task
def compress_assets(ctx, arg=''):
with ctx.lcd(settings.SRC_DIR):
Expand Down Expand Up @@ -77,6 +86,7 @@ def deploy_app(ctx):
def deploy(ctx):
checkin_changes()
deploy_app()
update_celery()

@task
def pre_update(ctx, ref=settings.UPDATE_REF):
Expand Down

0 comments on commit e453ee8

Please sign in to comment.