Class: Avm::EacWebappBase0::Instances::Deploy
- Inherits:
-
Object
- Object
- Avm::EacWebappBase0::Instances::Deploy
show all
- Includes:
- Avm::Entries::Jobs::Base
- Defined in:
- lib/avm/eac_webapp_base0/instances/deploy.rb,
lib/avm/eac_webapp_base0/instances/deploy/scm.rb,
lib/avm/eac_webapp_base0/instances/deploy/info.rb,
lib/avm/eac_webapp_base0/instances/deploy/build.rb,
lib/avm/eac_webapp_base0/instances/deploy/write_on_target.rb,
lib/avm/eac_webapp_base0/instances/deploy/setup_files_unit.rb,
lib/avm/eac_webapp_base0/instances/deploy/appended_directories.rb
Defined Under Namespace
Modules: AppendedDirectories, Build, Info, Scm, WriteOnTarget
Classes: SetupFilesUnit
Constant Summary
collapse
- DEFAULT_REFERENCE =
'HEAD'
- REQUEST_TEST_JOB =
'request_test'
- JOBS =
(%w[create_build_dir build_content append_instance_content write_on_target
setup_files_units assert_instance_branch] + [REQUEST_TEST_JOB]).freeze
Instance Method Summary
collapse
Instance Method Details
#assert_instance_branch ⇒ Object
50
51
52
53
54
55
56
|
# File 'lib/avm/eac_webapp_base0/instances/deploy.rb', line 50
def assert_instance_branch
return unless remote_write?
infom 'Setting instance branch...'
git.command('push', git_remote_name, "#{commit_reference}:refs/heads/#{instance.id}",
'-f').execute!
end
|
#request_test ⇒ Object
58
59
60
61
62
63
64
|
# File 'lib/avm/eac_webapp_base0/instances/deploy.rb', line 58
def request_test
infom 'Requesting web interface...'
uri = URI(instance.read_entry('web.url'))
response = ::Net::HTTP.get_response(uri)
infov 'Response status', response.code
fatal_error "Request to #{uri} failed" unless response.code.to_i == 200
end
|
#run ⇒ Object
30
31
32
33
34
|
# File 'lib/avm/eac_webapp_base0/instances/deploy.rb', line 30
def run
super
ensure
remove_build_dir
end
|
#setup_files_units ⇒ Object
45
46
47
48
|
# File 'lib/avm/eac_webapp_base0/instances/deploy.rb', line 45
def setup_files_units
instance.data_package.units.values.map(&:installation_files_data).select(&:present?)
.each { |unit_install| setup_files_unit(unit_install.key, unit_install.subpath) }
end
|
#start_banner ⇒ Object
36
37
38
39
40
41
42
43
|
# File 'lib/avm/eac_webapp_base0/instances/deploy.rb', line 36
def start_banner
infov 'Instance', instance
infov 'Git reference (User)', git_reference.if_present('- BLANK -')
infov 'Git remote name', git_remote_name
infov 'Git reference (Found)', git_reference_found
infov 'Git commit SHA1', commit_reference
infov 'Appended directories', appended_directories
end
|