Class: Kamal::Cli::Build::Clone
- Inherits:
-
Object
- Object
- Kamal::Cli::Build::Clone
- Defined in:
- lib/kamal/cli/build/clone.rb
Instance Attribute Summary collapse
-
#sshkit ⇒ Object
readonly
Returns the value of attribute sshkit.
Instance Method Summary collapse
-
#initialize(sshkit) ⇒ Clone
constructor
A new instance of Clone.
- #prepare ⇒ Object
Constructor Details
#initialize(sshkit) ⇒ Clone
Returns a new instance of Clone.
7 8 9 |
# File 'lib/kamal/cli/build/clone.rb', line 7 def initialize(sshkit) @sshkit = sshkit end |
Instance Attribute Details
#sshkit ⇒ Object (readonly)
Returns the value of attribute sshkit.
4 5 6 |
# File 'lib/kamal/cli/build/clone.rb', line 4 def sshkit @sshkit end |
Instance Method Details
#prepare ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/kamal/cli/build/clone.rb', line 11 def prepare begin clone_repo rescue SSHKit::Command::Failed => e if e. =~ /already exists and is not an empty directory/ reset else raise Kamal::Cli::Build::BuildError, "Failed to clone repo: #{e.}" end end validate! rescue Kamal::Cli::Build::BuildError => e error "Error preparing clone: #{e.}, deleting and retrying..." FileUtils.rm_rf KAMAL.config.builder.clone_directory clone_repo validate! end |