Bug 1165229 - Heroku: Move the deploy tasks to their own script

Since we'll soon be adding reporting deploys to New Relic, which will be
too verbose to include in the Procfile. Also adds additional log output
(which follows the buildpack compile log formatting convention) to make
it easier to find & follow the release tasks on Papertrail.

Uses the `set -euo pipefail` recommendation from:
http://redsymbol.net/articles/unofficial-bash-strict-mode/
This commit is contained in:
Ed Morley 2016-03-11 11:33:25 +00:00
Родитель ecac73e26a
Коммит 859230c9bf
2 изменённых файлов: 18 добавлений и 1 удалений

Просмотреть файл

@ -7,4 +7,5 @@ worker_buildapi_4hr: newrelic-admin run-program celery -A treeherder worker -Q b
worker_default: newrelic-admin run-program celery -A treeherder worker -Q default,cycle_data,calculate_durations,fetch_bugs,fetch_allthethings,generate_perf_alerts,detect_intermittents --maxtasksperchild=50 --concurrency=3
worker_hp: newrelic-admin run-program celery -A treeherder worker -Q classification_mirroring,publish_to_pulse --maxtasksperchild=50 --concurrency=1
worker_log_parser: newrelic-admin run-program celery -A treeherder worker -Q log_parser_fail,log_parser,log_parser_hp,log_parser_json,error_summary,store_error_summary,autoclassify --maxtasksperchild=50 --concurrency=5
release: ./manage.py migrate --noinput && ./manage.py load_initial_data && ./manage.py init_datasources
release: ./bin/pre_deploy

16
bin/pre_deploy Executable file
Просмотреть файл

@ -0,0 +1,16 @@
#!/usr/bin/env bash
# Tasks run after the Heroku buildpack compile, but prior to the deploy.
# If failures occur, the deploy will not proceed.
set -euo pipefail
echo "-----> PRE-DEPLOY: Running Django migration..."
./manage.py migrate --noinput
echo "-----> PRE-DEPLOY: Loading initial data..."
./manage.py load_initial_data
echo "-----> PRE-DEPLOY: Initialising datasources..."
./manage.py init_datasources
echo "-----> PRE-DEPLOY: Complete!"