uffizzi_core 2.1.2 → 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: 50974b21b408b32cfa4a51906d55860f0aa15e9b449a08a90ec408b3ea11a471
4
- data.tar.gz: 899cef8ae2a7935c479ad73aade6d044588ad604c632b29be6c9a8a6185805d4
3
+ metadata.gz: 31b523abfb135f26506fe25a9e6a74a90906f8fdb715ed167613d88869c1da7c
4
+ data.tar.gz: 387de06335635d9830d4120636100b75042fedd59221c16688c5f219c5a5a396
5
5
  SHA512:
6
- metadata.gz: 41408ab5b2dee546872ff3d6a1d8f4c341edb62fc5b1822951ee3237158293e4cd4283b4d326e33878566c521f609409a34a8b3ed376f2e9604f908e8bd71248
7
- data.tar.gz: 7d52b81047dfbf542f914d15bfd896d45e2c95f763cff9fd40f7f7e70356f30df77dc064b2705e778981858e856992cd16b4dcb261119a7e85cca948ccb4f802
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.2'
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.2
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-06 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