Sha256: fa90d406414849eb954bf327f45a898361fa66e75a20a5bdf479af502eeca803

Contents?: true

Size: 1.58 KB

Versions: 22

Compression:

Stored size: 1.58 KB

Contents

# frozen_string_literal: true

require 'addressable/uri'
require 'avm/eac_redmine_base0/instances/data_package'
require 'avm/eac_redmine_base0/instances/docker_image'
require 'avm/eac_redmine_base0/instances/runners'
require 'avm/eac_redmine_base0/instances/rest_api'
require 'avm/eac_rails_base1/instances/base'

module Avm
  module EacRedmineBase0
    module Instances
      class Base < ::Avm::EacRailsBase1::Instances::Base
        require_sub __FILE__, include_modules: true
        enable_simple_cache

        def docker_image_class
          ::Avm::EacRedmineBase0::Instances::DockerImage
        end

        def docker_run_arguments
          [
            '--volume',
            "#{install_path}:/home/myuser/eac_redmine_base0",
            '--publish', "#{read_entry(:ssh_port)}:22",
            '--publish', "#{read_entry(:http_port)}:80",
            '--publish', "#{read_entry(:https_port)}:443"
          ]
        end

        # @return [Avm::EacRedmineBase0::Instances::DataPackage]
        def data_package
          @data_package ||= ::Avm::EacRedmineBase0::Instances::DataPackage.new(self)
        end

        # @return [Addressable::URI]
        def root_url
          r = ::Addressable::URI.parse(read_entry(::Avm::Instances::EntryKeys::WEB_URL))
          r.query_values = nil
          r
        end

        private

        # @return [Avm::EacRedmineBase0::Instances::RestApi]
        def rest_api_uncached
          url = root_url
          url.query_values = { key: read_entry('api.key') }
          ::Avm::EacRedmineBase0::Instances::RestApi.new(url)
        end
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 2 rubygems

Version Path
eac_tools-0.55.6 sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base.rb
avm-eac_redmine_base0-0.18.1 lib/avm/eac_redmine_base0/instances/base.rb
eac_tools-0.55.5 sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base.rb
eac_tools-0.55.4 sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base.rb
eac_tools-0.55.3 sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base.rb
eac_tools-0.55.2 sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base.rb
eac_tools-0.55.1 sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base.rb
eac_tools-0.55.0 sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base.rb
eac_tools-0.54.0 sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base.rb
eac_tools-0.53.0 sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base.rb
eac_tools-0.52.0 sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base.rb
eac_tools-0.51.0 sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base.rb
eac_tools-0.50.0 sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base.rb
eac_tools-0.49.0 sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base.rb
eac_tools-0.48.1 sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base.rb
avm-eac_redmine_base0-0.18.0 lib/avm/eac_redmine_base0/instances/base.rb
eac_tools-0.48.0 sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base.rb
eac_tools-0.47.2 sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base.rb
eac_tools-0.47.1 sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base.rb
eac_tools-0.47.0 sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base.rb