Class: Dapp::GitRepo::Remote
Overview
Normal Git repo
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #cleanup! ⇒ Object
- #fetch!(branch = 'master') ⇒ Object
-
#initialize(application, name, url:) ⇒ Remote
constructor
A new instance of Remote.
Methods inherited from Base
#branch, #commit_at, #container_path, #exist_in_commit?, #git_bare, #latest_commit, #path
Constructor Details
#initialize(application, name, url:) ⇒ Remote
Returns a new instance of Remote.
5 6 7 8 9 10 11 12 13 |
# File 'lib/dapp/git_repo/remote.rb', line 5 def initialize(application, name, url:) super(application, name) @url = url application.project.log_secondary_process(application.project.t(code: 'process.git_artifact_clone', data: { name: name }), short: true) do git "clone --bare --depth 1 #{url} #{path}" end unless File.directory?(path) end |
Instance Method Details
#cleanup! ⇒ Object
21 22 23 24 |
# File 'lib/dapp/git_repo/remote.rb', line 21 def cleanup! super FileUtils.rm_rf path end |
#fetch!(branch = 'master') ⇒ Object
15 16 17 18 19 |
# File 'lib/dapp/git_repo/remote.rb', line 15 def fetch!(branch = 'master') application.project.log_secondary_process(application.project.t(code: 'process.git_artifact_fetch', data: { name: name }), short: true) do "fetch origin #{branch}:#{branch}" end unless application.ignore_git_fetch || application.project.dry_run? end |