avm-tools 0.72.0 → 0.75.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/avm/{stereotypes/eac_rails_base0.rb → eac_rails_base0.rb} +1 -3
- data/lib/avm/eac_rails_base0/instance.rb +2 -5
- data/lib/avm/{rails/runners.rb → eac_rails_base1.rb} +2 -4
- data/lib/avm/{rails → eac_rails_base1}/instance.rb +8 -3
- data/lib/avm/eac_rails_base1/runner.rb +12 -0
- data/lib/avm/eac_rails_base1/runner/bundle.rb +28 -0
- data/lib/avm/eac_rails_base1/runner/code_runner.rb +28 -0
- data/lib/avm/eac_rails_base1/runner_with/bundle.rb +57 -0
- data/lib/avm/{stereotypes/rails.rb → eac_redmine_base0.rb} +2 -4
- data/lib/avm/eac_redmine_base0/instance.rb +2 -4
- data/lib/avm/{stereotypes/eac_ubuntu_base0.rb → eac_ubuntu_base0.rb} +1 -3
- data/lib/avm/{stereotypes/eac_webapp_base0.rb → eac_webapp_base0.rb} +1 -3
- 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_webapp_base0/instance.rb +2 -2
- data/lib/avm/eac_webapp_base0/runner.rb +12 -0
- data/lib/avm/eac_webapp_base0/runner/apache_host.rb +2 -3
- data/lib/avm/eac_webapp_base0/runner/data.rb +1 -1
- data/lib/avm/eac_webapp_base0/runner/data/dump.rb +1 -1
- data/lib/avm/eac_webapp_base0/runner/data/load.rb +1 -1
- data/lib/avm/eac_webapp_base0/runner/deploy.rb +4 -16
- data/lib/avm/eac_wordpress_base0.rb +9 -0
- data/lib/avm/eac_wordpress_base0/apache_host.rb +25 -0
- data/lib/avm/eac_wordpress_base0/deploy.rb +10 -0
- data/lib/avm/eac_wordpress_base0/instance.rb +24 -0
- data/lib/avm/eac_writings_base0.rb +9 -0
- data/lib/avm/eac_writings_base0/apache_host.rb +17 -0
- data/lib/avm/eac_writings_base0/commons.rb +12 -0
- data/lib/avm/eac_writings_base0/deploy.rb +36 -0
- data/lib/avm/eac_writings_base0/file_build.rb +45 -0
- data/lib/avm/eac_writings_base0/file_build/base_stereotype.rb +19 -0
- data/lib/avm/eac_writings_base0/file_build/chapter_index.rb +23 -0
- data/lib/avm/eac_writings_base0/file_build/tex_source.rb +33 -0
- data/lib/avm/eac_writings_base0/instance.rb +11 -0
- data/lib/avm/eac_writings_base0/project.rb +33 -0
- data/lib/avm/eac_writings_base0/project_build.rb +117 -0
- data/lib/avm/eac_writings_base0/project_build/chapters_content.rb +47 -0
- data/lib/avm/eac_writings_base0/project_build/copy_files.rb +42 -0
- data/lib/avm/executables.rb +1 -1
- 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/instances/base/auto_values.rb +2 -1
- data/lib/avm/instances/base/auto_values/mailer.rb +34 -0
- data/lib/avm/instances/entry_keys.rb +4 -0
- data/lib/avm/instances/runner.rb +40 -0
- data/lib/avm/{stereotypes/postgresql.rb → postgresql.rb} +1 -3
- data/lib/avm/postgresql/instance.rb +63 -0
- data/lib/avm/postgresql/instance/data_unit.rb +39 -0
- data/lib/avm/postgresql/instance_with.rb +18 -0
- data/lib/avm/projects/stereotypes/git_subtree/publish.rb +2 -0
- data/lib/avm/projects/stereotypes/git_subtree/warp.rb +3 -0
- data/lib/avm/tools/runner.rb +3 -3
- data/lib/avm/tools/runner/eac_rails_base0.rb +5 -18
- data/lib/avm/tools/runner/eac_rails_base0/apache_path.rb +1 -1
- data/lib/avm/tools/runner/eac_rails_base0/rails_server.rb +7 -12
- data/lib/avm/tools/runner/eac_rails_base0/runner.rb +3 -3
- data/lib/avm/tools/runner/eac_redmine_base0.rb +5 -23
- data/lib/avm/tools/runner/eac_redmine_base0/core_update.rb +1 -1
- data/lib/avm/tools/runner/eac_redmine_base0/docker.rb +1 -1
- data/lib/avm/tools/runner/eac_redmine_base0/project_rename.rb +3 -3
- data/lib/avm/tools/runner/eac_wordpress_base0.rb +5 -24
- data/lib/avm/tools/runner/{eac_rails_base0/data.rb → eac_writings_base0.rb} +4 -4
- data/lib/avm/tools/runner/git/deploy.rb +1 -1
- data/lib/avm/tools/runner/local_project/eac_writings_base0.rb +35 -0
- data/lib/avm/tools/runner/local_project/eac_writings_base0/build_chapters.rb +48 -0
- data/lib/avm/tools/runner/local_project/eac_writings_base0/build_single.rb +37 -0
- data/lib/avm/tools/runner/local_project/eac_writings_base0/info.rb +36 -0
- data/lib/avm/tools/version.rb +1 -1
- data/template/avm/eac_rails_base0/deploy/config/envvars.d/email.yml.template +11 -0
- 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/commons/all.tex +5 -0
- data/template/avm/eac_writings_base0/commons/ebook.tex +11 -0
- data/template/avm/eac_writings_base0/commons/images.tex +11 -0
- data/template/avm/eac_writings_base0/commons/links.tex +2 -0
- data/template/avm/eac_writings_base0/commons/portuguese.tex +8 -0
- data/template/avm/eac_writings_base0/commons/source_code.tex +21 -0
- data/template/avm/eac_writings_base0/commons/source_code/java.tex +15 -0
- data/template/avm/eac_writings_base0/commons/utils.tex +6 -0
- data/template/avm/eac_writings_base0/deploy/index.html.template +9 -0
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner.rb +12 -0
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/version.rb +1 -1
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/blank_not_blank.rb +19 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/configs/base.rb +43 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/configs/file.rb +12 -31
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/configs.rb +8 -40
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/configs/read_entry_options.rb +41 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/fs/clearable_directory.rb +57 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/paths_hash.rb +21 -58
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/paths_hash/entry_key_error.rb +8 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/paths_hash/node.rb +67 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/paths_hash/path_search.rb +39 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/struct.rb +4 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/blank_not_blank_spec.rb +16 -0
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/configs_spec.rb +15 -0
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/paths_hash_spec.rb +52 -13
- metadata +71 -36
- 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
- data/lib/avm/rails/runners/bundle.rb +0 -35
- data/lib/avm/rails/runners/runner.rb +0 -48
- data/lib/avm/stereotypes/eac_redmine_base0.rb +0 -11
- data/lib/avm/stereotypes/eac_wordpress_base0/apache_host.rb +0 -27
- data/lib/avm/stereotypes/eac_wordpress_base0/deploy.rb +0 -12
- data/lib/avm/stereotypes/eac_wordpress_base0/instance.rb +0 -26
- data/lib/avm/stereotypes/postgresql/instance.rb +0 -65
- data/lib/avm/stereotypes/postgresql/instance/data_unit.rb +0 -41
- data/lib/avm/stereotypes/postgresql/instance_with.rb +0 -20
- data/lib/avm/tools/runner/eac_rails_base0/apache_host.rb +0 -16
- data/lib/avm/tools/runner/eac_rails_base0/bundle.rb +0 -14
- data/lib/avm/tools/runner/eac_rails_base0/deploy.rb +0 -15
- data/lib/avm/tools/runner/eac_redmine_base0/bundle.rb +0 -14
- data/lib/avm/tools/runner/eac_redmine_base0/data.rb +0 -27
- data/lib/avm/tools/runner/eac_redmine_base0/data/dump.rb +0 -16
- data/lib/avm/tools/runner/eac_redmine_base0/deploy.rb +0 -15
- data/lib/avm/tools/runner/eac_redmine_base0/runner.rb +0 -14
- data/lib/avm/tools/runner/eac_wordpress_base0/apache_host.rb +0 -17
- data/lib/avm/tools/runner/eac_wordpress_base0/data.rb +0 -15
- data/lib/avm/tools/runner/eac_wordpress_base0/deploy.rb +0 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4600b008c9ecc3f3aaa220ec18cac2199559787186710d80e6cd1fda6f39cf97
|
4
|
+
data.tar.gz: a8f6c806934616363ef26f4acc6e486a0f3fd215867e013c588256c20e077086
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d10aa9242ee96189a7f43ab7ba1d1dc8cda2c7bb9961566ed7c2bf2a2a33d4c285eb1a42eb747342e2a6d2a1f5130e4681871dbc92cf9716978914216c922a12
|
7
|
+
data.tar.gz: 6eab4907c7e01156c4a7394e0ffa1503a1a8cdc3dce4e4f05aabd105b66c0576baecd6b30f0779e01565c78db3603614e8e75426b3cead19751d7bef2de582db
|
@@ -1,13 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'avm/
|
4
|
-
require 'avm/rails/instance'
|
3
|
+
require 'avm/eac_rails_base1/instance'
|
5
4
|
|
6
5
|
module Avm
|
7
6
|
module EacRailsBase0
|
8
|
-
class Instance < ::Avm::
|
9
|
-
include ::Avm::Rails::Instance
|
10
|
-
|
7
|
+
class Instance < ::Avm::EacRailsBase1::Instance
|
11
8
|
FILES_UNITS = { uploads: 'public/uploads' }.freeze
|
12
9
|
end
|
13
10
|
end
|
@@ -1,10 +1,15 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'avm/eac_webapp_base0/instance'
|
4
|
+
require 'eac_ruby_gems_utils/gem'
|
5
|
+
|
3
6
|
module Avm
|
4
|
-
module
|
5
|
-
|
7
|
+
module EacRailsBase1
|
8
|
+
class Instance < ::Avm::EacWebappBase0::Instance
|
9
|
+
DEFAULT_RAILS_ENVIRONMENT = 'production'
|
10
|
+
|
6
11
|
def bundle(*args)
|
7
|
-
the_gem.bundle(*args).chdir_root.envvar('RAILS_ENV',
|
12
|
+
the_gem.bundle(*args).chdir_root.envvar('RAILS_ENV', DEFAULT_RAILS_ENVIRONMENT)
|
8
13
|
end
|
9
14
|
|
10
15
|
def rake(*args)
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/eac_rails_base1/runner_with/bundle'
|
4
|
+
require 'eac_cli/core_ext'
|
5
|
+
require 'eac_ruby_utils/console/docopt_runner'
|
6
|
+
require 'shellwords'
|
7
|
+
|
8
|
+
module Avm
|
9
|
+
module EacRailsBase1
|
10
|
+
class Runner < ::Avm::EacWebappBase0::Runner
|
11
|
+
class Bundle
|
12
|
+
runner_with ::Avm::EacRailsBase1::RunnerWith::Bundle
|
13
|
+
runner_definition do
|
14
|
+
desc 'Runs "bundle ...".'
|
15
|
+
pos_arg :'bundle-args', repeat: true, optional: true
|
16
|
+
end
|
17
|
+
|
18
|
+
def run
|
19
|
+
bundle_run
|
20
|
+
end
|
21
|
+
|
22
|
+
def bundle_args
|
23
|
+
parsed.bundle_args.reject { |arg| arg == '--' }
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/eac_rails_base1/runner_with/bundle'
|
4
|
+
require 'eac_cli/core_ext'
|
5
|
+
require 'eac_ruby_utils/console/docopt_runner'
|
6
|
+
|
7
|
+
module Avm
|
8
|
+
module EacRailsBase1
|
9
|
+
class Runner < ::Avm::EacWebappBase0::Runner
|
10
|
+
class CodeRunner
|
11
|
+
runner_with ::Avm::EacRailsBase1::RunnerWith::Bundle
|
12
|
+
runner_definition do
|
13
|
+
desc 'Runs a Ruby code with "rails runner".'
|
14
|
+
pos_arg :code
|
15
|
+
end
|
16
|
+
|
17
|
+
def run
|
18
|
+
infov 'Environment', runner_context.call(:instance).host_env
|
19
|
+
bundle_run
|
20
|
+
end
|
21
|
+
|
22
|
+
def bundle_args
|
23
|
+
%w[exec rails runner] + [parsed.code]
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/eac_rails_base1/instance'
|
4
|
+
require 'eac_cli/runner'
|
5
|
+
|
6
|
+
module Avm
|
7
|
+
module EacRailsBase1
|
8
|
+
module RunnerWith
|
9
|
+
module Bundle
|
10
|
+
DEFAULT_RAILS_ENVIRONMENT_CONSTANT = 'DEFAULT_RAILS_ENVIRONMENT'
|
11
|
+
|
12
|
+
common_concern do
|
13
|
+
include ::EacCli::Runner
|
14
|
+
|
15
|
+
runner_definition do
|
16
|
+
arg_opt '-e', '--environment', 'Specifies the environment for the runner to operate' \
|
17
|
+
' (test/development/production). Default: "development".'
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
module ClassMethods
|
22
|
+
def default_rails_environment
|
23
|
+
const_get(DEFAULT_RAILS_ENVIRONMENT_CONSTANT)
|
24
|
+
rescue ::NameError
|
25
|
+
::Avm::EacRailsBase1::Instance::DEFAULT_RAILS_ENVIRONMENT
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def bundle_command
|
30
|
+
rails_instance.bundle(*bundle_args).envvar('RAILS_ENV', rails_environment)
|
31
|
+
end
|
32
|
+
|
33
|
+
def bundle_run
|
34
|
+
infov 'Bundle arguments', ::Shellwords.join(bundle_args)
|
35
|
+
infov 'Rails environment', rails_environment
|
36
|
+
bundle_command.system!
|
37
|
+
end
|
38
|
+
|
39
|
+
def default_rails_environment
|
40
|
+
self.class.default_rails_environment
|
41
|
+
end
|
42
|
+
|
43
|
+
def rails_instance
|
44
|
+
if respond_to?(:runner_context)
|
45
|
+
runner_context.call(:instance)
|
46
|
+
else
|
47
|
+
context(:instance)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
def rails_environment
|
52
|
+
parsed.environment.presence || default_rails_environment
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
@@ -3,13 +3,11 @@
|
|
3
3
|
require 'avm/eac_redmine_base0/data_unit'
|
4
4
|
require 'avm/eac_ubuntu_base0/docker_image'
|
5
5
|
require 'avm/eac_webapp_base0/instance'
|
6
|
-
require 'avm/
|
6
|
+
require 'avm/eac_rails_base1/instance'
|
7
7
|
|
8
8
|
module Avm
|
9
9
|
module EacRedmineBase0
|
10
|
-
class Instance < ::Avm::
|
11
|
-
include ::Avm::Rails::Instance
|
12
|
-
|
10
|
+
class Instance < ::Avm::EacRailsBase1::Instance
|
13
11
|
FILES_UNITS = { files: 'files' }.freeze
|
14
12
|
|
15
13
|
def docker_image_class
|
@@ -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_templatized_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
|