uffizzi_core 0.3.0 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/controllers/concerns/uffizzi_core/dependency_injection_concern.rb +6 -0
- data/app/jobs/uffizzi_core/config_file/apply_job.rb +2 -2
- data/app/lib/uffizzi_core/concerns/models/deployment.rb +1 -0
- data/app/serializers/uffizzi_core/controller/deploy_containers/container_serializer.rb +2 -4
- data/app/services/uffizzi_core/compose_file/builders/container_builder_service.rb +3 -1
- data/app/services/uffizzi_core/controller_service.rb +6 -0
- data/app/services/uffizzi_core/docker_hub_service.rb +6 -6
- data/db/migrate/20220704135629_add_disabled_at_to_deployments.rb +16 -0
- data/lib/uffizzi_core/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0995e3de000730f4d7d9efeeb62415e374f4d58569b31a60db5faffa99f58453'
|
4
|
+
data.tar.gz: 53ea793138e8229747e1462156a158e0c4114130c03c7a7eb7993d66e07f472f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cdba3364a0821713bb040dc31192fcbac362aea072ae0865d5353576b0428ee7aeada4fcdd15733dfdef340e0c49bd9055f07752a712f7c0063d3dd4cc396c88
|
7
|
+
data.tar.gz: 3fec15634e8fc1e9de9eea24b2b913832633cba55065390ee22141f80a22290d31d50c30a9f998ff2d0cd90d023d45a0f3ad7fc0dd111d84d7235111e63c4882
|
@@ -13,6 +13,12 @@ module UffizziCore::DependencyInjectionConcern
|
|
13
13
|
module_class(:github)
|
14
14
|
end
|
15
15
|
|
16
|
+
def password_protection_module
|
17
|
+
return unless module_exists?(:password_protection)
|
18
|
+
|
19
|
+
module_class(:password_protection)
|
20
|
+
end
|
21
|
+
|
16
22
|
private
|
17
23
|
|
18
24
|
def module_exists?(module_name)
|
@@ -5,7 +5,7 @@ class UffizziCore::ConfigFile::ApplyJob < UffizziCore::ApplicationJob
|
|
5
5
|
|
6
6
|
sidekiq_retry_in do |count, exception|
|
7
7
|
case exception
|
8
|
-
when UffizziCore::
|
8
|
+
when UffizziCore::DeploymentNotFoundError
|
9
9
|
Rails.logger.info("DEPLOYMENT_PROCESS ApplyJob retry deployment_id=#{exception.deployment_id} count=#{count}")
|
10
10
|
Settings.controller.resource_create_retry_time
|
11
11
|
end
|
@@ -22,7 +22,7 @@ class UffizziCore::ConfigFile::ApplyJob < UffizziCore::ApplicationJob
|
|
22
22
|
end
|
23
23
|
|
24
24
|
unless UffizziCore::ControllerService.deployment_exists?(deployment)
|
25
|
-
raise UffizziCore::
|
25
|
+
raise UffizziCore::DeploymentNotFoundError,
|
26
26
|
deployment_id
|
27
27
|
end
|
28
28
|
|
@@ -27,13 +27,11 @@ class UffizziCore::Controller::DeployContainers::ContainerSerializer < UffizziCo
|
|
27
27
|
credential = UffizziCore::RepoService.credential(repo)
|
28
28
|
|
29
29
|
case repo.type
|
30
|
-
when UffizziCore::Repo::Google.name, UffizziCore::Repo::Amazon.name, UffizziCore::Repo::Azure.name
|
30
|
+
when UffizziCore::Repo::Google.name, UffizziCore::Repo::Amazon.name, UffizziCore::Repo::Azure.name,
|
31
|
+
UffizziCore::Repo::GithubContainerRegistry.name
|
31
32
|
registry_host = URI.parse(credential.registry_url).host
|
32
33
|
|
33
34
|
"#{registry_host}/#{object.image}"
|
34
|
-
when UffizziCore::Repo::GithubContainerRegistry.name
|
35
|
-
registry_host = URI.parse(credential.registry_url).host
|
36
|
-
"#{registry_host}/#{repo.namespace}/#{object.image}"
|
37
35
|
else
|
38
36
|
object.image
|
39
37
|
end
|
@@ -105,7 +105,9 @@ class UffizziCore::ComposeFile::Builders::ContainerBuilderService
|
|
105
105
|
end
|
106
106
|
|
107
107
|
def image_name(container_data, image_data)
|
108
|
-
if image_data[:registry_url].present? &&
|
108
|
+
if image_data[:registry_url].present? &&
|
109
|
+
!UffizziCore::ComposeFile::ContainerService.google?(container_data) &&
|
110
|
+
!UffizziCore::ComposeFile::ContainerService.github_container_registry?(container_data)
|
109
111
|
image_data[:name]
|
110
112
|
else
|
111
113
|
"#{image_data[:namespace]}/#{image_data[:name]}"
|
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
class UffizziCore::ControllerService
|
4
4
|
class << self
|
5
|
+
include UffizziCore::DependencyInjectionConcern
|
6
|
+
|
5
7
|
def apply_config_file(deployment, config_file)
|
6
8
|
body = {
|
7
9
|
config_file: UffizziCore::Controller::ApplyConfigFile::ConfigFileSerializer.new(config_file).as_json,
|
@@ -53,6 +55,10 @@ class UffizziCore::ControllerService
|
|
53
55
|
deployment_url: UffizziCore::DeploymentService.build_preview_url(deployment),
|
54
56
|
}
|
55
57
|
|
58
|
+
if password_protection_module.present?
|
59
|
+
body = password_protection_module.add_password_configuration(body, deployment.project_id)
|
60
|
+
end
|
61
|
+
|
56
62
|
controller_client.deploy_containers(deployment_id: deployment.id, body: body)
|
57
63
|
end
|
58
64
|
|
@@ -49,13 +49,13 @@ class UffizziCore::DockerHubService
|
|
49
49
|
end
|
50
50
|
|
51
51
|
def user_client(credential)
|
52
|
-
if @client.
|
53
|
-
@client = UffizziCore::DockerHubClient.new(credential)
|
52
|
+
return @client if @client&.credential&.username == credential.username
|
54
53
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
54
|
+
@client = UffizziCore::DockerHubClient.new(credential)
|
55
|
+
|
56
|
+
unless @client.authentificated?
|
57
|
+
Rails.logger.warn("broken credentials, DockerHubService credential_id=#{credential.id}")
|
58
|
+
credential.unauthorize! unless credential.unauthorized?
|
59
59
|
end
|
60
60
|
|
61
61
|
@client
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class AddDisabledAtToDeployments < ActiveRecord::Migration[6.1]
|
4
|
+
def up
|
5
|
+
change_table :uffizzi_core_deployments do |t|
|
6
|
+
t.datetime :disabled_at
|
7
|
+
end
|
8
|
+
UffizziCore::Deployment.disabled.update_all('disabled_at = updated_at')
|
9
|
+
end
|
10
|
+
|
11
|
+
def down
|
12
|
+
change_table :uffizzi_core_deployments do |t|
|
13
|
+
t.remove :disabled_at
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
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: 0.3.
|
4
|
+
version: 0.3.3
|
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: 2022-07-
|
12
|
+
date: 2022-07-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: aasm
|
@@ -957,6 +957,7 @@ files:
|
|
957
957
|
- db/migrate/20220419074956_add_health_check_to_containers.rb
|
958
958
|
- db/migrate/20220422151523_add_volumes_to_uffizzi_core_containers.rb
|
959
959
|
- db/migrate/20220525113412_rename_name_to_uffizzi_containers.rb
|
960
|
+
- db/migrate/20220704135629_add_disabled_at_to_deployments.rb
|
960
961
|
- db/seeds.rb
|
961
962
|
- lib/tasks/uffizzi_core_tasks.rake
|
962
963
|
- lib/uffizzi_core.rb
|