Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ruby 3.2 #3678

Merged
merged 109 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from 105 commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
f9c0f25
move view component files to sprockets
Jun 5, 2024
44c5480
try
Jun 5, 2024
286bac2
more
Jun 5, 2024
c3a7e94
more
Jun 5, 2024
15522ca
more
Jun 5, 2024
97e4f17
more
Jun 5, 2024
d00a47f
rails 7.0
Jun 5, 2024
c970cad
more
Jun 5, 2024
93cd04c
more
Jun 5, 2024
be88296
more
Jun 5, 2024
7a6f091
more
Jun 6, 2024
4a8361c
more
Jun 6, 2024
67bd43f
ruby 3.2
Jun 7, 2024
e209764
more
Jun 7, 2024
16f4407
more
Jun 7, 2024
aa0a836
more
Jun 7, 2024
39a04c8
more
Jun 7, 2024
406173c
more
Jun 7, 2024
c26f420
more
Jun 7, 2024
c589235
more
Jun 7, 2024
f5ca183
more
Jun 7, 2024
38a0d44
more
Jun 7, 2024
ff844ed
more
Jun 7, 2024
ddf00ef
more
Jun 7, 2024
d8403a5
more
Jun 7, 2024
afda36c
more
Jun 7, 2024
e3ebaa3
more
Jun 10, 2024
5a989ad
more
Jun 10, 2024
1f76e03
more
Jun 10, 2024
3bd167e
more
Jun 10, 2024
4bf7f63
remove separate overcommit Gemfile as complicates updates
Jun 10, 2024
307876c
more
Jun 10, 2024
176396e
more
Jun 10, 2024
62aa844
more
Jun 10, 2024
37848ea
more
Jun 10, 2024
2e8f87a
more
Jun 10, 2024
93c8fc4
more
Jun 10, 2024
06e90c9
more
Jun 10, 2024
690e9ca
more
Jun 11, 2024
c7d2339
more
Jun 11, 2024
6ecfb16
Merge remote-tracking branch 'origin/master' into 20240605-reduce-web…
Jun 11, 2024
7c48144
more
Jun 11, 2024
500192b
more
Jun 11, 2024
f90d3a2
more
Jun 11, 2024
9131e30
more
Jun 11, 2024
90e3eba
Merge remote-tracking branch 'origin/master' into 20240605-rails70
Jun 11, 2024
dd79ffc
more
Jun 11, 2024
c758d3d
more
Jun 11, 2024
3b613e7
Merge branch '20240605-reduce-webpack' into 20240605-rails70
Jun 11, 2024
a7fddec
Merge remote-tracking branch 'origin/master' into 20240605-reduce-web…
Jun 11, 2024
712c8e0
Merge branch '20240605-reduce-webpack' into 20240605-rails70
Jun 11, 2024
23ba4d8
Merge branch '20240605-rails70' into 20240607-rails70-ruby32
Jun 11, 2024
2ddaf04
more
Jun 11, 2024
1ac8ad4
more
Jun 11, 2024
9d7b21e
more
Jun 12, 2024
420e5cc
more
Jun 12, 2024
55cca1c
more
Jun 13, 2024
27d8c3b
more
Jun 13, 2024
da46a1b
Merge remote-tracking branch 'origin/master' into 20240605-rails70
Jun 13, 2024
f918ad8
Merge branch '20240605-rails70' into 20240607-rails70-ruby32
Jun 13, 2024
57fff97
more
Jun 13, 2024
d68763f
more
Jun 13, 2024
7f436c3
more
Jun 13, 2024
7808bb3
more
Jun 13, 2024
0fc5177
more
Jun 13, 2024
81dc9ea
more
Jun 13, 2024
7b69eae
more
Jun 13, 2024
5aea8d4
more
Jun 14, 2024
4e3368a
more
Jun 14, 2024
39d087b
more
Jun 14, 2024
f6fdf45
more
Jun 14, 2024
ddc67b2
more
Jun 14, 2024
2035981
rails 7.1
Jun 17, 2024
874c4b7
more
Jun 17, 2024
4b55b7f
depreciation warnings
Jun 17, 2024
3238996
more
Jun 17, 2024
5e94ccd
more
Jun 17, 2024
80e4dba
Merge remote-tracking branch 'origin/master' into 20240617-rails70-de…
Jun 17, 2024
67bb9f1
more
Jun 17, 2024
6188240
Merge branch '20240617-rails70-deprecation' into 20240617-rails71
Jun 17, 2024
14e3705
more
Jun 17, 2024
b2cdb08
more
Jun 17, 2024
574bbd1
more
Jun 17, 2024
59c96b5
more
Jun 18, 2024
00bd785
more
Jun 18, 2024
0ccae9a
more
Jun 18, 2024
df580df
Merge remote-tracking branch 'origin/master' into 20240607-rails70-ru…
Jun 21, 2024
fe732b3
Merge remote-tracking branch 'origin/20240617-rails71' into 20240607-…
Jun 21, 2024
a04f532
more
Jun 21, 2024
9032194
Merge remote-tracking branch 'origin/master' into 20240617-rails71
Jun 21, 2024
2ffe97f
Merge branch '20240617-rails71' into 20240607-rails70-ruby32
Jun 21, 2024
f482894
Merge remote-tracking branch 'origin/master' into 20240607-rails70-ru…
Jul 1, 2024
e99389f
more
Jul 1, 2024
604bfec
more
Jul 1, 2024
26447e1
Merge remote-tracking branch 'origin/master' into 20240607-rails70-ru…
Jul 4, 2024
d993590
more
Jul 4, 2024
91b42ab
more
Jul 4, 2024
c631b98
more
Jul 4, 2024
7a63aa1
more
Jul 4, 2024
79449f7
more
Jul 4, 2024
f933b1d
more
Jul 4, 2024
0dbeccb
more
Jul 5, 2024
ffa94e2
more
Jul 5, 2024
ca3b797
Merge branch 'master' into 20240607-rails70-ruby32
ldodds Jul 5, 2024
91a71cb
more
Jul 5, 2024
bf0513e
more
Jul 9, 2024
874245b
Merge remote-tracking branch 'origin/master' into 20240607-rails70-ru…
Jul 9, 2024
e16815e
more
Jul 9, 2024
6c38a1b
more
Jul 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
384 changes: 125 additions & 259 deletions .ebextensions/cronjob.config
Original file line number Diff line number Diff line change
@@ -1,264 +1,130 @@
files:
#
# Check for DCC meters
#
"/etc/cron.d/dcc-check":
mode: "000644"
owner: root
group: root
content: |
00 1 * * * root /bin/bash -l -c 'cd /var/app/current && RAILS_ENV=production bin/run_as_webapp bundle exec rake meters:check_for_dcc >> /var/log/jobs.log 2>&1'

#
# Load non-amr data feeds
#
"/etc/cron.d/carbon-intensity":
mode: "000644"
owner: root
group: root
content: |
00 3 * * * root /bin/bash -l -c 'cd /var/app/current && RAILS_ENV=production bin/run_as_webapp bundle exec rake data_feeds:carbon_intensity_loader >> /var/log/jobs.log 2>&1'

"/etc/cron.d/load-solar-pv-tuos":
mode: "000644"
owner: root
group: root
content: |
30 3,15 * * * root /bin/bash -l -c 'cd /var/app/current && RAILS_ENV=production bin/run_as_webapp bundle exec rake data_feeds:solar_pv_tuos_loader >> /var/log/jobs.log 2>&1'

"/etc/cron.d/load-meteostat-data":
mode: "000644"
owner: root
group: root
content: |
50 3 * * * root /bin/bash -l -c 'cd /var/app/current && RAILS_ENV=production bin/run_as_webapp bundle exec rake data_feeds:meteostat_loader >> /var/log/jobs.log 2>&1'

"/etc/cron.d/back-fill-any-meteostat-temperatures":
mode: "000644"
owner: root
group: root
content: |
55 3 * * * root /bin/bash -l -c 'cd /var/app/current && RAILS_ENV=production bin/run_as_webapp bundle exec rake data_feeds:meteostat_back_fill >> /var/log/jobs.log 2>&1'

"/etc/cron.d/back-fill-any-solar-pv-readings":
mode: "000644"
owner: root
group: root
content: |
35 3 * * * root /bin/bash -l -c 'cd /var/app/current && RAILS_ENV=production bin/run_as_webapp bundle exec rake data_feeds:solar_pv_tuos_back_fill >> /var/log/jobs.log 2>&1'

#
# Import CSV files
#
"/etc/cron.d/import-csv-files":
mode: "000644"
owner: root
group: root
content: |
15 5 * * * root /bin/bash -l -c 'cd /var/app/current && RAILS_ENV=production bin/run_as_webapp bundle exec rake amr:import_all >> /var/log/jobs.log 2>&1'

"/etc/cron.d/import-rtone-variant-data":
mode: "000644"
owner: root
group: root
content: |
20 4 * * * root /bin/bash -l -c 'cd /var/app/current && RAILS_ENV=production bin/run_as_webapp bundle exec rake solar:import_rtone_variant_readings >> /var/log/jobs.log 2>&1'

#
# Import Solar Edge data
#
"/etc/cron.d/import-solar-edge-data":
mode: "000644"
owner: root
group: root
content: |
15 4 * * * root /bin/bash -l -c 'cd /var/app/current && RAILS_ENV=production bin/run_as_webapp bundle exec rake solar:import_solar_edge_readings >> /var/log/jobs.log 2>&1'

#
# Import Low carbon hub data
#
"/etc/cron.d/import-low-carbon-hub-data":
mode: "000644"
owner: root
group: root
content: |
05 5 * * * root /bin/bash -l -c 'cd /var/app/current && RAILS_ENV=production bin/run_as_webapp bundle exec rake solar:import_low_carbon_hub_readings >> /var/log/jobs.log 2>&1'

#
# Import n3rgy readings
#
"/etc/cron.d/import-n3rgy-readings":
mode: "000644"
owner: root
group: root
content: |
0 14 * * * root /bin/bash -l -c 'cd /var/app/current && RAILS_ENV=production bin/run_as_webapp bundle exec rake amr:import_n3rgy_readings >> /var/log/jobs.log 2>&1'

"/etc/cron.d/import_n3rgy_tariffs":
mode: "000644"
owner: root
group: root
content: |
10 14 * * * root /bin/bash -l -c 'cd /var/app/current && RAILS_ENV=production bin/run_as_webapp bundle exec rake amr:import_n3rgy_tariffs >> /var/log/jobs.log 2>&1'

#
# Start daily regeneration jobs
#
"/etc/cron.d/daily-regeneration":
mode: "000644"
owner: root
group: root
content: |
00 6 * * * root /bin/bash -l -c 'cd /var/app/current && RAILS_ENV=production bin/run_as_webapp bundle exec rake school:daily_regeneration >> /var/log/jobs.log 2>&1'

#
# Generate subscriptions
#
"/etc/cron.d/generate-subscriptions":
mode: "000644"
owner: root
group: root
content: |
30 6 * * Wed root /bin/bash -l -c 'cd /var/app/current && RAILS_ENV=production bin/run_as_webapp bundle exec rake alerts:generate_subscriptions >> /var/log/jobs.log 2>&1'
#
# EMail summary of imports
#
"/etc/cron.d/notify-amr-imports-daily":
mode: "000644"
owner: root
group: root
content: |
45 9 * * * root /bin/bash -l -c 'cd /var/app/current && RAILS_ENV=production bin/run_as_webapp bundle exec rake amr_importer:send_daily_notification_email >> /var/log/jobs.log 2>&1'

#
# EMail summary of Rollbar errors from imports
#
#"/etc/cron.d/rollbar-reports-daily":
# mode: "000644"
# owner: root
# group: root
# content: |
# 0 9 * * * root /bin/bash -l -c 'cd /var/app/current && RAILS_ENV=production bin/run_as_webapp bundle exec rake utility:custom_rollbar_reports >> /var/log/jobs.log 2>&1'

#
# Generate sitemap
#
"/etc/cron.d/generate-sitemap-daily":
mode: "000644"
owner: root
group: root
content: |
00 1 * * * root /bin/bash -l -c 'cd /var/app/current && RAILS_ENV=production bin/run_as_webapp bundle exec rake "-s sitemap:refresh" >> /var/log/jobs.log 2>&1'

#
# Send first target emails weekly on a Monday
#
"/etc/cron.d/send-first-target-emails":
mode: "000644"
owner: root
group: root
content: |
30 08 * * 1 root /bin/bash -l -c 'cd /var/app/current && RAILS_ENV=production bin/run_as_webapp bundle exec rake targets:send_first_target >> /var/log/jobs.log 2>&1'

#
# Send email with recently recorded activities weekly on a Monday
#
"/etc/cron.d/send-recent-activities-email":
mode: "000644"
owner: root
group: root
content: |
32 08 * * 1 root /bin/bash -l -c 'cd /var/app/current && RAILS_ENV=production bin/run_as_webapp bundle exec rake recent_activities:send_email >> /var/log/jobs.log 2>&1'


#
# Send weekly email about target progress to admins
#
"/etc/cron.d/send-weekly-admin-target-reports":
mode: "000644"
owner: root
group: root
content: |
30 08 * * 5 root /bin/bash -l -c 'cd /var/app/current && RAILS_ENV=production bin/run_as_webapp bundle exec rake targets:admin_report >> /var/log/jobs.log 2>&1'

#
# Send issues report to admins weekly on a Monday
#
"/etc/cron.d/send-weekly-admin-issue-reports":
mode: "000644"
owner: root
group: root
content: |
15 08 * * 1 root /bin/bash -l -c 'cd /var/app/current && RAILS_ENV=production bin/run_as_webapp bundle exec rake issues:send_user_report >> /var/log/jobs.log 2>&1'

#
# Resync translations with Transifex on Monday mornings
#
"/etc/cron.d/sync-transifex-data":
mode: "000644"
owner: root
group: root
content: |
00 08 * * 1 root /bin/bash -l -c 'cd /var/app/current && RAILS_ENV=production bin/run_as_webapp bundle exec rake i18n:transifex_load >> /var/log/jobs.log 2>&1'


#
# Delete old alert content
#
"/etc/cron.d/delete_alert_content":
mode: "000644"
owner: root
group: root
content: |
0 0 1 * * root /bin/bash -l -c 'cd /var/app/current && RAILS_ENV=production bin/run_as_webapp bundle exec rake alerts:delete_alert_content >> /var/log/jobs.log 2>&1'

#
# Send Good Job queue metrics to AWS Cloudwatch
#
"/etc/cron.d/send-good-job-queue-metrics-to-cloudwatch":
mode: "000644"
owner: root
group: root
content: |
*/5 * * * * root /bin/bash -l -c 'cd /var/app/current && RAILS_ENV=production bin/run_as_webapp bundle exec rake jobs:send_good_job_queue_metrics_to_cloudwatch >> /var/log/jobs.log 2>&1'

#
# Send Review Group Tariffs Reminders
#
"/etc/cron.d/send_review_group_tariffs_reminders":
mode: "000644"
owner: root
group: root
content: |
0 8 15 3,9 * root /bin/bash -l -c 'cd /var/app/current && RAILS_ENV=production bin/run_as_webapp bundle exec rake school_groups:send_review_group_tariffs_reminder >> /var/log/jobs.log 2>&1'

#
# Send Review School Tariffs Reminders
#
"/etc/cron.d/send_review_school_tariffs_reminders":
mode: "000644"
owner: root
group: root
content: |
0 8 15 3,9 * root /bin/bash -l -c 'cd /var/app/current && RAILS_ENV=production bin/run_as_webapp bundle exec rake schools:send_review_school_tariffs_reminder >> /var/log/jobs.log 2>&1'

#
# Send Onboarding Reminder Emails
#
"/etc/cron.d/send-daily-onboarding-reminder-emails":
mode: "000644"
owner: root
group: root
content: |
00 4 * * * root /bin/bash -l -c 'cd /var/app/current && RAILS_ENV=production bin/run_as_webapp bundle exec rake onboarding:reminder_mailer >> /var/log/jobs.log 2>&1'
/usr/local/sbin/run-webapp-job:
mode: "000755"
owner: root
group: root
content: |
#!/bin/bash
exec >>/var/log/jobs.log 2>&1
echo "## Running "$@" at $(date --iso-8601=seconds)"
if [ -f /disable_jobs ]; then
echo "disabled by file /disable_jobs"
exit 0
fi
run-as-webapp bin/rake "$@"

/usr/local/sbin/run-as-webapp:
mode: "000755"
owner: root
group: root
content: |
#!/bin/bash
set -e
[ "$EUID" -ne 0 ] && echo "Run as root" 1>&2 && exit 1
EB_APP_DIR="$(/opt/elasticbeanstalk/bin/get-config platformconfig -k AppDeployDir)"
EB_APP_USER="$(/opt/elasticbeanstalk/bin/get-config platformconfig -k AppUser)"
cd "$EB_APP_DIR"
export $(< /opt/elasticbeanstalk/deployment/env)
runuser -u "$EB_APP_USER" -- "$@"

/etc/cron.d/energysparks:
mode: "000644"
owner: root
group: root
content: |
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin
#
# Check for DCC meters
#
0 1 * * * root run-webapp-job meters:check_for_dcc
#
# Load non-amr data feeds
#
0 3 * * * root run-webapp-job data_feeds:carbon_intensity_loader
30 3,15 * * * root run-webapp-job data_feeds:solar_pv_tuos_loader
50 3 * * * root run-webapp-job data_feeds:meteostat_loader
55 3 * * * root run-webapp-job data_feeds:meteostat_back_fill
35 3 * * * root run-webapp-job data_feeds:solar_pv_tuos_back_fill
#
# Import CSV files
#
15 5 * * * root run-webapp-job amr:import_all
20 4 * * * root run-webapp-job solar:import_rtone_variant_readings
#
# Import Solar Edge data
#
15 4 * * * root run-webapp-job solar:import_solar_edge_readings
#
# Import Low carbon hub data
#
5 5 * * * root run-webapp-job solar:import_low_carbon_hub_readings
#
# Import n3rgy readings
#
0 14 * * * root run-webapp-job amr:import_n3rgy_readings
10 14 * * * root run-webapp-job amr:import_n3rgy_tariffs
#
# Start daily regeneration jobs
#
0 6 * * * root run-webapp-job school:daily_regeneration
#
# Generate subscriptions
#
30 6 * * Wed root run-webapp-job alerts:generate_subscriptions
#
# EMail summary of imports
#
45 9 * * * root run-webapp-job amr_importer:send_daily_notification_email
#
# EMail summary of Rollbar errors from imports
#
# 0 9 * * * root run-webapp-job utility:custom_rollbar_reports
#
# Generate sitemap
#
0 1 * * * root run-webapp-job -s sitemap:refresh
#
# Send first target emails weekly on a Monday
#
30 08 * * 1 root run-webapp-job targets:send_first_target
#
# Send email with recently recorded activities weekly on a Monday
#
32 08 * * 1 root run-webapp-job recent_activities:send_email
#
# Send weekly email about target progress to admins
#
30 08 * * 5 root run-webapp-job targets:admin_report
#
# Send issues report to admins weekly on a Monday
#
15 08 * * 1 root run-webapp-job issues:send_user_report
#
# Resync translations with Transifex on Monday mornings
#
0 08 * * 1 root run-webapp-job i18n:transifex_load
#
# Delete old alert content
#
0 0 1 * * root run-webapp-job alerts:delete_alert_content
#
# Send Good Job queue metrics to AWS Cloudwatch
#
*/5 * * * * root run-webapp-job jobs:send_good_job_queue_metrics_to_cloudwatch
#
# Send Review Group Tariffs Reminders
#
0 8 15 3,9 * root run-webapp-job school_groups:send_review_group_tariffs_reminder
#
# Send Review School Tariffs Reminders
#
0 8 15 3,9 * root run-webapp-job schools:send_review_school_tariffs_reminder
#
# Send Onboarding Reminder Emails
#
0 4 * * * root run-webapp-job onboarding:reminder_mailer

# Remove baks else jobs get run twice
commands:
remove_old_cloudwatch_job:
command: "rm -rf /etc/cron.d/cwpump"
remove_good_job_number_of_processes:
command: "rm -rf /etc/cron.d/send-good-job-number-of-processes-metrics-to-cloudwatch"
remove_good_job_memory_usage:
command: "rm -rf /etc/cron.d/send-good-job-memory-usage-metrics-to-cloudwatch"
# Remove baks else jobs get run twice
remove_old_cron:
command: "rm -f /etc/cron.d/*.bak"
Loading