Sha256: 887ac8d3f7c404804a7c6f0e2dedcb58378131bc1ede3505534cdcdf40319a33

Contents?: true

Size: 1.21 KB

Versions: 2

Compression:

Stored size: 1.21 KB

Contents

module Capistrano
  module Cookbook
    class SetupConfigValues
      def symlinks
        fetch(:symlinks) || symlinks_defaults
      end

      def executable_config_files
        fetch(:executable_config_files) || executable_config_files_defaults
      end

      def config_files
        fetch(:config_files) || config_files_defaults
      end

      private

      def symlinks_defaults
        [
          {
            source: "nginx.conf",
            link: "/etc/nginx/sites-enabled/{{full_app_name}}"
          },
          {
            source: "unicorn_init.sh",
            link: "/etc/init.d/unicorn_{{full_app_name}}"
          },
          {
            source: "log_rotation",
           link: "/etc/logrotate.d/{{full_app_name}}"
          },
          {
            source: "monit",
            link: "/etc/monit/conf.d/{{full_app_name}}.conf"
          }
        ]
      end

      def executable_config_files_defaults
        %w(
          unicorn_init.sh
        )
      end

      def config_files_defaults
        %w(
          nginx.conf
          database.example.yml
          log_rotation
          monit
          unicorn.rb
          unicorn_init.sh
          secrets.yml
        )
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
capistrano-cookbook-0.2.1 lib/capistrano/cookbook/helpers/setup_config_values.rb
capistrano-cookbook-0.2.0 lib/capistrano/cookbook/helpers/setup_config_values.rb