eac_tools 0.111.0 → 0.111.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +34 -49
- data/eac_tools.gemspec +41 -0
- data/exe/eac +6 -1
- data/lib/eac_tools/version.rb +1 -1
- metadata +7 -140
- data/sub/avm-eac_rails_base1/Gemfile +0 -8
- data/sub/avm-eac_rails_base1/avm-eac_rails_base1.gemspec +0 -22
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/apache_base.rb +0 -14
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/apache_host.rb +0 -15
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/apache_path.rb +0 -17
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/base/install.rb +0 -25
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/base.rb +0 -44
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/deploy.rb +0 -20
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/processes/daemon.rb +0 -36
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/processes/tasks_scheduler.rb +0 -24
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/runners/bundle.rb +0 -26
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/runners/code_runner.rb +0 -25
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/runners/log.rb +0 -43
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/runners/logs/clear.rb +0 -25
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/runners/logs.rb +0 -16
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/runners/rails_server.rb +0 -31
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/runners/tasks_scheduler/systemd_unit.rb +0 -45
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/runners/tasks_scheduler.rb +0 -15
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/systemd_unit/service.rb +0 -70
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/systemd_unit/tasks_scheduler_command.rb +0 -29
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/systemd_unit.rb +0 -56
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner_with/bundle.rb +0 -23
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner_with/rails_environment.rb +0 -42
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/sources/base.rb +0 -40
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/version.rb +0 -7
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1.rb +0 -12
- data/sub/avm-eac_rails_base1/spec/meta/rubocop_spec.rb +0 -3
- data/sub/avm-eac_rails_base1/spec/spec_helper.rb +0 -6
- data/sub/avm-eac_rails_base1/template/avm/eac_rails_base1/instances/apache_path/extra_content.conf +0 -6
- data/sub/avm-eac_rails_base1/template/avm/eac_rails_base1/instances/systemd_unit/tasks_scheduler.service +0 -12
- data/sub/avm-eac_rails_base1/template/avm/eac_rails_base1/instances/systemd_unit/tasks_scheduler_command.sh +0 -6
- data/sub/avm-eac_redmine_base0/Gemfile +0 -8
- data/sub/avm-eac_redmine_base0/avm-eac_redmine_base0.gemspec +0 -26
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/apache_host.rb +0 -10
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base/database.rb +0 -27
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base/files.rb +0 -18
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base/gitolite.rb +0 -52
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base/install.rb +0 -43
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base/nodejs.rb +0 -19
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base/web.rb +0 -17
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base.rb +0 -63
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/deploy.rb +0 -16
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/docker_image.rb +0 -110
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/rest_api/entity_base.rb +0 -31
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/rest_api/project.rb +0 -21
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/rest_api/root.rb +0 -17
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/rest_api/wiki_page.rb +0 -50
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/rest_api.rb +0 -10
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/runners/docker.rb +0 -15
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/runners/project/wiki_page/read.rb +0 -25
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/runners/project/wiki_page/write.rb +0 -68
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/runners/project/wiki_page.rb +0 -26
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/runners/project.rb +0 -22
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/runners/project_rename.rb +0 -53
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/sources/base/default_settings.rb +0 -40
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/sources/base.rb +0 -34
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/sources/core_update.rb +0 -125
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/sources/runners/core_update.rb +0 -61
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/sources/runners/docker.rb +0 -16
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/version.rb +0 -7
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0.rb +0 -16
- data/sub/avm-eac_redmine_base0/locale/en.yml +0 -6
- data/sub/avm-eac_redmine_base0/locale/pt-BR.yml +0 -6
- data/sub/avm-eac_redmine_base0/spec/lib/avm/eac_redmine_base0/instances/apache_host_spec.rb +0 -19
- data/sub/avm-eac_redmine_base0/spec/lib/avm/eac_redmine_base0/instances/apache_host_spec_files/apache_host_spec_no_ssl_content.conf +0 -11
- data/sub/avm-eac_redmine_base0/spec/lib/avm/eac_redmine_base0/instances/base/gitolite_spec.rb +0 -24
- data/sub/avm-eac_redmine_base0/spec/lib/avm/eac_redmine_base0/instances/base/gitolite_spec_files/config.yml +0 -10
- data/sub/avm-eac_redmine_base0/spec/meta/rubocop_spec.rb +0 -3
- data/sub/avm-eac_redmine_base0/spec/spec_helper.rb +0 -6
- data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/deploy/config/install.sh.template +0 -46
- data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/deploy/config/secrets.yml +0 -8
- data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/docker_image/Dockerfile.template +0 -37
- data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/docker_image/apache_host_dockerfile +0 -8
- data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/docker_image/apache_http_virtualhost.conf.template +0 -10
- data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/docker_image/apache_https_virtualhost.conf.template +0 -16
- data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/docker_image/apache_path_dockerfile +0 -5
- data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/docker_image/start.sh.template +0 -53
- data/sub/avm-eac_webapp_base0/Gemfile +0 -8
- data/sub/avm-eac_webapp_base0/avm-eac_webapp_base0.gemspec +0 -24
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/executables.rb +0 -23
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/file_formats/css/file_apply.rb +0 -44
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/file_formats/css.rb +0 -17
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/file_formats/html.rb +0 -42
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/file_formats/javascript.rb +0 -19
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/file_formats/json.rb +0 -23
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/file_formats/provider.rb +0 -17
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/file_formats/xml.rb +0 -23
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/apache_base.rb +0 -28
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/apache_host.rb +0 -72
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/apache_path.rb +0 -37
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base/apache.rb +0 -42
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base/deploy.rb +0 -24
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base/deploy_info.rb +0 -27
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base/install.rb +0 -24
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base.rb +0 -37
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy/appended_directories.rb +0 -25
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy/build.rb +0 -45
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy/info.rb +0 -44
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy/scm.rb +0 -88
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy/setup_files_unit.rb +0 -53
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy/write_on_target.rb +0 -18
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy.rb +0 -70
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy_info.rb +0 -35
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/processes/web_server.rb +0 -34
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/runners/apache_host.rb +0 -34
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/runners/apache_path.rb +0 -38
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/runners/deploy.rb +0 -47
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/runners/deploy_info.rb +0 -24
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/sources/base.rb +0 -13
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/version.rb +0 -7
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0.rb +0 -14
- data/sub/avm-eac_webapp_base0/spec/lib/avm/eac_webapp_base0/file_formats/css_spec.rb +0 -7
- data/sub/avm-eac_webapp_base0/spec/lib/avm/eac_webapp_base0/file_formats/css_spec_files/css1.source.css +0 -11
- data/sub/avm-eac_webapp_base0/spec/lib/avm/eac_webapp_base0/file_formats/css_spec_files/css1.target.css +0 -11
- data/sub/avm-eac_webapp_base0/spec/lib/avm/eac_webapp_base0/file_formats/html_spec.rb +0 -7
- data/sub/avm-eac_webapp_base0/spec/lib/avm/eac_webapp_base0/file_formats/html_spec_files/html_code.html.erb.source +0 -8
- data/sub/avm-eac_webapp_base0/spec/lib/avm/eac_webapp_base0/file_formats/html_spec_files/html_code.html.erb.target +0 -8
- data/sub/avm-eac_webapp_base0/spec/lib/avm/eac_webapp_base0/file_formats/html_spec_files/html_code.html.source +0 -5
- data/sub/avm-eac_webapp_base0/spec/lib/avm/eac_webapp_base0/file_formats/html_spec_files/html_code.html.target +0 -5
- data/sub/avm-eac_webapp_base0/spec/lib/avm/eac_webapp_base0/file_formats/javascript_spec.rb +0 -7
- data/sub/avm-eac_webapp_base0/spec/lib/avm/eac_webapp_base0/file_formats/javascript_spec_files/javascript_code1.js.source +0 -29
- data/sub/avm-eac_webapp_base0/spec/lib/avm/eac_webapp_base0/file_formats/javascript_spec_files/javascript_code1.js.target +0 -21
- data/sub/avm-eac_webapp_base0/spec/lib/avm/eac_webapp_base0/file_formats/json_spec.rb +0 -7
- data/sub/avm-eac_webapp_base0/spec/lib/avm/eac_webapp_base0/file_formats/json_spec_files/json_code.json.source +0 -8
- data/sub/avm-eac_webapp_base0/spec/lib/avm/eac_webapp_base0/file_formats/json_spec_files/json_code.json.target +0 -7
- data/sub/avm-eac_webapp_base0/spec/lib/avm/eac_webapp_base0/file_formats/xml_spec.rb +0 -7
- data/sub/avm-eac_webapp_base0/spec/lib/avm/eac_webapp_base0/file_formats/xml_spec_files/xml_code.xml.source +0 -11
- data/sub/avm-eac_webapp_base0/spec/lib/avm/eac_webapp_base0/file_formats/xml_spec_files/xml_code.xml.target +0 -9
- data/sub/avm-eac_webapp_base0/spec/lib/avm/eac_webapp_base0/instances/base_spec.rb +0 -11
- data/sub/avm-eac_webapp_base0/spec/lib/avm/eac_webapp_base0/sources/base_spec.rb +0 -7
- data/sub/avm-eac_webapp_base0/spec/meta/rubocop_spec.rb +0 -3
- data/sub/avm-eac_webapp_base0/spec/spec_helper.rb +0 -5
- data/sub/avm-eac_webapp_base0/template/avm/eac_webapp_base0/instances/apache_host/no_ssl.conf +0 -11
- data/sub/avm-eac_webapp_base0/template/avm/eac_webapp_base0/instances/apache_path/default.conf +0 -7
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Avm
|
|
4
|
-
module EacWebappBase0
|
|
5
|
-
module Instances
|
|
6
|
-
class Deploy
|
|
7
|
-
module Scm
|
|
8
|
-
DEFAULT_REMOTE_NAME = 'origin'
|
|
9
|
-
DEFAULT_REMOTE_READ = true
|
|
10
|
-
DEFAULT_REMOTE_WRITE = true
|
|
11
|
-
|
|
12
|
-
def commit_reference_uncached
|
|
13
|
-
git_fetch
|
|
14
|
-
r = git.rev_parse(git_reference_found)
|
|
15
|
-
return r if r
|
|
16
|
-
|
|
17
|
-
raise ::Avm::Result::Error, "No commit SHA1 found for \"#{git_reference_found}\""
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
def git_fetch_uncached
|
|
21
|
-
return unless remote_read?
|
|
22
|
-
|
|
23
|
-
infom "Fetching remote \"#{git_remote_name}\" from \"#{git_repository_path}\"..."
|
|
24
|
-
git.remote(git_remote_name).fetch
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
def git_reference
|
|
28
|
-
options[OPTION_REFERENCE] || DEFAULT_REFERENCE
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
def git_reference_found_uncached
|
|
32
|
-
%w[git_reference instance_branch master_branch].map { |b| send(b) }.find(&:present?) ||
|
|
33
|
-
raise(
|
|
34
|
-
::Avm::Result::Error,
|
|
35
|
-
'No git reference found (Searched for option, instance and master)'
|
|
36
|
-
)
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
def git_remote_hashs_uncached
|
|
40
|
-
return {} unless remote_read?
|
|
41
|
-
|
|
42
|
-
git.remote(git_remote_name).ls.hashes
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
def git_remote_name
|
|
46
|
-
DEFAULT_REMOTE_NAME
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
def git_repository_path
|
|
50
|
-
instance.source_instance.read_entry(::Avm::Instances::EntryKeys::INSTALL_PATH)
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
# @return [EacGit::Local]
|
|
54
|
-
def git_uncached
|
|
55
|
-
scm.git_repo
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
def instance_branch
|
|
59
|
-
remote_branch(instance.id)
|
|
60
|
-
end
|
|
61
|
-
|
|
62
|
-
def remote_branch(name)
|
|
63
|
-
git_remote_hashs.key?("refs/heads/#{name}") ? "#{git_remote_name}/#{name}" : nil
|
|
64
|
-
end
|
|
65
|
-
|
|
66
|
-
def master_branch
|
|
67
|
-
remote_branch('master')
|
|
68
|
-
end
|
|
69
|
-
|
|
70
|
-
# @return [Boolean]
|
|
71
|
-
def remote_read?
|
|
72
|
-
options.if_key(OPTION_REMOTE_READ, DEFAULT_REMOTE_READ).to_bool
|
|
73
|
-
end
|
|
74
|
-
|
|
75
|
-
# @return [Boolean]
|
|
76
|
-
def remote_write?
|
|
77
|
-
options.if_key(OPTION_REMOTE_WRITE, DEFAULT_REMOTE_WRITE).to_bool
|
|
78
|
-
end
|
|
79
|
-
|
|
80
|
-
# @return [Avm::Scms::Base]
|
|
81
|
-
def scm
|
|
82
|
-
instance.application.local_source.scm
|
|
83
|
-
end
|
|
84
|
-
end
|
|
85
|
-
end
|
|
86
|
-
end
|
|
87
|
-
end
|
|
88
|
-
end
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Avm
|
|
4
|
-
module EacWebappBase0
|
|
5
|
-
module Instances
|
|
6
|
-
class Deploy
|
|
7
|
-
class SetupFilesUnit < ::SimpleDelegator
|
|
8
|
-
enable_method_class
|
|
9
|
-
attr_reader :data_key, :fs_path_subpath
|
|
10
|
-
|
|
11
|
-
def initialize(deploy, data_key, fs_path_subpath)
|
|
12
|
-
super(deploy)
|
|
13
|
-
@data_key = data_key
|
|
14
|
-
@fs_path_subpath = fs_path_subpath
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
def result
|
|
18
|
-
assert_source_directory
|
|
19
|
-
link_source_target
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
def assert_source_directory
|
|
23
|
-
infom "Asserting \"#{data_key}\" source directory..."
|
|
24
|
-
instance.host_env.command('mkdir', '-p', source_path).execute!
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
def source_path
|
|
28
|
-
::File.join(instance.install_data_path, data_key.to_s)
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
def target_path
|
|
32
|
-
::File.join(instance.read_entry(::Avm::Instances::EntryKeys::INSTALL_PATH),
|
|
33
|
-
fs_path_subpath.to_s)
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
def link_source_target
|
|
37
|
-
infom "Linking \"#{data_key}\" directory..."
|
|
38
|
-
return unless remove_target
|
|
39
|
-
|
|
40
|
-
instance.host_env.command('ln', '-s', source_path, target_path).execute!
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
private
|
|
44
|
-
|
|
45
|
-
# @return [Boolean]
|
|
46
|
-
def remove_target # rubocop:disable Naming/PredicateMethod
|
|
47
|
-
instance.host_env.command('rm', '-rf', target_path).execute.fetch(:exit_code).zero?
|
|
48
|
-
end
|
|
49
|
-
end
|
|
50
|
-
end
|
|
51
|
-
end
|
|
52
|
-
end
|
|
53
|
-
end
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Avm
|
|
4
|
-
module EacWebappBase0
|
|
5
|
-
module Instances
|
|
6
|
-
class Deploy
|
|
7
|
-
module WriteOnTarget
|
|
8
|
-
def write_on_target
|
|
9
|
-
::Avm::Files::Deploy.new(
|
|
10
|
-
instance.host_env,
|
|
11
|
-
instance.read_entry(::Avm::Instances::EntryKeys::INSTALL_PATH)
|
|
12
|
-
).append_plain_directory(build_dir).run
|
|
13
|
-
end
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
end
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'net/http'
|
|
4
|
-
|
|
5
|
-
module Avm
|
|
6
|
-
module EacWebappBase0
|
|
7
|
-
module Instances
|
|
8
|
-
class Deploy
|
|
9
|
-
require_sub __FILE__, include_modules: true, require_mode: :kernel
|
|
10
|
-
|
|
11
|
-
DEFAULT_REFERENCE = 'HEAD'
|
|
12
|
-
|
|
13
|
-
REQUEST_TEST_JOB = 'request_test'
|
|
14
|
-
JOBS = (%w[create_build_dir build_content append_instance_content write_on_target
|
|
15
|
-
setup_files_units assert_instance_branch] + [REQUEST_TEST_JOB]).freeze
|
|
16
|
-
|
|
17
|
-
include ::Avm::Entries::Jobs::Base
|
|
18
|
-
|
|
19
|
-
lists.add_symbol :option, :appended_directories, :no_request_test, :reference,
|
|
20
|
-
:remote_read, :remote_write
|
|
21
|
-
|
|
22
|
-
def option_list
|
|
23
|
-
::Avm::EacWebappBase0::Instances::Deploy.lists.option
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
def run
|
|
27
|
-
super
|
|
28
|
-
ensure
|
|
29
|
-
remove_build_dir
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
def start_banner
|
|
33
|
-
infov 'Instance', instance
|
|
34
|
-
infov 'Git reference (User)', git_reference.if_present('- BLANK -')
|
|
35
|
-
infov 'Git remote name', git_remote_name
|
|
36
|
-
infov 'Git reference (Found)', git_reference_found
|
|
37
|
-
infov 'Git commit SHA1', commit_reference
|
|
38
|
-
infov 'Appended directories', appended_directories
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
def setup_files_units
|
|
42
|
-
instance.data_package.units.values.map(&:installation_files_data).select(&:present?)
|
|
43
|
-
.each { |unit_install| setup_files_unit(unit_install.key, unit_install.subpath) }
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
def assert_instance_branch
|
|
47
|
-
return unless remote_write?
|
|
48
|
-
|
|
49
|
-
infom 'Setting instance branch...'
|
|
50
|
-
git.command('push', git_remote_name, "#{commit_reference}:refs/heads/#{instance.id}",
|
|
51
|
-
'-f').execute!
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
def request_test
|
|
55
|
-
infom 'Requesting web interface...'
|
|
56
|
-
::EacEnvs::Http::Request.new.url(instance.read_entry('web.url'))
|
|
57
|
-
.timeout(instance.install_request_test_timeout).response.raise_unless_200
|
|
58
|
-
end
|
|
59
|
-
|
|
60
|
-
protected
|
|
61
|
-
|
|
62
|
-
def jobs
|
|
63
|
-
r = super
|
|
64
|
-
r.delete(REQUEST_TEST_JOB) if options[OPTION_NO_REQUEST_TEST]
|
|
65
|
-
r
|
|
66
|
-
end
|
|
67
|
-
end
|
|
68
|
-
end
|
|
69
|
-
end
|
|
70
|
-
end
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Avm
|
|
4
|
-
module EacWebappBase0
|
|
5
|
-
module Instances
|
|
6
|
-
class DeployInfo
|
|
7
|
-
class << self
|
|
8
|
-
# @param hash [Hash]
|
|
9
|
-
# @return [Avm::EacWebappBase0::Instances::DeployInfo]
|
|
10
|
-
def from_hash(hash)
|
|
11
|
-
new(hash)
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
# @return string [String]
|
|
15
|
-
# @return [Avm::EacWebappBase0::Instances::DeployInfo]
|
|
16
|
-
def from_string(string)
|
|
17
|
-
from_hash(::EacRubyUtils::Yaml.load(string))
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
common_constructor :data do
|
|
22
|
-
self.data = data.with_indifferent_access
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
# @return [Hash]
|
|
26
|
-
delegate :to_h, to: :data
|
|
27
|
-
|
|
28
|
-
# @return [String]
|
|
29
|
-
def to_yaml
|
|
30
|
-
::EacRubyUtils::Yaml.dump(to_h)
|
|
31
|
-
end
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
end
|
|
35
|
-
end
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Avm
|
|
4
|
-
module EacWebappBase0
|
|
5
|
-
module Instances
|
|
6
|
-
module Processes
|
|
7
|
-
class WebServer < ::Avm::Instances::Process
|
|
8
|
-
def available?
|
|
9
|
-
instance.apache_resource.present?
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
def enable
|
|
13
|
-
apache_resource_change(__method__)
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
def enabled?
|
|
17
|
-
instance.apache_resource.enabled?
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
def disable
|
|
21
|
-
apache_resource_change(__method__)
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
private
|
|
25
|
-
|
|
26
|
-
def apache_resource_change(action)
|
|
27
|
-
instance.apache_resource.send(action)
|
|
28
|
-
instance.platform_instance.apache.service(:reload)
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
|
-
end
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
end
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Avm
|
|
4
|
-
module EacWebappBase0
|
|
5
|
-
module Instances
|
|
6
|
-
module Runners
|
|
7
|
-
class ApacheHost
|
|
8
|
-
runner_with :help do
|
|
9
|
-
desc 'Configure Apache virtual host for instance.'
|
|
10
|
-
bool_opt '-c', '--certbot', 'Install certbot.'
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
def run
|
|
14
|
-
result = stereotype_apache_host_class.new(runner_context.call(:instance),
|
|
15
|
-
stereotype_apache_host_options).run
|
|
16
|
-
if result.error?
|
|
17
|
-
fatal_error result.to_s
|
|
18
|
-
else
|
|
19
|
-
infov 'Result', result.label
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
def stereotype_apache_host_class
|
|
24
|
-
"#{runner_context.call(:instance).class.name.deconstantize}::ApacheHost".constantize
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
def stereotype_apache_host_options
|
|
28
|
-
{ certbot: parsed.certbot? }
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
|
-
end
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
end
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Avm
|
|
4
|
-
module EacWebappBase0
|
|
5
|
-
module Instances
|
|
6
|
-
module Runners
|
|
7
|
-
class ApachePath
|
|
8
|
-
runner_with :help do
|
|
9
|
-
desc 'Configure Apache path configuration for instance.'
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
def run
|
|
13
|
-
infov 'ApachePath class', stereotype_apache_path_class
|
|
14
|
-
if result.error?
|
|
15
|
-
fatal_error result.to_s
|
|
16
|
-
else
|
|
17
|
-
infov 'Result', result.label
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
private
|
|
22
|
-
|
|
23
|
-
def apache_path_uncached
|
|
24
|
-
stereotype_apache_path_class.new(runner_context.call(:instance))
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
def result_uncached
|
|
28
|
-
apache_path.run
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
def stereotype_apache_path_class
|
|
32
|
-
runner_context.call(:instance).apache_path_class
|
|
33
|
-
end
|
|
34
|
-
end
|
|
35
|
-
end
|
|
36
|
-
end
|
|
37
|
-
end
|
|
38
|
-
end
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Avm
|
|
4
|
-
module EacWebappBase0
|
|
5
|
-
module Instances
|
|
6
|
-
module Runners
|
|
7
|
-
class Deploy
|
|
8
|
-
runner_with :help do
|
|
9
|
-
desc 'Deploy for instance.'
|
|
10
|
-
arg_opt '-r', '--reference', 'Git reference to deploy.'
|
|
11
|
-
arg_opt '-a', '--append-dirs', 'Append directories to deploy (List separated by ":").'
|
|
12
|
-
bool_opt '-T', '--no-request-test', 'Do not test web interface after deploy.'
|
|
13
|
-
bool_opt '--no-remote', 'Shortcut to "--no-remote-read --no-remote-write"'
|
|
14
|
-
bool_opt '--no-remote-read', 'Do not attempt to read on remote repository.'
|
|
15
|
-
bool_opt '--no-remote-write', 'Do not attempt to write on remote repository.'
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
def run
|
|
19
|
-
result = runner_context.call(:instance).deploy_instance(**deploy_options).run
|
|
20
|
-
if result.error?
|
|
21
|
-
fatal_error result.to_s
|
|
22
|
-
else
|
|
23
|
-
infov 'Result', result.label
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
def deploy_options
|
|
28
|
-
{ reference: parsed.reference,
|
|
29
|
-
appended_directories: ::Avm::PathString.paths(parsed.append_dirs),
|
|
30
|
-
no_request_test: parsed.no_request_test?, remote_read: remote_read?,
|
|
31
|
-
remote_write: remote_write? }
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
# @return [Boolean]
|
|
35
|
-
def remote_read?
|
|
36
|
-
!(parsed.no_remote_read? || parsed.no_remote?)
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
# @return [Boolean]
|
|
40
|
-
def remote_write?
|
|
41
|
-
!(parsed.no_remote_write? || parsed.no_remote?)
|
|
42
|
-
end
|
|
43
|
-
end
|
|
44
|
-
end
|
|
45
|
-
end
|
|
46
|
-
end
|
|
47
|
-
end
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Avm
|
|
4
|
-
module EacWebappBase0
|
|
5
|
-
module Instances
|
|
6
|
-
module Runners
|
|
7
|
-
class DeployInfo
|
|
8
|
-
runner_with :help, :output_item do
|
|
9
|
-
desc 'Fetch instance\'s last deploy information.'
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
def run
|
|
13
|
-
run_output
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
# @return [Hash]
|
|
17
|
-
def item_hash
|
|
18
|
-
instance.deploy_info.to_h
|
|
19
|
-
end
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
end
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'eac_ruby_utils'
|
|
4
|
-
EacRubyUtils::RootModuleSetup.perform __FILE__
|
|
5
|
-
|
|
6
|
-
module Avm
|
|
7
|
-
module EacWebappBase0
|
|
8
|
-
end
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
require 'avm'
|
|
12
|
-
require 'avm/eac_generic_base0'
|
|
13
|
-
require 'avm/eac_postgresql_base0'
|
|
14
|
-
require 'avm/eac_ubuntu_base0'
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
if (typeof TasksScheduler == "undefined")
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
TasksScheduler = function() {};
|
|
6
|
-
|
|
7
|
-
TasksScheduler.Status = function () {
|
|
8
|
-
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
// Shortcut
|
|
12
|
-
var _S = TasksScheduler.Status;
|
|
13
|
-
|
|
14
|
-
_S.initialized = false;
|
|
15
|
-
|
|
16
|
-
_S.init = function(url, interval_max) {
|
|
17
|
-
if (!_S.initialized) {
|
|
18
|
-
_S.initialized = true;
|
|
19
|
-
_S.update();
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
if (typeof TasksScheduler == "undefined")
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
TasksScheduler = function() {};
|
|
6
|
-
|
|
7
|
-
TasksScheduler.Status = function() {
|
|
8
|
-
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
// Shortcut
|
|
12
|
-
var _S = TasksScheduler.Status;
|
|
13
|
-
|
|
14
|
-
_S.initialized = false;
|
|
15
|
-
|
|
16
|
-
_S.init = function(url, interval_max) {
|
|
17
|
-
if (!_S.initialized) {
|
|
18
|
-
_S.initialized = true;
|
|
19
|
-
_S.update();
|
|
20
|
-
}
|
|
21
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<!--
|
|
3
|
-
To change this license header, choose License Headers in Project Properties.
|
|
4
|
-
To change this template file, choose Tools | Templates
|
|
5
|
-
and open the template in the editor.
|
|
6
|
-
-->
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
<root> <a_tag> a Content</a_tag>
|
|
10
|
-
|
|
11
|
-
</root>
|