avm-tools 0.74.1 → 0.75.0
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/lib/avm/eac_webapp_base0/deploy.rb +17 -40
- data/lib/avm/eac_webapp_base0/deploy/build.rb +48 -0
- data/lib/avm/eac_webapp_base0/deploy/git_info.rb +13 -0
- data/lib/avm/eac_webapp_base0/deploy/version.rb +4 -0
- data/lib/avm/eac_webapp_base0/deploy/write_on_target.rb +18 -0
- data/lib/avm/eac_writings_base0/apache_host.rb +17 -0
- data/lib/avm/eac_writings_base0/deploy.rb +36 -0
- data/lib/avm/eac_writings_base0/instance.rb +11 -0
- data/lib/avm/files/appendable.rb +55 -0
- data/lib/avm/files/appendable/file_content.rb +24 -0
- data/lib/avm/files/appendable/plain_directory.rb +25 -0
- data/lib/avm/files/appendable/resource_base.rb +13 -0
- data/lib/avm/files/appendable/tar_output_command.rb +26 -0
- data/lib/avm/files/appendable/templatized_directory.rb +28 -0
- data/lib/avm/files/appender.rb +11 -0
- data/lib/avm/files/deploy.rb +72 -0
- data/lib/avm/git/commit/deploy.rb +8 -61
- data/lib/avm/tools/runner/eac_rails_base0/rails_server.rb +1 -0
- data/lib/avm/tools/runner/eac_writings_base0.rb +15 -0
- data/lib/avm/tools/runner/git/deploy.rb +1 -1
- data/lib/avm/tools/version.rb +1 -1
- data/template/avm/{stereotypes/eac_ubuntu_base0 → eac_ubuntu_base0}/docker_image/Dockerfile +0 -0
- data/template/avm/{stereotypes/eac_wordpress_base0 → eac_wordpress_base0}/deploy/wp-config.php.template +0 -0
- data/template/avm/eac_writings_base0/deploy/index.html.template +9 -0
- metadata +18 -7
- data/lib/avm/git/commit/deploy/appended.rb +0 -37
- data/lib/avm/git/commit/deploy/appended/base.rb +0 -17
- data/lib/avm/git/commit/deploy/appended/directory.rb +0 -32
- data/lib/avm/git/commit/deploy/appended/file_content.rb +0 -28
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '061861b37a86551104e76e78c988fabd4e421dbdcaf223fd567e36aa725abf49'
|
4
|
+
data.tar.gz: e5b1a4bcd4cc716e9dfad2527143163a8e97528cabe7fa44ac01ed12a4fdbe6d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 83feb6ab0a6519f2319650eac3a15305fbc46d088a80d7521e14347fda3db9ea3503fe0c5a474d8899f9359f0807685ff7e4a33ccac0c610ac08406a33e137fa
|
7
|
+
data.tar.gz: cb4f4ff1b6f0b7dad60530111f60a20acbef410a9edb2e6c865cfd0589808e5847bf21afc9e954f33092ab8faa1cefd084905fc1206d54c18d117c8bd5efbaec
|
@@ -1,11 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'active_support/callbacks'
|
4
|
-
require 'delegate'
|
5
|
-
require 'eac_ruby_utils/core_ext'
|
6
|
-
require 'eac_launcher/git/base'
|
7
4
|
require 'avm/git'
|
8
5
|
require 'avm/patches/object/template'
|
6
|
+
require 'eac_ruby_utils/core_ext'
|
7
|
+
require 'eac_launcher/git/base'
|
9
8
|
require 'net/http'
|
10
9
|
|
11
10
|
module Avm
|
@@ -18,34 +17,20 @@ module Avm
|
|
18
17
|
|
19
18
|
enable_console_speaker
|
20
19
|
enable_simple_cache
|
20
|
+
common_constructor :instance, :options, default: [{}]
|
21
21
|
|
22
|
-
JOBS = %w[
|
22
|
+
JOBS = %w[create_build_dir build_content append_instance_content write_on_target
|
23
|
+
setup_files_units assert_instance_branch request_test].freeze
|
23
24
|
define_callbacks(*JOBS)
|
24
25
|
|
25
|
-
attr_reader :instance, :options
|
26
|
-
|
27
|
-
def initialize(instance, options = {})
|
28
|
-
@instance = instance
|
29
|
-
@options = options
|
30
|
-
end
|
31
|
-
|
32
|
-
def build_git_commit
|
33
|
-
::Avm::Git::Commit.new(git, commit_sha1).deploy_to_env_path(
|
34
|
-
instance.host_env,
|
35
|
-
instance.read_entry(::Avm::Instances::EntryKeys::FS_PATH)
|
36
|
-
).variables_source_set(instance)
|
37
|
-
end
|
38
|
-
|
39
26
|
def run
|
40
27
|
start_banner
|
41
|
-
|
42
|
-
run_callbacks job do
|
43
|
-
send(job)
|
44
|
-
end
|
45
|
-
end
|
28
|
+
run_jobs
|
46
29
|
::Avm::Result.success('Deployed')
|
47
30
|
rescue ::Avm::Result::Error => e
|
48
31
|
e.to_result
|
32
|
+
ensure
|
33
|
+
remove_build_dir
|
49
34
|
end
|
50
35
|
|
51
36
|
def start_banner
|
@@ -57,15 +42,6 @@ module Avm
|
|
57
42
|
infov 'Appended directories', appended_directories
|
58
43
|
end
|
59
44
|
|
60
|
-
def git_deploy
|
61
|
-
infom 'Deploying source code and appended content...'
|
62
|
-
build_git_commit
|
63
|
-
.append_directory(template.path)
|
64
|
-
.append_directories(appended_directories)
|
65
|
-
.append_file_content(VERSION_TARGET_PATH, version)
|
66
|
-
.run
|
67
|
-
end
|
68
|
-
|
69
45
|
def setup_files_units
|
70
46
|
instance.class.const_get('FILES_UNITS').each do |data_key, fs_path_subpath|
|
71
47
|
FileUnit.new(self, data_key, fs_path_subpath).run
|
@@ -85,17 +61,18 @@ module Avm
|
|
85
61
|
fatal_error "Request to #{uri} failed" unless response.code.to_i == 200
|
86
62
|
end
|
87
63
|
|
88
|
-
def
|
89
|
-
|
64
|
+
def variables_source
|
65
|
+
instance
|
90
66
|
end
|
91
67
|
|
92
|
-
|
93
|
-
infom "Fetching remote \"#{git_remote_name}\" from \"#{git_repository_path}\"..."
|
94
|
-
git.fetch(git_remote_name)
|
95
|
-
end
|
68
|
+
private
|
96
69
|
|
97
|
-
def
|
98
|
-
|
70
|
+
def run_jobs
|
71
|
+
JOBS.each do |job|
|
72
|
+
run_callbacks job do
|
73
|
+
send(job)
|
74
|
+
end
|
75
|
+
end
|
99
76
|
end
|
100
77
|
end
|
101
78
|
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/files/appender'
|
4
|
+
require 'avm/files/deploy'
|
5
|
+
require 'eac_ruby_utils/envs'
|
6
|
+
require 'eac_ruby_utils/fs/temp'
|
7
|
+
|
8
|
+
module Avm
|
9
|
+
module EacWebappBase0
|
10
|
+
class Deploy
|
11
|
+
module Build
|
12
|
+
private
|
13
|
+
|
14
|
+
attr_accessor :build_dir
|
15
|
+
|
16
|
+
def append_instance_content
|
17
|
+
::Avm::Files::Appender
|
18
|
+
.new
|
19
|
+
.variables_source_set(variables_source)
|
20
|
+
.append_directory(template.path)
|
21
|
+
.append_templatized_directories(appended_directories)
|
22
|
+
.append_file_content(version_target_path, version)
|
23
|
+
.write_appended_on(build_dir)
|
24
|
+
end
|
25
|
+
|
26
|
+
def build_dir_env
|
27
|
+
::EacRubyUtils::Envs.local
|
28
|
+
end
|
29
|
+
|
30
|
+
def create_build_dir
|
31
|
+
self.build_dir = ::EacRubyUtils::Fs::Temp.directory
|
32
|
+
end
|
33
|
+
|
34
|
+
def remove_build_dir
|
35
|
+
build_dir&.remove
|
36
|
+
end
|
37
|
+
|
38
|
+
def build_content
|
39
|
+
infom 'Writing Git source code...'
|
40
|
+
::Avm::Git::Commit.new(git, commit_sha1).deploy_to_env_path(
|
41
|
+
build_dir_env,
|
42
|
+
build_dir
|
43
|
+
).variables_source_set(variables_source).run
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -12,6 +12,11 @@ module Avm
|
|
12
12
|
raise ::Avm::Result::Error, "No commit SHA1 found for \"#{git_reference_found}\""
|
13
13
|
end
|
14
14
|
|
15
|
+
def git_fetch_uncached
|
16
|
+
infom "Fetching remote \"#{git_remote_name}\" from \"#{git_repository_path}\"..."
|
17
|
+
git.fetch(git_remote_name)
|
18
|
+
end
|
19
|
+
|
15
20
|
def git_reference
|
16
21
|
options[:reference] || DEFAULT_REFERENCE
|
17
22
|
end
|
@@ -32,6 +37,14 @@ module Avm
|
|
32
37
|
::Avm::Git::DEFAULT_REMOTE_NAME
|
33
38
|
end
|
34
39
|
|
40
|
+
def git_repository_path
|
41
|
+
instance.source_instance.read_entry(::Avm::Instances::EntryKeys::FS_PATH)
|
42
|
+
end
|
43
|
+
|
44
|
+
def git_uncached
|
45
|
+
::EacLauncher::Git::Base.new(git_repository_path)
|
46
|
+
end
|
47
|
+
|
35
48
|
def instance_branch
|
36
49
|
remote_branch(instance.id)
|
37
50
|
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
4
|
+
|
5
|
+
module Avm
|
6
|
+
module EacWebappBase0
|
7
|
+
class Deploy
|
8
|
+
module WriteOnTarget
|
9
|
+
def write_on_target
|
10
|
+
::Avm::Files::Deploy.new(
|
11
|
+
instance.host_env,
|
12
|
+
instance.read_entry(::Avm::Instances::EntryKeys::FS_PATH)
|
13
|
+
).append_plain_directory(build_dir).run
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/eac_webapp_base0/apache_host'
|
4
|
+
|
5
|
+
module Avm
|
6
|
+
module EacWritingsBase0
|
7
|
+
class ApacheHost < ::Avm::EacWebappBase0::ApacheHost
|
8
|
+
def document_root
|
9
|
+
instance.read_entry(::Avm::Instances::EntryKeys::FS_PATH)
|
10
|
+
end
|
11
|
+
|
12
|
+
def extra_content
|
13
|
+
''
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/eac_webapp_base0/deploy'
|
4
|
+
require 'avm/eac_writings_base0/project'
|
5
|
+
require 'avm/eac_writings_base0/project_build'
|
6
|
+
|
7
|
+
module Avm
|
8
|
+
module EacWritingsBase0
|
9
|
+
class Deploy < ::Avm::EacWebappBase0::Deploy
|
10
|
+
def build_content
|
11
|
+
::Avm::EacWritingsBase0::ProjectBuild.new(project, output_file:
|
12
|
+
build_dir.join(pdf_path))
|
13
|
+
end
|
14
|
+
|
15
|
+
def title
|
16
|
+
instance.id.humanize
|
17
|
+
end
|
18
|
+
|
19
|
+
def pdf_path
|
20
|
+
"#{instance.id.underscore}.pdf"
|
21
|
+
end
|
22
|
+
|
23
|
+
def variables_source
|
24
|
+
self
|
25
|
+
end
|
26
|
+
|
27
|
+
private
|
28
|
+
|
29
|
+
def project_uncached
|
30
|
+
::Avm::EacWritingsBase0::Project.new(
|
31
|
+
instance.source_instance.read_entry(::Avm::Instances::EntryKeys::FS_PATH)
|
32
|
+
)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
4
|
+
|
5
|
+
module Avm
|
6
|
+
module Files
|
7
|
+
module Appendable
|
8
|
+
require_sub __FILE__
|
9
|
+
|
10
|
+
attr_reader :variables_source
|
11
|
+
|
12
|
+
def appended
|
13
|
+
@appended ||= []
|
14
|
+
end
|
15
|
+
|
16
|
+
def append_templatized_directories(directories)
|
17
|
+
directories.each { |directory| append_templatized_directory(directory) }
|
18
|
+
self
|
19
|
+
end
|
20
|
+
|
21
|
+
def append_plain_directory(directory)
|
22
|
+
appended << ::Avm::Files::Appendable::PlainDirectory.new(self, directory)
|
23
|
+
self
|
24
|
+
end
|
25
|
+
|
26
|
+
def append_tar_output_command(tar_command)
|
27
|
+
appended << ::Avm::Files::Appendable::TarOutputCommand.new(self, tar_command)
|
28
|
+
self
|
29
|
+
end
|
30
|
+
|
31
|
+
def append_templatized_directory(directory)
|
32
|
+
appended << ::Avm::Files::Appendable::TemplatizedDirectory.new(self, directory)
|
33
|
+
self
|
34
|
+
end
|
35
|
+
|
36
|
+
def append_file_content(target_path, content)
|
37
|
+
appended << ::Avm::Files::Appendable::FileContent
|
38
|
+
.new(self, target_path, content)
|
39
|
+
self
|
40
|
+
end
|
41
|
+
|
42
|
+
def variables_source_set(source)
|
43
|
+
@variables_source = source
|
44
|
+
self
|
45
|
+
end
|
46
|
+
|
47
|
+
def write_appended_on(target_dir)
|
48
|
+
target_dir = target_dir.to_pathname
|
49
|
+
raise "\"#{target_dir}\" is not a directory" unless target_dir.directory?
|
50
|
+
|
51
|
+
appended.each { |append| append.write_on(target_dir) }
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
4
|
+
require 'avm/files/appendable/resource_base'
|
5
|
+
|
6
|
+
module Avm
|
7
|
+
module Files
|
8
|
+
module Appendable
|
9
|
+
class FileContent < ::Avm::Files::Appendable::ResourceBase
|
10
|
+
attr_reader :target_path, :content
|
11
|
+
|
12
|
+
def initialize(deploy, target_path, content)
|
13
|
+
super(deploy)
|
14
|
+
@target_path = target_path
|
15
|
+
@content = content
|
16
|
+
end
|
17
|
+
|
18
|
+
def write_on(target_dir)
|
19
|
+
target_dir.join(target_path).write(content)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
4
|
+
require 'avm/files/appendable/resource_base'
|
5
|
+
|
6
|
+
module Avm
|
7
|
+
module Files
|
8
|
+
module Appendable
|
9
|
+
class PlainDirectory < ::Avm::Files::Appendable::ResourceBase
|
10
|
+
attr_reader :source_path
|
11
|
+
|
12
|
+
def initialize(appender, source_path)
|
13
|
+
super(appender)
|
14
|
+
@source_path = source_path.to_pathname
|
15
|
+
end
|
16
|
+
|
17
|
+
def write_on(target_dir)
|
18
|
+
raise "\"#{source_path}\" is not a directory" unless source_path.directory?
|
19
|
+
|
20
|
+
::FileUtils.cp_r("#{source_path}/.", target_dir.to_path)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
4
|
+
require 'eac_ruby_utils/envs'
|
5
|
+
require 'avm/files/appendable/resource_base'
|
6
|
+
|
7
|
+
module Avm
|
8
|
+
module Files
|
9
|
+
module Appendable
|
10
|
+
class TarOutputCommand < ::Avm::Files::Appendable::ResourceBase
|
11
|
+
attr_reader :command
|
12
|
+
|
13
|
+
def initialize(appender, command)
|
14
|
+
super(appender)
|
15
|
+
@command = command
|
16
|
+
end
|
17
|
+
|
18
|
+
def write_on(target_dir)
|
19
|
+
command.pipe(
|
20
|
+
::EacRubyUtils::Envs.local.command('tar', '-xf', '-', '-C', target_dir)
|
21
|
+
).execute!
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
4
|
+
require 'avm/files/appendable/resource_base'
|
5
|
+
|
6
|
+
module Avm
|
7
|
+
module Files
|
8
|
+
module Appendable
|
9
|
+
class TemplatizedDirectory < ::Avm::Files::Appendable::ResourceBase
|
10
|
+
attr_reader :source_path
|
11
|
+
|
12
|
+
def initialize(appender, source_path)
|
13
|
+
super(appender)
|
14
|
+
@source_path = source_path
|
15
|
+
end
|
16
|
+
|
17
|
+
def write_on(target_dir)
|
18
|
+
raise 'Variables source not set' if appender.variables_source.blank?
|
19
|
+
|
20
|
+
::EacRubyUtils::Templates::Directory.new(source_path).apply(
|
21
|
+
appender.variables_source,
|
22
|
+
target_dir
|
23
|
+
)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'addressable'
|
4
|
+
require 'avm/files/appendable'
|
5
|
+
require 'avm/patches/object/template'
|
6
|
+
require 'eac_ruby_utils/core_ext'
|
7
|
+
|
8
|
+
module Avm
|
9
|
+
module Files
|
10
|
+
class Deploy
|
11
|
+
include ::Avm::Files::Appendable
|
12
|
+
enable_simple_cache
|
13
|
+
|
14
|
+
attr_reader :build_dir, :target_env, :target_path
|
15
|
+
|
16
|
+
common_constructor :target_env, :target_path
|
17
|
+
|
18
|
+
def run
|
19
|
+
on_build_dir do
|
20
|
+
copy_content_to_build_dir
|
21
|
+
mkdir_target
|
22
|
+
clear_content
|
23
|
+
send_untar_package
|
24
|
+
set_target_permission
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
private
|
29
|
+
|
30
|
+
def on_build_dir
|
31
|
+
@build_dir = ::Dir.mktmpdir
|
32
|
+
yield
|
33
|
+
ensure
|
34
|
+
::FileUtils.rm_rf(@build_dir)
|
35
|
+
end
|
36
|
+
|
37
|
+
def copy_content_to_build_dir
|
38
|
+
write_appended_on(build_dir)
|
39
|
+
end
|
40
|
+
|
41
|
+
def mkdir_target
|
42
|
+
target_env.command('mkdir', '-p', target_path).execute!
|
43
|
+
end
|
44
|
+
|
45
|
+
def clear_content
|
46
|
+
target_env.command(
|
47
|
+
'find', target_path, '-mindepth', '1', '-maxdepth', '1', '-exec', 'rm', '-rf', '{}', ';'
|
48
|
+
).execute!
|
49
|
+
end
|
50
|
+
|
51
|
+
def send_untar_package
|
52
|
+
tar_build_command.pipe(untar_build_command).execute!
|
53
|
+
end
|
54
|
+
|
55
|
+
def set_target_permission
|
56
|
+
target_env.command('chmod', '755', target_path).execute!
|
57
|
+
end
|
58
|
+
|
59
|
+
def tar_build_command
|
60
|
+
source_env.command('tar', '-czO', '-C', build_dir, '.')
|
61
|
+
end
|
62
|
+
|
63
|
+
def untar_build_command
|
64
|
+
target_env.command('tar', '-xzf', '-', '-C', target_path)
|
65
|
+
end
|
66
|
+
|
67
|
+
def source_env
|
68
|
+
::EacRubyUtils::Envs.local
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
@@ -2,90 +2,37 @@
|
|
2
2
|
|
3
3
|
require 'addressable'
|
4
4
|
require 'eac_ruby_utils/core_ext'
|
5
|
+
require 'avm/files/appendable'
|
6
|
+
require 'avm/files/deploy'
|
5
7
|
require 'avm/patches/object/template'
|
6
8
|
|
7
9
|
module Avm
|
8
10
|
module Git
|
9
11
|
class Commit
|
10
12
|
class Deploy
|
11
|
-
|
13
|
+
include ::Avm::Files::Appendable
|
12
14
|
enable_simple_cache
|
13
15
|
|
14
|
-
attr_reader :build_dir, :commit, :target_env, :target_path
|
16
|
+
attr_reader :build_dir, :commit, :target_env, :target_path
|
15
17
|
|
16
18
|
def initialize(commit, target_env, target_path)
|
17
19
|
@commit = commit
|
18
20
|
@target_env = target_env
|
19
21
|
@target_path = target_path
|
20
|
-
@variables_source = nil
|
21
|
-
end
|
22
|
-
|
23
|
-
def variables_source_set(source)
|
24
|
-
@variables_source = source
|
25
|
-
self
|
26
22
|
end
|
27
23
|
|
28
24
|
def run
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
clear_content
|
34
|
-
send_untar_package
|
35
|
-
set_target_permission
|
36
|
-
end
|
25
|
+
fd = ::Avm::Files::Deploy.new(target_env, target_path)
|
26
|
+
fd.append_tar_output_command(git_archive_command)
|
27
|
+
fd.appended.push(*appended)
|
28
|
+
fd.run
|
37
29
|
end
|
38
30
|
|
39
31
|
private
|
40
32
|
|
41
|
-
def on_build_dir
|
42
|
-
@build_dir = ::Dir.mktmpdir
|
43
|
-
yield
|
44
|
-
ensure
|
45
|
-
::FileUtils.rm_rf(@build_dir)
|
46
|
-
end
|
47
|
-
|
48
|
-
def copy_git_content
|
49
|
-
git_archive_command.pipe(untar_git_archive_command).execute!
|
50
|
-
end
|
51
|
-
|
52
|
-
def mkdir_target
|
53
|
-
target_env.command('mkdir', '-p', target_path).execute!
|
54
|
-
end
|
55
|
-
|
56
|
-
def clear_content
|
57
|
-
target_env.command(
|
58
|
-
'find', target_path, '-mindepth', '1', '-maxdepth', '1', '-exec', 'rm', '-rf', '{}', ';'
|
59
|
-
).execute!
|
60
|
-
end
|
61
|
-
|
62
|
-
def send_untar_package
|
63
|
-
tar_build_command.pipe(untar_build_command).execute!
|
64
|
-
end
|
65
|
-
|
66
|
-
def set_target_permission
|
67
|
-
target_env.command('chmod', '755', target_path).execute!
|
68
|
-
end
|
69
|
-
|
70
33
|
def git_archive_command
|
71
34
|
commit.git.command('archive', '--format=tar', commit.sha1)
|
72
35
|
end
|
73
|
-
|
74
|
-
def untar_git_archive_command
|
75
|
-
source_env.command('tar', '-xf', '-', '-C', build_dir)
|
76
|
-
end
|
77
|
-
|
78
|
-
def tar_build_command
|
79
|
-
source_env.command('tar', '-czO', '-C', build_dir, '.')
|
80
|
-
end
|
81
|
-
|
82
|
-
def untar_build_command
|
83
|
-
target_env.command('tar', '-xzf', '-', '-C', target_path)
|
84
|
-
end
|
85
|
-
|
86
|
-
def source_env
|
87
|
-
::EacRubyUtils::Envs.local
|
88
|
-
end
|
89
36
|
end
|
90
37
|
end
|
91
38
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/eac_webapp_base0/runner'
|
4
|
+
require 'avm/eac_writings_base0'
|
5
|
+
require 'eac_ruby_utils/console/docopt_runner'
|
6
|
+
|
7
|
+
module Avm
|
8
|
+
module Tools
|
9
|
+
class Runner < ::EacRubyUtils::Console::DocoptRunner
|
10
|
+
class EacWritingsBase0 < ::Avm::EacWebappBase0::Runner
|
11
|
+
require_sub __FILE__
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -88,7 +88,7 @@ module Avm
|
|
88
88
|
def deploy
|
89
89
|
::Avm::Git::Commit.new(git, reference_sha1)
|
90
90
|
.deploy_to_url(target_url)
|
91
|
-
.
|
91
|
+
.append_templatized_directories(appended_directories)
|
92
92
|
.variables_source_set(variables_source)
|
93
93
|
.run
|
94
94
|
end
|
data/lib/avm/tools/version.rb
CHANGED
File without changes
|
File without changes
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: avm-tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.75.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Esquilo Azul Company
|
@@ -314,9 +314,11 @@ files:
|
|
314
314
|
- lib/avm/eac_webapp_base0/apache_host.rb
|
315
315
|
- lib/avm/eac_webapp_base0/deploy.rb
|
316
316
|
- lib/avm/eac_webapp_base0/deploy/appended_directories.rb
|
317
|
+
- lib/avm/eac_webapp_base0/deploy/build.rb
|
317
318
|
- lib/avm/eac_webapp_base0/deploy/file_unit.rb
|
318
319
|
- lib/avm/eac_webapp_base0/deploy/git_info.rb
|
319
320
|
- lib/avm/eac_webapp_base0/deploy/version.rb
|
321
|
+
- lib/avm/eac_webapp_base0/deploy/write_on_target.rb
|
320
322
|
- lib/avm/eac_webapp_base0/instance.rb
|
321
323
|
- lib/avm/eac_webapp_base0/runner.rb
|
322
324
|
- lib/avm/eac_webapp_base0/runner/apache_host.rb
|
@@ -329,17 +331,28 @@ files:
|
|
329
331
|
- lib/avm/eac_wordpress_base0/deploy.rb
|
330
332
|
- lib/avm/eac_wordpress_base0/instance.rb
|
331
333
|
- lib/avm/eac_writings_base0.rb
|
334
|
+
- lib/avm/eac_writings_base0/apache_host.rb
|
332
335
|
- lib/avm/eac_writings_base0/commons.rb
|
336
|
+
- lib/avm/eac_writings_base0/deploy.rb
|
333
337
|
- lib/avm/eac_writings_base0/file_build.rb
|
334
338
|
- lib/avm/eac_writings_base0/file_build/base_stereotype.rb
|
335
339
|
- lib/avm/eac_writings_base0/file_build/chapter_index.rb
|
336
340
|
- lib/avm/eac_writings_base0/file_build/tex_source.rb
|
341
|
+
- lib/avm/eac_writings_base0/instance.rb
|
337
342
|
- lib/avm/eac_writings_base0/project.rb
|
338
343
|
- lib/avm/eac_writings_base0/project_build.rb
|
339
344
|
- lib/avm/eac_writings_base0/project_build/chapters_content.rb
|
340
345
|
- lib/avm/eac_writings_base0/project_build/copy_files.rb
|
341
346
|
- lib/avm/executables.rb
|
342
347
|
- lib/avm/files.rb
|
348
|
+
- lib/avm/files/appendable.rb
|
349
|
+
- lib/avm/files/appendable/file_content.rb
|
350
|
+
- lib/avm/files/appendable/plain_directory.rb
|
351
|
+
- lib/avm/files/appendable/resource_base.rb
|
352
|
+
- lib/avm/files/appendable/tar_output_command.rb
|
353
|
+
- lib/avm/files/appendable/templatized_directory.rb
|
354
|
+
- lib/avm/files/appender.rb
|
355
|
+
- lib/avm/files/deploy.rb
|
343
356
|
- lib/avm/files/formatter.rb
|
344
357
|
- lib/avm/files/formatter/formats.rb
|
345
358
|
- lib/avm/files/formatter/formats/base.rb
|
@@ -359,10 +372,6 @@ files:
|
|
359
372
|
- lib/avm/git/commit.rb
|
360
373
|
- lib/avm/git/commit/class_methods.rb
|
361
374
|
- lib/avm/git/commit/deploy.rb
|
362
|
-
- lib/avm/git/commit/deploy/appended.rb
|
363
|
-
- lib/avm/git/commit/deploy/appended/base.rb
|
364
|
-
- lib/avm/git/commit/deploy/appended/directory.rb
|
365
|
-
- lib/avm/git/commit/deploy/appended/file_content.rb
|
366
375
|
- lib/avm/git/commit/deploy_methods.rb
|
367
376
|
- lib/avm/git/commit/diff_tree_line.rb
|
368
377
|
- lib/avm/git/commit/file.rb
|
@@ -483,6 +492,7 @@ files:
|
|
483
492
|
- lib/avm/tools/runner/eac_redmine_base0/docker.rb
|
484
493
|
- lib/avm/tools/runner/eac_redmine_base0/project_rename.rb
|
485
494
|
- lib/avm/tools/runner/eac_wordpress_base0.rb
|
495
|
+
- lib/avm/tools/runner/eac_writings_base0.rb
|
486
496
|
- lib/avm/tools/runner/files.rb
|
487
497
|
- lib/avm/tools/runner/files/format.rb
|
488
498
|
- lib/avm/tools/runner/files/rotate.rb
|
@@ -562,7 +572,9 @@ files:
|
|
562
572
|
- template/avm/eac_rails_base0/deploy/config/envvars.d/email.yml.template
|
563
573
|
- template/avm/eac_redmine_base0/deploy/config/install.sh.template
|
564
574
|
- template/avm/eac_redmine_base0/deploy/config/secrets.yml
|
575
|
+
- template/avm/eac_ubuntu_base0/docker_image/Dockerfile
|
565
576
|
- template/avm/eac_webapp_base0/apache_host/no_ssl.conf
|
577
|
+
- template/avm/eac_wordpress_base0/deploy/wp-config.php.template
|
566
578
|
- template/avm/eac_writings_base0/commons/all.tex
|
567
579
|
- template/avm/eac_writings_base0/commons/ebook.tex
|
568
580
|
- template/avm/eac_writings_base0/commons/images.tex
|
@@ -571,6 +583,7 @@ files:
|
|
571
583
|
- template/avm/eac_writings_base0/commons/source_code.tex
|
572
584
|
- template/avm/eac_writings_base0/commons/source_code/java.tex
|
573
585
|
- template/avm/eac_writings_base0/commons/utils.tex
|
586
|
+
- template/avm/eac_writings_base0/deploy/index.html.template
|
574
587
|
- template/avm/ruby/gems/generator/gemspec.template
|
575
588
|
- template/avm/ruby/gems/generator/root_lib.template
|
576
589
|
- template/avm/ruby/gems/generator/static/Gemfile
|
@@ -579,8 +592,6 @@ files:
|
|
579
592
|
- template/avm/ruby/gems/generator/version.template
|
580
593
|
- template/avm/self/docker_image/Dockerfile
|
581
594
|
- template/avm/self/docker_image/entrypoint.sh
|
582
|
-
- template/avm/stereotypes/eac_ubuntu_base0/docker_image/Dockerfile
|
583
|
-
- template/avm/stereotypes/eac_wordpress_base0/deploy/wp-config.php.template
|
584
595
|
- vendor/eac_cli/Gemfile
|
585
596
|
- vendor/eac_cli/eac_cli.gemspec
|
586
597
|
- vendor/eac_cli/lib/eac_cli.rb
|
@@ -1,37 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Avm
|
4
|
-
module Git
|
5
|
-
class Commit
|
6
|
-
class Deploy
|
7
|
-
module Appended
|
8
|
-
require_sub __FILE__
|
9
|
-
|
10
|
-
def appended
|
11
|
-
@appended ||= []
|
12
|
-
end
|
13
|
-
|
14
|
-
def append_directory(directory)
|
15
|
-
appended << ::Avm::Git::Commit::Deploy::Appended::Directory.new(self, directory)
|
16
|
-
self
|
17
|
-
end
|
18
|
-
|
19
|
-
def append_directories(directories)
|
20
|
-
directories.each { |directory| append_directory(directory) }
|
21
|
-
self
|
22
|
-
end
|
23
|
-
|
24
|
-
def append_file_content(target_path, content)
|
25
|
-
appended << ::Avm::Git::Commit::Deploy::Appended::FileContent
|
26
|
-
.new(self, target_path, content)
|
27
|
-
self
|
28
|
-
end
|
29
|
-
|
30
|
-
def copy_appended_content
|
31
|
-
appended.each(&:copy_to_build_dir)
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
@@ -1,32 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'eac_ruby_utils/core_ext'
|
4
|
-
require 'avm/git/commit/deploy/appended/base'
|
5
|
-
|
6
|
-
module Avm
|
7
|
-
module Git
|
8
|
-
class Commit
|
9
|
-
class Deploy
|
10
|
-
module Appended
|
11
|
-
class Directory < ::Avm::Git::Commit::Deploy::Appended::Base
|
12
|
-
attr_reader :source_path
|
13
|
-
|
14
|
-
def initialize(deploy, source_path)
|
15
|
-
super(deploy)
|
16
|
-
@source_path = source_path
|
17
|
-
end
|
18
|
-
|
19
|
-
def copy_to_build_dir
|
20
|
-
raise 'Variables source not set' if deploy.variables_source.blank?
|
21
|
-
|
22
|
-
::EacRubyUtils::Templates::Directory.new(source_path).apply(
|
23
|
-
deploy.variables_source,
|
24
|
-
deploy.build_dir
|
25
|
-
)
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
@@ -1,28 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'eac_ruby_utils/core_ext'
|
4
|
-
require 'avm/git/commit/deploy/appended/base'
|
5
|
-
|
6
|
-
module Avm
|
7
|
-
module Git
|
8
|
-
class Commit
|
9
|
-
class Deploy
|
10
|
-
module Appended
|
11
|
-
class FileContent < ::Avm::Git::Commit::Deploy::Appended::Base
|
12
|
-
attr_reader :target_path, :content
|
13
|
-
|
14
|
-
def initialize(deploy, target_path, content)
|
15
|
-
super(deploy)
|
16
|
-
@target_path = target_path
|
17
|
-
@content = content
|
18
|
-
end
|
19
|
-
|
20
|
-
def copy_to_build_dir
|
21
|
-
deploy.build_dir.to_pathname.join(target_path).write(content)
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|