Sha256: 124870e16a61bb3eb15f869ea2ee31e556b702ac71d51bbb07a7c8730968565b

Contents?: true

Size: 1.71 KB

Versions: 37

Compression:

Stored size: 1.71 KB

Contents

# frozen_string_literal: true

require 'addressable/uri'
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'
require 'avm/eac_ruby_base1/instances/mixin'

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

        include ::Avm::EacRubyBase1::Instances::Mixin

        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::Instances::Data::Package]
        def data_package_create
          r = super.add_unit('files', files_data_unit).add_unit('gitolite', gitolite_data_unit)
          r.after_load { instance.run_installer }
          r
        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: admin_api_key }
          ::Avm::EacRedmineBase0::Instances::RestApi.new(url)
        end
      end
    end
  end
end

Version data entries

37 entries across 37 versions & 2 rubygems

Version Path
eac_tools-0.83.0 sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base.rb
eac_tools-0.82.0 sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base.rb
eac_tools-0.81.0 sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base.rb
avm-eac_redmine_base0-0.22.0 lib/avm/eac_redmine_base0/instances/base.rb
eac_tools-0.80.0 sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base.rb
avm-eac_redmine_base0-0.21.2 lib/avm/eac_redmine_base0/instances/base.rb
eac_tools-0.79.0 sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base.rb
avm-eac_redmine_base0-0.21.1 lib/avm/eac_redmine_base0/instances/base.rb
eac_tools-0.78.0 sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base.rb
eac_tools-0.77.1 sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base.rb
eac_tools-0.77.0 sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base.rb
eac_tools-0.76.1 sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base.rb
avm-eac_redmine_base0-0.21.0 lib/avm/eac_redmine_base0/instances/base.rb
eac_tools-0.76.0 sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base.rb
eac_tools-0.75.2 sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base.rb
eac_tools-0.75.1 sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base.rb
eac_tools-0.75.0 sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base.rb
eac_tools-0.74.1 sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base.rb
eac_tools-0.74.0 sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base.rb
eac_tools-0.73.0 sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base.rb