Skip to content

Commit

Permalink
Revert "Remove whenever gem and unneeded cron stuff (#1081)" (#1082)
Browse files Browse the repository at this point in the history
This reverts commit b3e881a.
  • Loading branch information
ryan-mcneil authored Apr 5, 2024
1 parent b3e881a commit 9efa4a8
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SHELL ["/bin/bash", "-c"]
RUN groupadd -g $userid -r gi-bill-data-service && \
useradd -u $userid -r -g gi-bill-data-service -d /srv/gi-bill-data-service gi-bill-data-service
RUN apt-get update -qq && apt-get install -y \
build-essential git curl wget libpq-dev dumb-init shared-mime-info nodejs
build-essential git curl wget libpq-dev dumb-init shared-mime-info nodejs cron

RUN mkdir -p /srv/gi-bill-data-service/src && \
chown -R gi-bill-data-service:gi-bill-data-service /srv/gi-bill-data-service
Expand Down Expand Up @@ -47,6 +47,7 @@ COPY --chown=gi-bill-data-service:gi-bill-data-service . .
USER gi-bill-data-service
RUN gem install bundler --no-document -v ${BUNDLER_VERSION}
RUN bundle install --binstubs="${BUNDLE_APP_CONFIG}/bin" $bundler_opts && find ${BUNDLE_APP_CONFIG}/cache -type f -name \*.gem -delete
RUN bundle exec whenever --update-crontab
ENV PATH="/usr/local/bundle/bin:${PATH}"

###
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ gem 'rails-html-sanitizer', '>= 1.4.4'
gem 'ruby-saml'
gem 'sitemap_generator'
gem 'strong_migrations'
gem 'whenever', require: false
gem 'will_paginate'

group :production do
Expand Down
4 changes: 4 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ GEM
case_transform (0.2)
activesupport
cgi (0.4.1)
chronic (0.10.2)
coderay (1.1.3)
coercible (1.0.0)
descendants_tracker (~> 0.0.1)
Expand Down Expand Up @@ -446,6 +447,8 @@ GEM
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
whenever (1.0.0)
chronic (>= 0.6.3)
will_paginate (4.0.0)
xpath (3.2.0)
nokogiri (~> 1.8)
Expand Down Expand Up @@ -519,6 +522,7 @@ DEPENDENCIES
virtus (~> 2.0.0)
watir (~> 7.3)
web-console (~> 4.2)
whenever
will_paginate

RUBY VERSION
Expand Down
21 changes: 21 additions & 0 deletions config/schedule.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Use this file to easily define all of your cron jobs.
#
# It's helpful, but not entirely necessary to understand cron before proceeding.
# http://en.wikipedia.org/wiki/Cron

# Example:
#
# set :output, "/path/to/my/cron_log.log"
#
# every 2.hours do
# command "/usr/bin/some_great_command"
# runner "MyModel.some_method"
# rake "some:great:rake:task"
# end
#
# every 4.days do
# runner "AnotherModel.prune_old_records"
# end

# Learn more: http://github.com/javan/whenever
#set :job_template, nil

0 comments on commit 9efa4a8

Please sign in to comment.