Class: UffizziCore::RepoService
- Inherits:
-
Object
- Object
- UffizziCore::RepoService
- Defined in:
- app/services/uffizzi_core/repo_service.rb
Class Method Summary collapse
- .credential(repo) ⇒ Object
- .image(repo) ⇒ Object
- .image_name(repo) ⇒ Object
- .needs_target_port?(repo) ⇒ Boolean
Class Method Details
.credential(repo) ⇒ Object
11 12 13 14 15 |
# File 'app/services/uffizzi_core/repo_service.rb', line 11 def credential(repo) container_registry_service = UffizziCore::ContainerRegistryService.init_by_subclass(repo.type) credentials = repo.project.account.credentials container_registry_service.credential(credentials) end |
.image(repo) ⇒ Object
22 23 24 25 26 |
# File 'app/services/uffizzi_core/repo_service.rb', line 22 def image(repo) repo_credential = credential(repo) "#{repo_credential.registry_url}/#{image_name(repo)}" end |
.image_name(repo) ⇒ Object
17 18 19 20 |
# File 'app/services/uffizzi_core/repo_service.rb', line 17 def image_name(repo) "e#{repo.container.deployment_id}r#{repo.id}-#{Digest::SHA256.hexdigest("#{self.class}:#{repo.branch}: #{repo.project_id}:#{repo.id}")[0, 10]}" end |
.needs_target_port?(repo) ⇒ Boolean
5 6 7 8 9 |
# File 'app/services/uffizzi_core/repo_service.rb', line 5 def needs_target_port?(repo) return false if repo.nil? !repo.dockerfile? end |