Class: KuberKit::Core::Artifacts::Git
- Inherits:
-
AbstractArtifact
- Object
- AbstractArtifact
- KuberKit::Core::Artifacts::Git
- Defined in:
- lib/kuber_kit/core/artifacts/git.rb
Constant Summary collapse
- DEFAULT_SSH_KEY =
"id_rsa"
- DEFAULT_REMOTE_NAME =
"origin"
- DEFAULT_BRANCH =
"master"
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 AbstractArtifact
Instance Method Summary collapse
- #cleanup_needed? ⇒ Boolean
- #cloned_path ⇒ Object
- #setup(remote_url:, remote_name: DEFAULT_REMOTE_NAME, branch: DEFAULT_BRANCH, clone_path: nil, ssh_key: DEFAULT_SSH_KEY, cache_result: true) ⇒ Object
- #sync_description ⇒ Object
Methods inherited from AbstractArtifact
Methods included from Extensions::Inspectable
Constructor Details
This class inherits a constructor from KuberKit::Core::Artifacts::AbstractArtifact
Instance Attribute Details
#branch ⇒ Object (readonly)
Returns the value of attribute branch.
2 3 4 |
# File 'lib/kuber_kit/core/artifacts/git.rb', line 2 def branch @branch end |
#email ⇒ Object (readonly)
Returns the value of attribute email.
2 3 4 |
# File 'lib/kuber_kit/core/artifacts/git.rb', line 2 def email @email end |
#password ⇒ Object (readonly)
Returns the value of attribute password.
2 3 4 |
# File 'lib/kuber_kit/core/artifacts/git.rb', line 2 def password @password end |
#remote_name ⇒ Object (readonly)
Returns the value of attribute remote_name.
2 3 4 |
# File 'lib/kuber_kit/core/artifacts/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/kuber_kit/core/artifacts/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/kuber_kit/core/artifacts/git.rb', line 2 def ssh_key @ssh_key end |
Instance Method Details
#cleanup_needed? ⇒ Boolean
28 29 30 |
# File 'lib/kuber_kit/core/artifacts/git.rb', line 28 def cleanup_needed? !@cache_result end |
#cloned_path ⇒ Object
18 19 20 21 22 |
# File 'lib/kuber_kit/core/artifacts/git.rb', line 18 def cloned_path # TODO: We should refactor to not call container here configs = KuberKit::Container['configs'] "#{configs.artifact_clone_dir}/#{name}" end |
#setup(remote_url:, remote_name: DEFAULT_REMOTE_NAME, branch: DEFAULT_BRANCH, clone_path: nil, ssh_key: DEFAULT_SSH_KEY, cache_result: true) ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/kuber_kit/core/artifacts/git.rb', line 8 def setup(remote_url:, remote_name: DEFAULT_REMOTE_NAME, branch: DEFAULT_BRANCH, clone_path: nil, ssh_key: DEFAULT_SSH_KEY, cache_result: true) @remote_name = remote_name @remote_url = remote_url @branch = branch @clone_path = clone_path @ssh_key = ssh_key @cache_result = cache_result self end |
#sync_description ⇒ Object
24 25 26 |
# File 'lib/kuber_kit/core/artifacts/git.rb', line 24 def sync_description "#{remote_url}:#{branch}" end |