BB-2883 Allow instantce_statistics_csv to receive multiple domains; Create trial_instances_report on cronjob
Modifies the instance_statistics_csv
command to allow for multiple domains. Also uses this new version in a new task to send a trial instances report to emails set in settings.TRIAL_INSTANCES_REPORT_RECIPIENTS
JIRA tickets: BB-2883
Screenshots:
Testing instructions:
Test on functionality on staging:
- Generate the public SSH key for
www-data@stage.manage.opencraft.com
usingssh-keygen -y -f ~/.ssh/id_rsa
- Add public key to
authorized_keys
file onlogs.opencraft.com
- Set
INSTANCE_LOGS_SERVER_HOST
tologs.opencraft.com
in.env
file onstage.manage.opencraft.com
- Run
make manage -- instance_statistics_csv --domains daniel.stage.opencraft.hosting,piotr.stage.opencraft.hosting,gabrieltesting.stage.opencraft.hosting
- Wait for resulting output
Test task on staging:
- Generate the public SSH key for
www-data@stage.manage.opencraft.com
usingssh-keygen -y -f ~/.ssh/id_rsa
- Add public key to
authorized_keys
file onlogs.opencraft.com
- Set
INSTANCE_LOGS_SERVER_HOST
tologs.opencraft.com
in.env
file onstage.manage.opencraft.com
- Set
TRIAL_INSTANCE_REPORT_RECIPIENTS
to'["YOUR_EMAIL@opencraft.com"]'
in.env
file onstage.manage.opencraft.com
- Edit
reports/tasks.py
and change this line
@db_periodic_task(crontab(day='1', hour='2', minute='0'))
to this
@db_periodic_task(crontab(minute='*/5'))
- Start the web process with
make run
(in the web screen tab) and wait 5-6 minutes - Check your email for a resulting CSV
Reviewers
-
@lgp171188