Sha256: 875237bf62ad2e044fda3375e86668b2dd71eb41b1dc1a4f0c838153f8068c6a

Contents?: true

Size: 542 Bytes

Versions: 3

Compression:

Stored size: 542 Bytes

Contents

require 'erb'
module Commands
  class SetupLogrotate
    extend Citrin::Helpers
    def self.run(app)
      @app = app
      logfile = rails_app_log_file(@app)
      template_file = logrotate_config_template(@app)
      template = ERB.new(File.read(template_file), 0, "%<>")
      result = template.result(binding)
      output_file = "/etc/logrotate.d/rails-app-#{@app.name}-#{@app.env}"
      puts "Creating logrotate config file at #{output_file}"
      puts result
      `sudo sh -c 'echo "#{result}" > #{output_file}'`
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
citrin-0.1.7 lib/citrin/commands/setup_logrotate.rb
citrin-0.1.6 lib/citrin/commands/setup_logrotate.rb
citrin-0.1.5 lib/citrin/commands/setup_logrotate.rb