Class: Dapp::Project
- Inherits:
-
Object
- Object
- Dapp::Project
- Includes:
- Helper::Sha256, Helper::Trivia, Command::Bp, Command::Build, Command::Cleanup, Command::Common, Command::List, Command::Mrproper, Command::Push, Command::Run, Command::Spush, Command::StageImage, Command::Stages::CleanupLocal, Command::Stages::CleanupRepo, Command::Stages::Common, Command::Stages::FlushLocal, Command::Stages::FlushRepo, Command::Stages::Pull, Command::Stages::Push, Dappfile, Deps::Base, Deps::Gitartifact, Lock, Logging::Base, Logging::I18n, Logging::Paint, Logging::Process, Shellout::Base, Shellout::System, SshAgent
- Defined in:
- lib/dapp/project.rb,
lib/dapp/project/lock.rb,
lib/dapp/project/dappfile.rb,
lib/dapp/project/deps/base.rb,
lib/dapp/project/ssh_agent.rb,
lib/dapp/project/command/bp.rb,
lib/dapp/project/command/run.rb,
lib/dapp/project/command/list.rb,
lib/dapp/project/command/push.rb,
lib/dapp/project/logging/base.rb,
lib/dapp/project/logging/i18n.rb,
lib/dapp/project/command/build.rb,
lib/dapp/project/command/spush.rb,
lib/dapp/project/logging/paint.rb,
lib/dapp/project/shellout/base.rb,
lib/dapp/project/command/common.rb,
lib/dapp/project/command/cleanup.rb,
lib/dapp/project/logging/process.rb,
lib/dapp/project/shellout/system.rb,
lib/dapp/project/command/mrproper.rb,
lib/dapp/project/deps/gitartifact.rb,
lib/dapp/project/shellout/streaming.rb,
lib/dapp/project/command/stage_image.rb,
lib/dapp/project/command/stages/pull.rb,
lib/dapp/project/command/stages/push.rb,
lib/dapp/project/command/stages/common.rb,
lib/dapp/project/command/stages/flush_repo.rb,
lib/dapp/project/command/stages/flush_local.rb,
lib/dapp/project/command/stages/cleanup_repo.rb,
lib/dapp/project/command/stages/cleanup_local.rb
Overview
Project
Defined Under Namespace
Modules: Command, Dappfile, Deps, Lock, Logging, Shellout, SshAgent
Constant Summary
Constants included from Shellout::System
Shellout::System::SYSTEM_SHELLOUT_IMAGE, Shellout::System::SYSTEM_SHELLOUT_VERSION
Constants included from Deps::Base
Constants included from Deps::Gitartifact
Deps::Gitartifact::GITARTIFACT_VERSION
Constants included from Logging::Paint
Constants included from Logging::Process
Logging::Process::DEFAULT_STYLE
Instance Attribute Summary collapse
-
#apps_patterns ⇒ Object
readonly
Returns the value of attribute apps_patterns.
-
#cli_options ⇒ Object
readonly
Returns the value of attribute cli_options.
Instance Method Summary collapse
- #build_path ⇒ Object
- #cache_format ⇒ Object
-
#initialize(cli_options: {}, apps_patterns: nil) ⇒ Project
constructor
A new instance of Project.
- #name ⇒ Object
- #path ⇒ Object
- #stage_dapp_label_format ⇒ Object
Methods included from Shellout::System
default_env_keys, #system_shellout, #system_shellout!, #system_shellout_container, #system_shellout_container_name
Methods included from Shellout::Base
default_env_keys, included, #shellout, #shellout!, #shellout_pack
Methods included from Deps::Base
#base_container, #base_container_name, #sudo_command, #sudo_format_user
Methods included from Deps::Gitartifact
#git_path, #gitartifact_container, #gitartifact_container_name
Methods included from Helper::Trivia
class_to_lowercase, #class_to_lowercase, #delete_file, #kwargs
Methods included from Helper::Sha256
#hashsum, #paths_content_hashsum, #sha256
Methods included from SshAgent
#add_ssh_key, included, #run_ssh_agent, #setup_ssh_agent, #ssh_auth_sock
Methods included from Logging::Paint
included, initialize, #paint_string, #paint_style, #unpaint
Methods included from Logging::I18n
Methods included from Logging::Process
#log_process, #log_secondary_process, #log_state
Methods included from Logging::Base
#dry_run?, included, #introspect_before_error?, #introspect_error?, #log, #log_format_string, #log_indent, #log_indent_next, #log_indent_prev, #log_info, #log_quiet?, #log_secondary, #log_step, #log_step_with_indent, #log_time, #log_time?, #log_verbose?, #log_warning, #log_with_indent, #with_log_indent
Methods included from Command::StageImage
Methods included from Command::Mrproper
Methods included from Command::Cleanup
Methods included from Command::Stages::Pull
#pull_all_stages?, #stages_pull
Methods included from Command::Stages::Push
Methods included from Command::Stages::FlushRepo
Methods included from Command::Stages::FlushLocal
Methods included from Command::Stages::CleanupRepo
Methods included from Command::Stages::CleanupLocal
Methods included from Command::List
Methods included from Command::Spush
Methods included from Command::Push
Methods included from Command::Bp
Methods included from Command::Build
Methods included from Command::Run
Methods included from Dappfile
#apps, #build_configs, #dappfile_path, #dappfiles, #dapps_dappfiles_pathes, #expand_path, #search_up, #work_dir
Methods included from Lock
Constructor Details
#initialize(cli_options: {}, apps_patterns: nil) ⇒ Project
Returns a new instance of Project.
42 43 44 45 46 47 48 49 |
# File 'lib/dapp/project.rb', line 42 def initialize(cli_options: {}, apps_patterns: nil) @cli_options = @apps_patterns = apps_patterns || [] @apps_patterns << '*' unless @apps_patterns.any? Logging::Paint.initialize([:log_color]) Logging::I18n.initialize end |
Instance Attribute Details
#apps_patterns ⇒ Object (readonly)
Returns the value of attribute apps_patterns.
40 41 42 |
# File 'lib/dapp/project.rb', line 40 def apps_patterns @apps_patterns end |
#cli_options ⇒ Object (readonly)
Returns the value of attribute cli_options.
39 40 41 |
# File 'lib/dapp/project.rb', line 39 def @cli_options end |
Instance Method Details
#build_path ⇒ Object
70 71 72 73 74 75 76 77 78 |
# File 'lib/dapp/project.rb', line 70 def build_path @build_path ||= begin if [:build_dir] Pathname.new([:build_dir]) else Pathname.new(path).join('.dapps_build') end..tap(&:mkpath) end end |
#cache_format ⇒ Object
80 81 82 |
# File 'lib/dapp/project.rb', line 80 def cache_format "dappstage-#{name}-%{application_name}" end |
#name ⇒ Object
51 52 53 54 55 56 57 |
# File 'lib/dapp/project.rb', line 51 def name @name ||= begin system_shellout!("#{git_path} -C #{path} config --get remote.origin.url").stdout.strip.split('/').last[/.*(?=.git)/] rescue Error::Shellout File.basename(path) end end |
#path ⇒ Object
59 60 61 62 63 64 65 66 67 68 |
# File 'lib/dapp/project.rb', line 59 def path @path ||= begin dappfile_path = dappfiles.first if File.basename((dappfile_path, 2)) == '.dapps' (dappfile_path, 3) else (dappfile_path) end end end |
#stage_dapp_label_format ⇒ Object
84 85 86 |
# File 'lib/dapp/project.rb', line 84 def stage_dapp_label_format '%{application_name}' end |