Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7c95d38

Browse files
committed
Merge pull request alphagov#3 from alphagov/add-missing-apps
Add missing apps to search rebuild script
2 parents e313847 + b67f50b commit 7c95d38

File tree

1 file changed

+19
-15
lines changed

1 file changed

+19
-15
lines changed

search.py

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

55
SEARCHABLE_APPS = {
6-
'calendars': ('frontend', 'panopticon:register'),
7-
'licencefinder': ('frontend', 'panopticon:register'),
8-
'businesssupportfinder': ('frontend', 'panopticon:register'),
9-
'publisher': ('backend', 'panopticon:register'),
10-
'recommended-links': ('backend', 'rummager:index'),
11-
'smartanswers': ('frontend', 'panopticon:register'),
12-
'tariff': ('frontend', 'panopticon:register'),
13-
'whitehall': ('backend', 'rummager:index'),
6+
'calendars': ('frontend', ['panopticon:register']),
7+
'designprinciples': ('frontend', ['rummager:index']), # Includes the service-manual. Note: not included in gov.uk/search
8+
'frontend': ('frontend', ['rummager:index']),
9+
'licencefinder': ('frontend', ['panopticon:register']),
10+
'businesssupportfinder': ('frontend', ['panopticon:register']),
11+
'publisher': ('backend', ['panopticon:register']),
12+
'recommended-links': ('backend', ['rummager:index']),
13+
'smartanswers': ('frontend', ['panopticon:register']),
14+
'tariff': ('frontend', ['panopticon:register']),
15+
'travel-advice-publisher':('backend', ['panopticon:register', 'panopticon:reregister_editions']),
16+
'whitehall': ('backend', ['rummager:index']),
1417
}
1518

1619
@task
@@ -50,12 +53,13 @@ def reindex(app=None):
5053
def reindex_app(app):
5154
puts("Rebuilding search index for application '%s'" % app)
5255

53-
machine_class, task = SEARCHABLE_APPS[app]
56+
machine_class, tasks = SEARCHABLE_APPS[app]
5457
util.use_random_host('class-%s' % machine_class)
5558

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

0 commit comments

Comments
 (0)