Skip to content

Commit 662984a

Browse files
committed
Support multiple tasks per app
Travel-advice-publisher will need this.
1 parent 442a60e commit 662984a

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

search.py

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
import util
44

55
SEARCHABLE_APPS = {
6-
'calendars': ('frontend', 'panopticon:register'),
7-
'frontend': ('frontend', 'rummager:index'),
8-
'licencefinder': ('frontend', 'panopticon:register'),
9-
'businesssupportfinder': ('frontend', 'panopticon:register'),
10-
'publisher': ('backend', 'panopticon:register'),
11-
'recommended-links': ('backend', 'rummager:index'),
12-
'smartanswers': ('frontend', 'panopticon:register'),
13-
'tariff': ('frontend', 'panopticon:register'),
14-
'whitehall': ('backend', 'rummager:index'),
6+
'calendars': ('frontend', ['panopticon:register']),
7+
'frontend': ('frontend', ['rummager:index']),
8+
'licencefinder': ('frontend', ['panopticon:register']),
9+
'businesssupportfinder': ('frontend', ['panopticon:register']),
10+
'publisher': ('backend', ['panopticon:register']),
11+
'recommended-links': ('backend', ['rummager:index']),
12+
'smartanswers': ('frontend', ['panopticon:register']),
13+
'tariff': ('frontend', ['panopticon:register']),
14+
'whitehall': ('backend', ['rummager:index']),
1515
}
1616

1717
@task
@@ -51,12 +51,13 @@ def reindex(app=None):
5151
def reindex_app(app):
5252
puts("Rebuilding search index for application '%s'" % app)
5353

54-
machine_class, task = SEARCHABLE_APPS[app]
54+
machine_class, tasks = SEARCHABLE_APPS[app]
5555
util.use_random_host('class-%s' % machine_class)
5656

57-
# FIXME: Remove this horrible hack of a hack for a hack
58-
if app == 'recommended-links':
59-
with cd('/data/vhost/recommended-links.*/current'):
60-
sudo('govuk_setenv default bundle exec rake -v "%s"' % task, user='deploy')
61-
else:
62-
util.rake(app, task)
57+
for task in tasks:
58+
# FIXME: Remove this horrible hack of a hack for a hack
59+
if app == 'recommended-links':
60+
with cd('/data/vhost/recommended-links.*/current'):
61+
sudo('govuk_setenv default bundle exec rake -v "%s" --trace' % task, user='deploy')
62+
else:
63+
util.rake(app, task)

0 commit comments

Comments
 (0)