uffizzi_core 0.3.3 → 0.3.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0995e3de000730f4d7d9efeeb62415e374f4d58569b31a60db5faffa99f58453'
4
- data.tar.gz: 53ea793138e8229747e1462156a158e0c4114130c03c7a7eb7993d66e07f472f
3
+ metadata.gz: 34e197de1424923114ad82fd43fa818b4841058bd0681e3320c4ba4e2352c452
4
+ data.tar.gz: 4b94e04a11bcef28b4fc732fbf0c0d2f51a6512b609fbbc8cbe9b52d2123fd4f
5
5
  SHA512:
6
- metadata.gz: cdba3364a0821713bb040dc31192fcbac362aea072ae0865d5353576b0428ee7aeada4fcdd15733dfdef340e0c49bd9055f07752a712f7c0063d3dd4cc396c88
7
- data.tar.gz: 3fec15634e8fc1e9de9eea24b2b913832633cba55065390ee22141f80a22290d31d50c30a9f998ff2d0cd90d023d45a0f3ad7fc0dd111d84d7235111e63c4882
6
+ metadata.gz: 97b2382ee4af9787273b595d1d8840332c51dba8d861cc7752a773137ab1e2639129219ad361ef1f752e5cc88e3a3524b142c84fca22e4076f4da273c461e8ae
7
+ data.tar.gz: 195a8f935b0866004c1e6a0a7beb9b42f613042d36f66f2331f19bb86c5c8bb67df5f190d8a42ab5d97c42ddb9fb51685d9082e5370e8edc3fcf51cf872e9e11
@@ -68,5 +68,9 @@ module UffizziCore::Concerns::Models::Deployment
68
68
  active_containers.each(&:disable!)
69
69
  UffizziCore::Deployment::DeleteJob.perform_async(id)
70
70
  end
71
+
72
+ def preview_url
73
+ "#{subdomain}.#{Settings.app.managed_dns_zone}"
74
+ end
71
75
  end
72
76
  end
@@ -6,8 +6,4 @@ class UffizziCore::Api::Cli::V1::ProjectSerializer::DeploymentSerializer < Uffiz
6
6
  attributes :id,
7
7
  :preview_url,
8
8
  :state
9
-
10
- def preview_url
11
- UffizziCore::DeploymentService.build_preview_url(object)
12
- end
13
9
  end
@@ -30,10 +30,6 @@ class UffizziCore::Api::Cli::V1::Projects::DeploymentSerializer < UffizziCore::B
30
30
  object.containers.active
31
31
  end
32
32
 
33
- def preview_url
34
- UffizziCore::DeploymentService.build_preview_url(object)
35
- end
36
-
37
33
  def tag
38
34
  object.ingress_container&.tag
39
35
  end
@@ -52,7 +52,7 @@ class UffizziCore::ControllerService
52
52
  body = {
53
53
  containers: containers,
54
54
  credentials: credentials,
55
- deployment_url: UffizziCore::DeploymentService.build_preview_url(deployment),
55
+ deployment_url: deployment.preview_url,
56
56
  }
57
57
 
58
58
  if password_protection_module.present?
@@ -62,7 +62,7 @@ class UffizziCore::DeploymentService
62
62
  Rails.logger.info("DEPLOYMENT_PROCESS deployment_id=#{deployment.id} start deploying into controller")
63
63
 
64
64
  containers = deployment.active_containers
65
- containers = add_default_deployment_variables!(containers)
65
+ containers = add_default_deployment_variables!(containers, deployment)
66
66
 
67
67
  UffizziCore::ControllerService.deploy_containers(deployment, containers)
68
68
  else
@@ -284,13 +284,15 @@ class UffizziCore::DeploymentService
284
284
  Digest::SHA256.hexdigest("#{container.id}:#{container.image}")[0, 10]
285
285
  end
286
286
 
287
- def add_default_deployment_variables!(containers)
287
+ def add_default_deployment_variables!(containers, deployment)
288
288
  containers.each do |container|
289
289
  envs = []
290
290
  if container.port.present? && !UffizziCore::ContainerService.defines_env?(container, 'PORT')
291
291
  envs.push('name' => 'PORT', 'value' => container.target_port.to_s)
292
292
  end
293
293
 
294
+ envs.push('name' => 'UFFIZZI_URL', 'value' => "https://#{deployment.preview_url}")
295
+
294
296
  container.variables = [] if container.variables.nil?
295
297
 
296
298
  container.variables.push(*envs)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module UffizziCore
4
- VERSION = '0.3.3'
4
+ VERSION = '0.3.4'
5
5
  end
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.3
4
+ version: 0.3.4
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-19 00:00:00.000000000 Z
12
+ date: 2022-07-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: aasm