eac_tools 0.45.1 → 0.46.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +35 -30
- data/lib/eac_tools/version.rb +1 -1
- data/sub/avm/avm.gemspec +2 -2
- data/sub/avm/lib/avm/data/callbacks.rb +37 -0
- data/sub/avm/lib/avm/data/package.rb +15 -7
- data/sub/avm/lib/avm/data/unit.rb +2 -23
- data/sub/avm/lib/avm/entries/uri_builder.rb +3 -1
- data/sub/avm/lib/avm/instances/base/auto_values/data.rb +1 -1
- data/sub/avm/lib/avm/instances/data/files_unit.rb +55 -0
- data/sub/avm/lib/avm/{data/instance → instances/data}/package.rb +2 -2
- data/sub/avm/lib/avm/instances/data/unit.rb +14 -0
- data/sub/avm/lib/avm/instances/data.rb +11 -0
- data/sub/avm/lib/avm/version.rb +1 -1
- data/sub/avm/spec/lib/avm/instances/base_spec.rb +3 -1
- data/sub/avm/spec/lib/avm/instances/base_spec_files/config.yml +2 -0
- data/sub/avm-eac_postgresql_base0/Gemfile +5 -0
- data/sub/avm-eac_postgresql_base0/avm-eac_postgresql_base0.gemspec +19 -0
- data/sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/instance/assert.rb +77 -0
- data/sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/instance/data_unit.rb +39 -0
- data/sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/instance.rb +74 -0
- data/sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/instance_with.rb +18 -0
- data/sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/version.rb +7 -0
- data/sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0.rb +9 -0
- data/sub/avm-eac_postgresql_base0/spec/rubocop_spec.rb +3 -0
- data/sub/avm-eac_postgresql_base0/spec/spec_helper.rb +4 -0
- data/sub/avm-eac_rails_base1/avm-eac_rails_base1.gemspec +4 -4
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/version.rb +1 -1
- data/sub/avm-eac_redmine_base0/avm-eac_redmine_base0.gemspec +5 -5
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base/files.rb +22 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base/gitolite.rb +11 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base/install.rb +37 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base.rb +3 -9
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/data_package.rb +23 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/deploy.rb +1 -19
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/version.rb +1 -1
- data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/deploy/config/install.sh.template +2 -2
- data/sub/avm-eac_redmine_plugin_base0/avm-eac_redmine_plugin_base0.gemspec +2 -2
- data/sub/avm-eac_redmine_plugin_base0/lib/avm/eac_redmine_plugin_base0/sources/base/init.rb +27 -0
- data/sub/avm-eac_redmine_plugin_base0/lib/avm/eac_redmine_plugin_base0/sources/base/parent.rb +31 -0
- data/sub/avm-eac_redmine_plugin_base0/lib/avm/eac_redmine_plugin_base0/sources/base/rubocop.rb +29 -0
- data/sub/avm-eac_redmine_plugin_base0/lib/avm/eac_redmine_plugin_base0/sources/base/version.rb +31 -0
- data/sub/avm-eac_redmine_plugin_base0/lib/avm/eac_redmine_plugin_base0/sources/base.rb +2 -36
- data/sub/avm-eac_redmine_plugin_base0/lib/avm/eac_redmine_plugin_base0/sources/init_file.rb +43 -0
- data/sub/avm-eac_redmine_plugin_base0/lib/avm/eac_redmine_plugin_base0/version.rb +1 -1
- data/sub/avm-eac_redmine_plugin_base0/spec/lib/avm/eac_redmine_plugin_base0/sources/init_file_spec.rb +14 -0
- data/sub/avm-eac_redmine_plugin_base0/spec/lib/avm/eac_redmine_plugin_base0/sources/init_file_spec_files/a_init_file.rb +12 -0
- data/sub/avm-eac_webapp_base0/avm-eac_webapp_base0.gemspec +3 -3
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base.rb +4 -4
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/version.rb +1 -1
- metadata +41 -15
- data/sub/avm/lib/avm/data/instance/files_unit.rb +0 -41
- data/sub/avm/lib/avm/data/instance/unit.rb +0 -17
- data/sub/avm/lib/avm/data/instance.rb +0 -11
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/data_unit.rb +0 -53
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/instances/entry_keys'
|
4
|
+
require 'avm/eac_postgresql_base0/instance'
|
5
|
+
|
6
|
+
module Avm
|
7
|
+
module EacPostgresqlBase0
|
8
|
+
module InstanceWith
|
9
|
+
def pg
|
10
|
+
@pg ||= ::Avm::EacPostgresqlBase0::Instance.new(
|
11
|
+
host_env, user: read_entry(::Avm::Instances::EntryKeys::DATABASE_USERNAME),
|
12
|
+
password: read_entry(::Avm::Instances::EntryKeys::DATABASE_PASSWORD),
|
13
|
+
name: read_entry(::Avm::Instances::EntryKeys::DATABASE_NAME)
|
14
|
+
)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -12,10 +12,10 @@ Gem::Specification.new do |s|
|
|
12
12
|
|
13
13
|
s.files = Dir['{lib,template}/**/*']
|
14
14
|
|
15
|
-
s.add_dependency 'avm', '~> 0.
|
16
|
-
s.add_dependency 'avm-eac_ruby_base1', '~> 0.
|
17
|
-
s.add_dependency 'avm-eac_webapp_base0', '~> 0.
|
18
|
-
s.add_dependency 'eac_ruby_utils', '~> 0.
|
15
|
+
s.add_dependency 'avm', '~> 0.57'
|
16
|
+
s.add_dependency 'avm-eac_ruby_base1', '~> 0.27', '>= 0.27.1'
|
17
|
+
s.add_dependency 'avm-eac_webapp_base0', '~> 0.12', '>= 0.12.3'
|
18
|
+
s.add_dependency 'eac_ruby_utils', '~> 0.107', '>= 0.107.1'
|
19
19
|
|
20
20
|
s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5.1'
|
21
21
|
end
|
@@ -12,14 +12,14 @@ Gem::Specification.new do |s|
|
|
12
12
|
|
13
13
|
s.files = Dir['{lib,locale,template}/**/*']
|
14
14
|
|
15
|
-
s.add_dependency 'avm', '~> 0.
|
16
|
-
s.add_dependency 'avm-eac_generic_base0', '~> 0.
|
17
|
-
s.add_dependency 'avm-eac_rails_base1', '~> 0.
|
15
|
+
s.add_dependency 'avm', '~> 0.57'
|
16
|
+
s.add_dependency 'avm-eac_generic_base0', '~> 0.8'
|
17
|
+
s.add_dependency 'avm-eac_rails_base1', '~> 0.7', '>= 0.7.1'
|
18
18
|
s.add_dependency 'avm-eac_ubuntu_base0', '~> 0.3'
|
19
19
|
s.add_dependency 'curb', '~> 0.9', '>= 0.9.11'
|
20
|
-
s.add_dependency 'eac_fs', '~> 0.
|
20
|
+
s.add_dependency 'eac_fs', '~> 0.15'
|
21
21
|
s.add_dependency 'eac_rest', '~> 0.6', '>= 0.6.1'
|
22
|
-
s.add_dependency 'eac_ruby_utils', '~> 0.
|
22
|
+
s.add_dependency 'eac_ruby_utils', '~> 0.107', '>= 0.107.1'
|
23
23
|
|
24
24
|
s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5.1'
|
25
25
|
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/eac_rails_base1/instances/base'
|
4
|
+
require 'avm/instances/data/files_unit'
|
5
|
+
require 'eac_ruby_utils/core_ext'
|
6
|
+
|
7
|
+
module Avm
|
8
|
+
module EacRedmineBase0
|
9
|
+
module Instances
|
10
|
+
class Base < ::Avm::EacRailsBase1::Instances::Base
|
11
|
+
module Files
|
12
|
+
FILES_SUBPATH = 'files'
|
13
|
+
|
14
|
+
# @return [Avm::Instances::Data::FilesUnit]
|
15
|
+
def files_data_unit
|
16
|
+
::Avm::Instances::Data::FilesUnit.new(self, FILES_SUBPATH)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -18,6 +18,12 @@ module Avm
|
|
18
18
|
uri_components_entries_values GITOLITE_ENTRY_KEYS_PREFIX
|
19
19
|
end
|
20
20
|
|
21
|
+
# @return [Avm::Instances::Data::FilesUnit]
|
22
|
+
def gitolite_data_unit
|
23
|
+
::Avm::Instances::Data::FilesUnit.new(self, gitolite_repositories_path,
|
24
|
+
sudo_user: entry('gitolite.username').value!)
|
25
|
+
end
|
26
|
+
|
21
27
|
def gitolite_hostname_default_value
|
22
28
|
DEFAULT_HOSTNAME
|
23
29
|
end
|
@@ -28,6 +34,11 @@ module Avm
|
|
28
34
|
end
|
29
35
|
end
|
30
36
|
|
37
|
+
# @return [Pathname]
|
38
|
+
def gitolite_repositories_path
|
39
|
+
entry('gitolite.path').value!.to_pathname.join('repositories')
|
40
|
+
end
|
41
|
+
|
31
42
|
def gitolite_scheme_default_value
|
32
43
|
DEFAULT_SCHEME
|
33
44
|
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/eac_rails_base1/instances/base'
|
4
|
+
require 'eac_ruby_utils/core_ext'
|
5
|
+
|
6
|
+
module Avm
|
7
|
+
module EacRedmineBase0
|
8
|
+
module Instances
|
9
|
+
class Base < ::Avm::EacRailsBase1::Instances::Base
|
10
|
+
module Install
|
11
|
+
def run_installer
|
12
|
+
::EacRubyUtils::Ruby.on_clean_environment do
|
13
|
+
installer_command.system!
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def installer_command
|
18
|
+
host_env.command(installer_path, install_task)
|
19
|
+
end
|
20
|
+
|
21
|
+
def installer_path
|
22
|
+
::File.join(install_path, 'plugins', 'redmine_installer', 'installer',
|
23
|
+
'run.sh')
|
24
|
+
end
|
25
|
+
|
26
|
+
def install_task
|
27
|
+
if web_path_optional.present?
|
28
|
+
'redmine_as_apache_path'
|
29
|
+
else
|
30
|
+
'redmine_as_apache_base'
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'addressable/uri'
|
4
|
-
require 'avm/eac_redmine_base0/instances/
|
4
|
+
require 'avm/eac_redmine_base0/instances/data_package'
|
5
5
|
require 'avm/eac_redmine_base0/instances/docker_image'
|
6
6
|
require 'avm/eac_redmine_base0/instances/runners'
|
7
7
|
require 'avm/eac_redmine_base0/instances/rest_api'
|
@@ -14,8 +14,6 @@ module Avm
|
|
14
14
|
require_sub __FILE__, include_modules: true
|
15
15
|
enable_simple_cache
|
16
16
|
|
17
|
-
FILES_UNITS = { files: 'files' }.freeze
|
18
|
-
|
19
17
|
def docker_image_class
|
20
18
|
::Avm::EacRedmineBase0::Instances::DockerImage
|
21
19
|
end
|
@@ -30,13 +28,9 @@ module Avm
|
|
30
28
|
]
|
31
29
|
end
|
32
30
|
|
31
|
+
# @return [Avm::EacRedmineBase0::Instances::DataPackage]
|
33
32
|
def data_package
|
34
|
-
@data_package ||= ::Avm::
|
35
|
-
self,
|
36
|
-
units: {
|
37
|
-
all: ::Avm::EacRedmineBase0::Instances::DataUnit.new(self)
|
38
|
-
}
|
39
|
-
)
|
33
|
+
@data_package ||= ::Avm::EacRedmineBase0::Instances::DataPackage.new(self)
|
40
34
|
end
|
41
35
|
|
42
36
|
# @return [Addressable::URI]
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/instances/data/package'
|
4
|
+
require 'eac_ruby_utils/core_ext'
|
5
|
+
|
6
|
+
module Avm
|
7
|
+
module EacRedmineBase0
|
8
|
+
module Instances
|
9
|
+
class DataPackage < ::Avm::Instances::Data::Package
|
10
|
+
after_load :run_installer
|
11
|
+
|
12
|
+
def initialize(instance, options = {})
|
13
|
+
super(instance, options.merge(units: options[:units].if_present({}).merge(
|
14
|
+
database: instance.database_unit, files: instance.files_data_unit,
|
15
|
+
gitolite: instance.gitolite_data_unit
|
16
|
+
)))
|
17
|
+
end
|
18
|
+
|
19
|
+
delegate :run_installer, to: :instance
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -11,25 +11,7 @@ module Avm
|
|
11
11
|
|
12
12
|
def run_installer
|
13
13
|
infom 'Running installer'
|
14
|
-
|
15
|
-
installer_command.system!
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
def installer_command
|
20
|
-
instance.host_env.command(installer_path, install_task)
|
21
|
-
end
|
22
|
-
|
23
|
-
def installer_path
|
24
|
-
::File.join(instance.install_path, 'plugins', 'redmine_installer', 'installer', 'run.sh')
|
25
|
-
end
|
26
|
-
|
27
|
-
def install_task
|
28
|
-
if instance.web_path_optional.present?
|
29
|
-
'redmine_as_apache_path'
|
30
|
-
else
|
31
|
-
'redmine_as_apache_base'
|
32
|
-
end
|
14
|
+
instance.run_installer
|
33
15
|
end
|
34
16
|
end
|
35
17
|
end
|
@@ -22,8 +22,8 @@ export address_path='%%WEB.PATH%%'
|
|
22
22
|
|
23
23
|
# Git
|
24
24
|
export git_repositories_hierarchical_organisation=false
|
25
|
-
export gitolite_user='%%
|
26
|
-
export gitolite_user_home=
|
25
|
+
export gitolite_user='%%GITOLITE.USERNAME%%'
|
26
|
+
export gitolite_user_home='%%GITOLITE.PATH%%'
|
27
27
|
export redmine_git_hosting_ssh_key_name=redmine_git_hosting_id
|
28
28
|
|
29
29
|
# Mail settings
|
@@ -12,8 +12,8 @@ Gem::Specification.new do |s|
|
|
12
12
|
|
13
13
|
s.files = Dir['{lib}/**/*']
|
14
14
|
|
15
|
-
s.add_dependency 'avm-eac_ruby_base1', '~> 0.
|
16
|
-
s.add_dependency 'eac_ruby_utils', '~> 0.
|
15
|
+
s.add_dependency 'avm-eac_ruby_base1', '~> 0.27', '>= 0.27.1'
|
16
|
+
s.add_dependency 'eac_ruby_utils', '~> 0.107', '>= 0.107.1'
|
17
17
|
|
18
18
|
s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5', '>= 0.5.1'
|
19
19
|
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/eac_redmine_plugin_base0/sources/init_file'
|
4
|
+
require 'avm/eac_ruby_base1/sources/base'
|
5
|
+
require 'eac_ruby_utils/core_ext'
|
6
|
+
|
7
|
+
module Avm
|
8
|
+
module EacRedminePluginBase0
|
9
|
+
module Sources
|
10
|
+
class Base < ::Avm::EacRubyBase1::Sources::Base
|
11
|
+
module Init
|
12
|
+
INIT_SUBPATH = 'init.rb'
|
13
|
+
|
14
|
+
# @return [Avm::EacRedminePluginBase0::Sources::InitFile]
|
15
|
+
def init_file
|
16
|
+
::Avm::EacRedminePluginBase0::Sources::InitFile.new(init_path)
|
17
|
+
end
|
18
|
+
|
19
|
+
# @return [String]
|
20
|
+
def init_path
|
21
|
+
path.join(INIT_SUBPATH)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/eac_ruby_base1/sources/base'
|
4
|
+
require 'eac_ruby_utils/core_ext'
|
5
|
+
|
6
|
+
module Avm
|
7
|
+
module EacRedminePluginBase0
|
8
|
+
module Sources
|
9
|
+
class Base < ::Avm::EacRubyBase1::Sources::Base
|
10
|
+
module Parent
|
11
|
+
PARENT_RAKE_TASK_TEST_NAME = 'parent_rake_task'
|
12
|
+
|
13
|
+
# @return [String]
|
14
|
+
def parent_rake_test_task_name
|
15
|
+
[gem_name, 'test'].map(&:variableize).join(':')
|
16
|
+
end
|
17
|
+
|
18
|
+
# @return [Boolean]
|
19
|
+
def parent_rake_test_command?
|
20
|
+
ruby_parent.rake_task?(parent_rake_test_task_name)
|
21
|
+
end
|
22
|
+
|
23
|
+
# @return [EacRubyUtils::Envs::Command]
|
24
|
+
def parent_rake_test_command
|
25
|
+
ruby_parent.rake(parent_rake_test_task_name).chdir_root.envvar('RAILS_ENV', 'test')
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
data/sub/avm-eac_redmine_plugin_base0/lib/avm/eac_redmine_plugin_base0/sources/base/rubocop.rb
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/eac_ruby_base1/sources/base'
|
4
|
+
require 'eac_ruby_utils/core_ext'
|
5
|
+
|
6
|
+
module Avm
|
7
|
+
module EacRedminePluginBase0
|
8
|
+
module Sources
|
9
|
+
class Base < ::Avm::EacRubyBase1::Sources::Base
|
10
|
+
module Rubocop
|
11
|
+
RUBOCOP_GEM_NAME = 'rubocop'
|
12
|
+
RUBOCOP_TEST_NAME = 'rubocop'
|
13
|
+
|
14
|
+
# @return [EacRubyUtils::Envs::Command]
|
15
|
+
def rubocop_test_command
|
16
|
+
bundle('exec', 'rubocop', '--ignore-parent-exclusion')
|
17
|
+
.envvar('RAILS_ENV', 'test')
|
18
|
+
.chdir_root
|
19
|
+
end
|
20
|
+
|
21
|
+
# @return [Boolean]
|
22
|
+
def rubocop_test_command?
|
23
|
+
gemfile_path.exist? && gemfile_lock_gem_version(RUBOCOP_GEM_NAME).present?
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
data/sub/avm-eac_redmine_plugin_base0/lib/avm/eac_redmine_plugin_base0/sources/base/version.rb
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/eac_ruby_base1/sources/base'
|
4
|
+
require 'eac_ruby_utils/core_ext'
|
5
|
+
|
6
|
+
module Avm
|
7
|
+
module EacRedminePluginBase0
|
8
|
+
module Sources
|
9
|
+
class Base < ::Avm::EacRubyBase1::Sources::Base
|
10
|
+
module Version
|
11
|
+
# @return [Avm::VersionNumber]
|
12
|
+
def version
|
13
|
+
if version_file_path.exist?
|
14
|
+
super
|
15
|
+
else
|
16
|
+
init_file.version
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def version=(value)
|
21
|
+
if version_file_path.exist?
|
22
|
+
super
|
23
|
+
else
|
24
|
+
init_file.version = value
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -7,11 +7,9 @@ module Avm
|
|
7
7
|
module EacRedminePluginBase0
|
8
8
|
module Sources
|
9
9
|
class Base < ::Avm::EacRubyBase1::Sources::Base
|
10
|
+
require_sub __FILE__, include_modules: true
|
11
|
+
|
10
12
|
DEFAULT_GEMFILE_PATH = 'SelfGemfile'
|
11
|
-
RUBOCOP_GEM_NAME = 'rubocop'
|
12
|
-
RUBOCOP_TEST_NAME = 'rubocop'
|
13
|
-
PARENT_RAKE_TASK_TEST_NAME = 'parent_rake_task'
|
14
|
-
INIT_SUBPATH = 'init.rb'
|
15
13
|
|
16
14
|
# @return [String]
|
17
15
|
def default_gemfile_path
|
@@ -26,38 +24,6 @@ module Avm
|
|
26
24
|
r
|
27
25
|
end
|
28
26
|
|
29
|
-
# @return [String]
|
30
|
-
def init_path
|
31
|
-
path.join(INIT_SUBPATH)
|
32
|
-
end
|
33
|
-
|
34
|
-
# @return [String]
|
35
|
-
def parent_rake_test_task_name
|
36
|
-
[gem_name, 'test'].map(&:variableize).join(':')
|
37
|
-
end
|
38
|
-
|
39
|
-
# @return [Boolean]
|
40
|
-
def parent_rake_test_command?
|
41
|
-
ruby_parent.rake_task?(parent_rake_test_task_name)
|
42
|
-
end
|
43
|
-
|
44
|
-
# @return [EacRubyUtils::Envs::Command]
|
45
|
-
def parent_rake_test_command
|
46
|
-
ruby_parent.rake(parent_rake_test_task_name).chdir_root.envvar('RAILS_ENV', 'test')
|
47
|
-
end
|
48
|
-
|
49
|
-
# @return [EacRubyUtils::Envs::Command]
|
50
|
-
def rubocop_test_command
|
51
|
-
bundle('exec', 'rubocop', '--ignore-parent-exclusion')
|
52
|
-
.envvar('RAILS_ENV', 'test')
|
53
|
-
.chdir_root
|
54
|
-
end
|
55
|
-
|
56
|
-
# @return [Boolean]
|
57
|
-
def rubocop_test_command?
|
58
|
-
gemfile_path.exist? && gemfile_lock_gem_version(RUBOCOP_GEM_NAME).present?
|
59
|
-
end
|
60
|
-
|
61
27
|
# @return [Boolean]
|
62
28
|
def valid?
|
63
29
|
init_path.exist?
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
4
|
+
|
5
|
+
module Avm
|
6
|
+
module EacRedminePluginBase0
|
7
|
+
module Sources
|
8
|
+
class InitFile
|
9
|
+
common_constructor :path
|
10
|
+
|
11
|
+
VERSION_LINE_PATTERN = /\A(\s*)version\s*[\'\"]([^\'\"]+)[\'\"](\s*)\z/.freeze
|
12
|
+
|
13
|
+
def version
|
14
|
+
path.read.each_line.lazy.map { |line| line_value(line) }.find { |v| v }
|
15
|
+
end
|
16
|
+
|
17
|
+
def version=(new_value)
|
18
|
+
path.write(new_value_content(new_value))
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
# @return Version found in line, nil otherwise.
|
24
|
+
def line_value(line)
|
25
|
+
VERSION_LINE_PATTERN.if_match(line.rstrip, false) { |m| ::Gem::Version.new(m[2]) }
|
26
|
+
end
|
27
|
+
|
28
|
+
def new_value_content(new_value)
|
29
|
+
path.read.each_line
|
30
|
+
.map { |line| new_value_line(line, new_value) }
|
31
|
+
.join
|
32
|
+
end
|
33
|
+
|
34
|
+
def new_value_line(line, new_value)
|
35
|
+
m = VERSION_LINE_PATTERN.match(line)
|
36
|
+
return line unless m
|
37
|
+
|
38
|
+
"#{m[1]}version '#{new_value}'"
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/eac_redmine_plugin_base0/sources/init_file'
|
4
|
+
|
5
|
+
::RSpec.describe ::Avm::EacRedminePluginBase0::Sources::InitFile do
|
6
|
+
let(:stubs_dir) { ::Pathname.new(__dir__).join('init_file_spec_files') }
|
7
|
+
let(:stub_file) { stubs_dir.join('a_init_file.rb') }
|
8
|
+
let(:instance) { described_class.new(stub_file) }
|
9
|
+
let(:target_version) { ::Gem::Version.new('0.16.0') }
|
10
|
+
|
11
|
+
describe '#version' do
|
12
|
+
it { expect(instance.version).to eq(target_version) }
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'redmine'
|
4
|
+
|
5
|
+
Redmine::Plugin.register :redmine_installer do
|
6
|
+
name 'Redmine Installer'
|
7
|
+
author 'Eduardo Henrique Bogoni'
|
8
|
+
description 'Installer for Redmine.'
|
9
|
+
url 'https://github.com/esquilo-azul/redmine_installer'
|
10
|
+
author_url 'https://github.com/eduardobogoni/'
|
11
|
+
version '0.16.0'
|
12
|
+
end
|
@@ -12,12 +12,12 @@ Gem::Specification.new do |s|
|
|
12
12
|
|
13
13
|
s.files = Dir['{lib,template}/**/*']
|
14
14
|
|
15
|
-
s.add_dependency 'avm', '~> 0.
|
15
|
+
s.add_dependency 'avm', '~> 0.57'
|
16
16
|
s.add_dependency 'avm-eac_generic_base0', '~> 0.8'
|
17
|
-
s.add_dependency 'avm-eac_postgresql_base0', '~> 0.2'
|
17
|
+
s.add_dependency 'avm-eac_postgresql_base0', '~> 0.2', '>= 0.2.1'
|
18
18
|
s.add_dependency 'avm-eac_ubuntu_base0', '~> 0.3'
|
19
19
|
s.add_dependency 'avm-files', '~> 0.6'
|
20
|
-
s.add_dependency 'eac_ruby_utils', '~> 0.
|
20
|
+
s.add_dependency 'eac_ruby_utils', '~> 0.107', '>= 0.107.1'
|
21
21
|
|
22
22
|
s.add_development_dependency 'eac_ruby_gem_support', '~> 0.2'
|
23
23
|
end
|
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
require 'avm/instances/base'
|
4
4
|
require 'avm/eac_postgresql_base0/instance_with'
|
5
|
-
require 'avm/data/
|
6
|
-
require 'avm/data/
|
5
|
+
require 'avm/instances/data/files_unit'
|
6
|
+
require 'avm/instances/data/package'
|
7
7
|
require 'avm/eac_webapp_base0/instances/deploy/file_unit'
|
8
8
|
require 'avm/eac_webapp_base0/instances/runners'
|
9
9
|
require 'avm/eac_ubuntu_base0/instances/base'
|
@@ -34,7 +34,7 @@ module Avm
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def data_package
|
37
|
-
@data_package ||= ::Avm::Data::
|
37
|
+
@data_package ||= ::Avm::Instances::Data::Package.new(
|
38
38
|
self, units: { database: database_unit }.merge(files_units)
|
39
39
|
)
|
40
40
|
end
|
@@ -52,7 +52,7 @@ module Avm
|
|
52
52
|
|
53
53
|
def files_units
|
54
54
|
self.class.const_get('FILES_UNITS').transform_values do |fs_path_subpath|
|
55
|
-
::Avm::Data::
|
55
|
+
::Avm::Instances::Data::FilesUnit.new(self, fs_path_subpath)
|
56
56
|
end
|
57
57
|
end
|
58
58
|
end
|