uffizzi_core 2.1.22 → 2.1.24
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/concerns/uffizzi_core/dependency_injection_concern.rb +8 -0
- data/app/serializers/uffizzi_core/api/cli/v1/projects/deployment_serializer.rb +3 -0
- data/app/services/uffizzi_core/activity_item_service.rb +9 -6
- data/app/services/uffizzi_core/container_registry/docker_hub_service.rb +3 -0
- data/lib/uffizzi_core/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de321ff2e21c9c9b909b4739eb07728d4399801c45d267c5608142d2634f519f
|
4
|
+
data.tar.gz: 4550ded63ea25d6a480c0e9a93964285746fae2d6582e73bb6829eb3a18e9163
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3de13bddf08f86c9eb18e7d21b4ccd9ce074815a6716888357f3b93f99f4ed92da9be571296897240f7245e4f4709ff7fd183aab70a915072c15932cd00cae4e
|
7
|
+
data.tar.gz: 8634b6e9021ec0f1a5fa883957a91ddbaa4e367e3d2f0b97da4a108c4b935c552bfb944dd6156ef06fb075395904e3d6ed69b59ea15b7af7611daed24a8b39d5
|
@@ -1,6 +1,14 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module UffizziCore::DependencyInjectionConcern
|
4
|
+
extend ActiveSupport::Concern
|
5
|
+
|
6
|
+
class_methods do
|
7
|
+
def include_module_if_exists(module_name)
|
8
|
+
include(Object.const_get(module_name)) if Object.const_defined?(module_name)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
4
12
|
def user_access_module
|
5
13
|
return unless module_exists?(:rbac)
|
6
14
|
|
@@ -1,6 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
class UffizziCore::Api::Cli::V1::Projects::DeploymentSerializer < UffizziCore::BaseSerializer
|
4
|
+
include UffizziCore::DependencyInjectionConcern
|
5
|
+
include_module_if_exists('UffizziCore::Api::Cli::V1::Projects::DeploymentSerializerModule')
|
6
|
+
|
4
7
|
type :deployment
|
5
8
|
|
6
9
|
attributes :id,
|
@@ -45,18 +45,16 @@ class UffizziCore::ActivityItemService
|
|
45
45
|
deployment = container.deployment
|
46
46
|
service = UffizziCore::ManageActivityItemsService.new(deployment)
|
47
47
|
container_status_item = service.container_status_item(container)
|
48
|
+
return if container_status_item.nil?
|
49
|
+
|
48
50
|
status = container_status_item[:status]
|
49
51
|
last_event = activity_item.events.order_by_id.last
|
50
|
-
|
51
52
|
activity_item.events.create(state: status) if last_event&.state != status
|
52
53
|
|
53
|
-
if failed?(status)
|
54
|
-
UffizziCore::ActivityItemService.fail_deployment!(activity_item)
|
55
|
-
notification_module.notify_about_failed_deployment(deployment) if notification_module.present?
|
56
|
-
end
|
54
|
+
return handle_failed_status(activity_item, deployment) if failed?(status)
|
57
55
|
|
58
56
|
if deployed?(status) && UffizziCore::ContainerService.ingress_container?(container)
|
59
|
-
deployment.update(last_deploy_at: last_event.created_at)
|
57
|
+
return deployment.update(last_deploy_at: last_event.created_at)
|
60
58
|
end
|
61
59
|
|
62
60
|
return unless [UffizziCore::Event.state.building, UffizziCore::Event.state.deploying].include?(status)
|
@@ -66,6 +64,11 @@ class UffizziCore::ActivityItemService
|
|
66
64
|
|
67
65
|
private
|
68
66
|
|
67
|
+
def handle_failed_status(activity_item, deployment)
|
68
|
+
UffizziCore::ActivityItemService.fail_deployment!(activity_item)
|
69
|
+
notification_module.notify_about_failed_deployment(deployment) if notification_module.present?
|
70
|
+
end
|
71
|
+
|
69
72
|
def create_item!(activity_item_attributes)
|
70
73
|
activity_item = UffizziCore::ActivityItem.find_by(activity_item_attributes)
|
71
74
|
return activity_item unless completed?(activity_item)
|
@@ -37,6 +37,9 @@ class UffizziCore::ContainerRegistry::DockerHubService
|
|
37
37
|
token = docker_hub_client.get_token(image).result.token
|
38
38
|
response = docker_hub_client.digest(image: image, tag: tag, token: token)
|
39
39
|
response.headers['docker-content-digest']
|
40
|
+
# FIXME: can't get digest for private image: {"code":"UNAUTHORIZED","message":"authentication required"...}
|
41
|
+
rescue UffizziCore::ContainerRegistryError
|
42
|
+
'unknown'
|
40
43
|
end
|
41
44
|
|
42
45
|
def credential_correct?(credential)
|
data/lib/uffizzi_core/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uffizzi_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.24
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josh Thurman
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-05-
|
12
|
+
date: 2023-05-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: aasm
|