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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 31b523abfb135f26506fe25a9e6a74a90906f8fdb715ed167613d88869c1da7c
|
4
|
+
data.tar.gz: 387de06335635d9830d4120636100b75042fedd59221c16688c5f219c5a5a396
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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.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-
|
12
|
+
date: 2023-02-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: aasm
|