Sha256: 0a8f99d51506782b2d4b2e1a1f9ca4bfc23e18a96c6f920b2dd12a1a66133dff

Contents?: true

Size: 668 Bytes

Versions: 3

Compression:

Stored size: 668 Bytes

Contents

# frozen_string_literal: true

require_relative 'logrotate_helper'

namespace :logrotate do
  include LogrotateHelper
  desc 'Enable logrotate for the application'
  task :enable do
    on roles(:app) do
      within release_path do
        set_config
        if logrotate_enabled
          puts "logrotate already enabled:\n========================="
          puts capture "cat #{@config_file_path}"
        else
          make_basepath
          upload! StringIO.new(@config_template), @config_file_path
          upload! StringIO.new(@schedule_template), @schedule_file_path
          whenever 'update' if logrotate_enabled
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
capistrano-ops-0.2.14 lib/capistrano/ops/capistrano/v3/tasks/logrotate/enable.rake
capistrano-ops-0.2.13 lib/capistrano/ops/capistrano/v3/tasks/logrotate/enable.rake
capistrano-ops-0.2.12 lib/capistrano/ops/capistrano/v3/tasks/logrotate/enable.rake