Class: Indocker::Repositories::Git
- Defined in:
- lib/indocker/repositories/git.rb
Constant Summary collapse
- DEFAULT_SSH_KEY =
"id_rsa"
Instance Attribute Summary collapse
-
#branch ⇒ Object
readonly
Returns the value of attribute branch.
-
#email ⇒ Object
readonly
Returns the value of attribute email.
-
#password ⇒ Object
readonly
Returns the value of attribute password.
-
#remote_name ⇒ Object
readonly
Returns the value of attribute remote_name.
-
#remote_url ⇒ Object
readonly
Returns the value of attribute remote_url.
-
#ssh_key ⇒ Object
readonly
Returns the value of attribute ssh_key.
Attributes inherited from Abstract
Instance Method Summary collapse
- #clone_path ⇒ Object
- #project_name ⇒ Object
- #setup(remote_name:, remote_url:, email: nil, password: nil, branch:, clone_path: nil, ssh_key: DEFAULT_SSH_KEY) ⇒ Object
Methods inherited from Abstract
#initialize, #is_git?, #is_local?, #is_no_sync?
Methods included from Concerns::Inspectable
Constructor Details
This class inherits a constructor from Indocker::Repositories::Abstract
Instance Attribute Details
#branch ⇒ Object (readonly)
Returns the value of attribute branch.
2 3 4 |
# File 'lib/indocker/repositories/git.rb', line 2 def branch @branch end |
#email ⇒ Object (readonly)
Returns the value of attribute email.
2 3 4 |
# File 'lib/indocker/repositories/git.rb', line 2 def email @email end |
#password ⇒ Object (readonly)
Returns the value of attribute password.
2 3 4 |
# File 'lib/indocker/repositories/git.rb', line 2 def password @password end |
#remote_name ⇒ Object (readonly)
Returns the value of attribute remote_name.
2 3 4 |
# File 'lib/indocker/repositories/git.rb', line 2 def remote_name @remote_name end |
#remote_url ⇒ Object (readonly)
Returns the value of attribute remote_url.
2 3 4 |
# File 'lib/indocker/repositories/git.rb', line 2 def remote_url @remote_url end |
#ssh_key ⇒ Object (readonly)
Returns the value of attribute ssh_key.
2 3 4 |
# File 'lib/indocker/repositories/git.rb', line 2 def ssh_key @ssh_key end |
Instance Method Details
#clone_path ⇒ Object
21 22 23 |
# File 'lib/indocker/repositories/git.rb', line 21 def clone_path @clone_path || "/tmp/#{Indocker.configuration.name}/repositories/git/#{project_name}/#{branch}" end |
#project_name ⇒ Object
17 18 19 |
# File 'lib/indocker/repositories/git.rb', line 17 def project_name @remote_url.split('/').last.gsub('.git', '') end |
#setup(remote_name:, remote_url:, email: nil, password: nil, branch:, clone_path: nil, ssh_key: DEFAULT_SSH_KEY) ⇒ Object
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/indocker/repositories/git.rb', line 6 def setup(remote_name:, remote_url:, email: nil, password: nil, branch:, clone_path: nil, ssh_key: DEFAULT_SSH_KEY) @remote_name = remote_name @remote_url = remote_url @email = email @password = password @branch = branch @clone_path = clone_path @ssh_key = ssh_key self end |