Sha256: a8ab672035a6180743abcaf1f32bf5ab313c602e558fe607115c742ecdfcfa2f

Contents?: true

Size: 1.06 KB

Versions: 12

Compression:

Stored size: 1.06 KB

Contents

# frozen_string_literal: true

require 'avm/jobs/base'
require 'avm/eac_ubuntu_base0/apache'
require 'eac_ruby_utils/core_ext'

module Avm
  module EacWebappBase0
    class ApachePath
      JOBS = %w[write_available_conf enable_conf reload_apache].freeze
      include ::Avm::Jobs::Base

      def content
        ::Avm::EacWebappBase0::ApachePath.template.child('default.conf').apply(variables_source)
      end

      def document_root
        instance.read_entry(::Avm::Instances::EntryKeys::INSTALL_PATH)
      end

      def extra_content
        ''
      end

      private

      def apache_uncached
        ::Avm::EacUbuntuBase0::Apache.new(instance.host_env)
      end

      def enable_conf
        infom 'Enabling configuration...'
        conf.enable
      end

      def reload_apache
        infom 'Reloading Apache...'
        apache.service('reload')
      end

      def conf_uncached
        apache.conf(instance.id)
      end

      def write_available_conf
        infom 'Writing available configuration...'
        conf.write(content)
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
eac_tools-0.31.1 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/apache_path.rb
eac_tools-0.31.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/apache_path.rb
eac_tools-0.30.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/apache_path.rb
avm-eac_webapp_base0-0.8.0 lib/avm/eac_webapp_base0/apache_path.rb
eac_tools-0.29.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/apache_path.rb
avm-eac_webapp_base0-0.7.0 lib/avm/eac_webapp_base0/apache_path.rb
eac_tools-0.28.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/apache_path.rb
eac_tools-0.27.2 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/apache_path.rb
avm-eac_webapp_base0-0.6.1 lib/avm/eac_webapp_base0/apache_path.rb
eac_tools-0.27.1 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/apache_path.rb
avm-eac_webapp_base0-0.6.0 lib/avm/eac_webapp_base0/apache_path.rb
eac_tools-0.27.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/apache_path.rb