uffizzi_core 2.1.3 → 2.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4a920d00be62a50b051ef96fecaa9d3e9ca1009e366fc2521efd215dc5193f0a
4
- data.tar.gz: 6ddcda3a07b729fad5d43afcc97d729aaa392accbf3288b5bafcfc963305c357
3
+ metadata.gz: 31b523abfb135f26506fe25a9e6a74a90906f8fdb715ed167613d88869c1da7c
4
+ data.tar.gz: 387de06335635d9830d4120636100b75042fedd59221c16688c5f219c5a5a396
5
5
  SHA512:
6
- metadata.gz: c4d4dfbf12d26127991891c84f15c5b978f317ebf22e0826381a32e588c3fb3ba31b7511d1ee97b65bcc4982303638580fc602d4ba72cd5f8d61185e46715510
7
- data.tar.gz: 389889aa1a60bb76568e8b4775ea2ba76514c1a980a275f15433c4feae90144c3d66d15360cf813bd68c5f0f080485e4245d80c838661d2f7930c765e353bdf5
6
+ metadata.gz: 92172c981d9c5883dd1ab8f6dc6f7c708a6a73e94c6dcba9193dd5f95ef1daf894db88172a1eed229a319baba70c8cb5a1058072209e821f884a6505ee116b69
7
+ data.tar.gz: 938c57b21171b791af729fb02eff4e964836329f4ec218a5b0bf00c208a8ac53e016e9a99b9ffbdf1ffcaa58a7b7e8b4345df1dee6113fa053e5a13f1257f032
@@ -43,7 +43,7 @@ module UffizziCore::Concerns::Models::Deployment
43
43
  state :failed
44
44
  state :disabled
45
45
 
46
- event :activate do
46
+ event :activate, after: :after_activate do
47
47
  transitions from: [:disabled], to: :active
48
48
  end
49
49
 
@@ -56,6 +56,10 @@ module UffizziCore::Concerns::Models::Deployment
56
56
  end
57
57
  end
58
58
 
59
+ def after_activate
60
+ update!(disabled_at: nil)
61
+ end
62
+
59
63
  def after_disable
60
64
  clean
61
65
  update!(disabled_at: Time.now)
@@ -27,23 +27,22 @@ class UffizziCore::DeploymentService
27
27
  deployment_form
28
28
  end
29
29
 
30
- def update_from_compose(compose_file, project, user, deployment, metadata)
30
+ def update_from_compose(compose_file, project, user, deployment, metadata = {})
31
31
  deployment_attributes = ActionController::Parameters.new(compose_file.template.payload)
32
32
 
33
33
  deployment_form = UffizziCore::Api::Cli::V1::Deployment::UpdateForm.new(deployment_attributes)
34
34
  deployment_form.assign_dependences!(project, user)
35
35
  deployment_form.compose_file = compose_file
36
- deployment_form.metadata = metadata || {}
36
+ deployment_form.metadata = metadata
37
37
 
38
38
  ActiveRecord::Base.transaction do
39
39
  deployment.containers.destroy_all
40
40
  deployment.compose_file.destroy! if deployment.compose_file&.kind&.temporary?
41
+ deployment.activate unless deployment.active?
41
42
  params = {
42
43
  containers: deployment_form.containers,
43
44
  compose_file_id: compose_file.id,
44
- creation_source: UffizziCore::Deployment.creation_source.compose_file_manual,
45
45
  metadata: deployment_form.metadata,
46
- state: :active,
47
46
  }
48
47
  deployment.update!(params)
49
48
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module UffizziCore
4
- VERSION = '2.1.3'
4
+ VERSION = '2.1.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: 2.1.3
4
+ version: 2.1.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: 2023-02-07 00:00:00.000000000 Z
12
+ date: 2023-02-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: aasm