deploy-context 2.13.17 → 2.13.20
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
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- metadata +2 -49
- metadata.gz.sig +0 -0
- data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/context-knife-context.rb +0 -26
- data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/context-manager.rb +0 -100
- data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/cookbook-studio.rb +0 -72
- data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/cucumber-studio.rb +0 -45
- data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/cucumber-suite.rb +0 -179
- data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/default-studio.rb +0 -174
- data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/deploy/chef.rb +0 -57
- data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/deploy/context.rb +0 -42
- data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/deploy/cookbook.rb +0 -121
- data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/deploy/cucumber.rb +0 -42
- data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/deploy/deployer.rb +0 -83
- data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/deploy/git.rb +0 -62
- data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/deploy/habitat.rb +0 -112
- data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/deploy/ruby.rb +0 -138
- data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/deploy/vagrant.rb +0 -7
- data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/habitat-studio.rb +0 -50
- data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/helpers/command.rb +0 -91
- data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/helpers/gemspec.rb +0 -91
- data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/helpers/rake_tasks.rb +0 -150
- data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/knife/default_knife_context.rb +0 -35
- data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/knife/dummy_knife.rb +0 -43
- data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/ruby-studio.rb +0 -56
- data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/steps/deploy.rb +0 -61
- data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/studio/base.rb +0 -167
- data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/studio/default.rb +0 -38
- data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/studio/deployer.rb +0 -24
- data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context.rb +0 -65
- data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-definitions/deploy-context-cucumber.rb +0 -18
- data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-definitions/deploy-context-git.rb +0 -47
- data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-definitions/deploy-context-habitat.rb +0 -82
- data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-definitions/deploy-context-kitchen.rb +0 -67
- data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-definitions/deploy-context-knife.rb +0 -45
- data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-definitions/deploy-context-rake.rb +0 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ab0d1448d0cdcae496e424b95732edc83301e34fe70c8553cbb7a5e2b1a167c5
|
4
|
+
data.tar.gz: f2237cf75807450b175dccc85b1ee058c6410b64fc02daf7e82e954976416b26
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 68f46d3d08394d389e01329a7771f67244b4bd1f8434d44a1d5e0bb0afc9b4a356b6dd8f0ea32ea3993ad33127e280041b5002ae3e1e1efdd1a91b5085a61573
|
7
|
+
data.tar.gz: ab689a7f92f7ef58b5dcdd46725f55f396a8d3c25f8ca9cdddd8275d56e4111d9f02d3ad9c774b3578382b042b2b07c864c572acc90cd68328486276df8c655b
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deploy-context
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.13.
|
4
|
+
version: 2.13.20
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jimmy Provencher
|
@@ -33,7 +33,7 @@ cert_chain:
|
|
33
33
|
n6Pwa3EckU/5n8N6gUJTAmGyu6Ncu1pbsZtH450+BJ2z82JNXomdFYlnG8+1XNlj
|
34
34
|
3M1sBFUHvqrBg2hQkQcLHokmQYrYsRK5A7HrxwKcmwM=
|
35
35
|
-----END CERTIFICATE-----
|
36
|
-
date: 2023-
|
36
|
+
date: 2023-11-01 00:00:00.000000000 Z
|
37
37
|
dependencies:
|
38
38
|
- !ruby/object:Gem::Dependency
|
39
39
|
name: inspec
|
@@ -147,20 +147,6 @@ dependencies:
|
|
147
147
|
- - ">="
|
148
148
|
- !ruby/object:Gem::Version
|
149
149
|
version: '0'
|
150
|
-
- !ruby/object:Gem::Dependency
|
151
|
-
name: ruby-shadow
|
152
|
-
requirement: !ruby/object:Gem::Requirement
|
153
|
-
requirements:
|
154
|
-
- - ">="
|
155
|
-
- !ruby/object:Gem::Version
|
156
|
-
version: '0'
|
157
|
-
type: :runtime
|
158
|
-
prerelease: false
|
159
|
-
version_requirements: !ruby/object:Gem::Requirement
|
160
|
-
requirements:
|
161
|
-
- - ">="
|
162
|
-
- !ruby/object:Gem::Version
|
163
|
-
version: '0'
|
164
150
|
- !ruby/object:Gem::Dependency
|
165
151
|
name: securerandom
|
166
152
|
requirement: !ruby/object:Gem::Requirement
|
@@ -198,39 +184,6 @@ executables:
|
|
198
184
|
extensions: []
|
199
185
|
extra_rdoc_files: []
|
200
186
|
files:
|
201
|
-
- "/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/context-knife-context.rb"
|
202
|
-
- "/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/context-manager.rb"
|
203
|
-
- "/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context.rb"
|
204
|
-
- "/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/cookbook-studio.rb"
|
205
|
-
- "/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/cucumber-studio.rb"
|
206
|
-
- "/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/cucumber-suite.rb"
|
207
|
-
- "/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/default-studio.rb"
|
208
|
-
- "/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/deploy/chef.rb"
|
209
|
-
- "/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/deploy/context.rb"
|
210
|
-
- "/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/deploy/cookbook.rb"
|
211
|
-
- "/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/deploy/cucumber.rb"
|
212
|
-
- "/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/deploy/deployer.rb"
|
213
|
-
- "/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/deploy/git.rb"
|
214
|
-
- "/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/deploy/habitat.rb"
|
215
|
-
- "/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/deploy/ruby.rb"
|
216
|
-
- "/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/deploy/vagrant.rb"
|
217
|
-
- "/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/habitat-studio.rb"
|
218
|
-
- "/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/helpers/command.rb"
|
219
|
-
- "/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/helpers/gemspec.rb"
|
220
|
-
- "/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/helpers/rake_tasks.rb"
|
221
|
-
- "/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/knife/default_knife_context.rb"
|
222
|
-
- "/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/knife/dummy_knife.rb"
|
223
|
-
- "/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/ruby-studio.rb"
|
224
|
-
- "/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/steps/deploy.rb"
|
225
|
-
- "/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/studio/base.rb"
|
226
|
-
- "/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/studio/default.rb"
|
227
|
-
- "/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/studio/deployer.rb"
|
228
|
-
- "/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-definitions/deploy-context-cucumber.rb"
|
229
|
-
- "/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-definitions/deploy-context-git.rb"
|
230
|
-
- "/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-definitions/deploy-context-habitat.rb"
|
231
|
-
- "/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-definitions/deploy-context-kitchen.rb"
|
232
|
-
- "/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-definitions/deploy-context-knife.rb"
|
233
|
-
- "/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-definitions/deploy-context-rake.rb"
|
234
187
|
- bin/deploy-context
|
235
188
|
homepage: https://github.com/JimboDragonGit/deploy-context
|
236
189
|
licenses:
|
metadata.gz.sig
CHANGED
Binary file
|
data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/context-knife-context.rb
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
|
2
|
-
require_relative 'context-manager'
|
3
|
-
|
4
|
-
module Context
|
5
|
-
class ContextKnifeContext < DefaultStudio
|
6
|
-
banner "knife context knife context"
|
7
|
-
|
8
|
-
deps do
|
9
|
-
Knife::DefaultKnifeContext.load_deps
|
10
|
-
end
|
11
|
-
|
12
|
-
option :context,
|
13
|
-
:description => "Load an object internally on it"
|
14
|
-
|
15
|
-
def run
|
16
|
-
# Context::DeployContext.deployer.send(config[:omg])
|
17
|
-
if config[:omg]
|
18
|
-
# Oh yeah, we are pumped.
|
19
|
-
puts "OMG HELLO WORLD!!!8!!88"
|
20
|
-
else
|
21
|
-
# meh
|
22
|
-
puts "I am just a fucking example. 8"
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
@@ -1,100 +0,0 @@
|
|
1
|
-
|
2
|
-
require_relative 'deploy-context/cucumber-studio'
|
3
|
-
|
4
|
-
module Context
|
5
|
-
class Manager < DefaultStudio
|
6
|
-
attr_reader :contexts
|
7
|
-
|
8
|
-
# 2
|
9
|
-
def do_download
|
10
|
-
super
|
11
|
-
contexts.each do |context|
|
12
|
-
context.do_download
|
13
|
-
end
|
14
|
-
true
|
15
|
-
end
|
16
|
-
|
17
|
-
# 3
|
18
|
-
def do_verify
|
19
|
-
super
|
20
|
-
contexts.each do |context|
|
21
|
-
context.do_verify
|
22
|
-
end
|
23
|
-
true
|
24
|
-
end
|
25
|
-
|
26
|
-
# 4
|
27
|
-
def do_clean
|
28
|
-
super
|
29
|
-
contexts.each do |context|
|
30
|
-
context.do_clean
|
31
|
-
end
|
32
|
-
true
|
33
|
-
end
|
34
|
-
|
35
|
-
# 5
|
36
|
-
def do_unpack
|
37
|
-
super
|
38
|
-
contexts.each do |context|
|
39
|
-
context.do_unpack
|
40
|
-
end
|
41
|
-
true
|
42
|
-
end
|
43
|
-
|
44
|
-
# 6
|
45
|
-
def do_prepare
|
46
|
-
super
|
47
|
-
contexts.each do |context|
|
48
|
-
context.do_prepare
|
49
|
-
end
|
50
|
-
true
|
51
|
-
end
|
52
|
-
|
53
|
-
# 7
|
54
|
-
def do_build
|
55
|
-
super
|
56
|
-
contexts.each do |context|
|
57
|
-
context.do_build
|
58
|
-
end
|
59
|
-
true
|
60
|
-
end
|
61
|
-
|
62
|
-
# 8
|
63
|
-
def do_check
|
64
|
-
super
|
65
|
-
contexts.each do |context|
|
66
|
-
context.do_check
|
67
|
-
end
|
68
|
-
true
|
69
|
-
end
|
70
|
-
|
71
|
-
# 9
|
72
|
-
def do_install
|
73
|
-
super
|
74
|
-
contexts.each do |context|
|
75
|
-
context.do_install
|
76
|
-
end
|
77
|
-
true
|
78
|
-
end
|
79
|
-
|
80
|
-
# 10
|
81
|
-
def do_strip
|
82
|
-
super
|
83
|
-
def do_install
|
84
|
-
contexts.each do |context|
|
85
|
-
context.do_strip
|
86
|
-
end
|
87
|
-
true
|
88
|
-
end
|
89
|
-
end
|
90
|
-
|
91
|
-
# 11
|
92
|
-
def do_end
|
93
|
-
super
|
94
|
-
contexts.each do |context|
|
95
|
-
context.do_end
|
96
|
-
end
|
97
|
-
true
|
98
|
-
end
|
99
|
-
end
|
100
|
-
end
|
@@ -1,72 +0,0 @@
|
|
1
|
-
require_relative 'ruby-studio'
|
2
|
-
|
3
|
-
module Context
|
4
|
-
class ContextCookbookStudio < DefaultStudio
|
5
|
-
banner "knife context cookbook studio"
|
6
|
-
|
7
|
-
deps do
|
8
|
-
Knife::DefaultKnifeContext.load_deps
|
9
|
-
end
|
10
|
-
|
11
|
-
def run
|
12
|
-
case name_args[0]
|
13
|
-
when 'converge'
|
14
|
-
kitchen(self, name_args)
|
15
|
-
when 'verify'
|
16
|
-
kitchen(self, name_args)
|
17
|
-
when 'destroy'
|
18
|
-
kitchen(self, name_args)
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
# 4
|
23
|
-
def do_clean
|
24
|
-
super
|
25
|
-
delete_file_only_if_exist(get_context_file(self, 'Policyfile.lock.json'))
|
26
|
-
kitchen(%w(destroy))
|
27
|
-
true
|
28
|
-
end
|
29
|
-
|
30
|
-
# 6
|
31
|
-
def do_prepare
|
32
|
-
cookbook_build(self)
|
33
|
-
true
|
34
|
-
end
|
35
|
-
|
36
|
-
# 7
|
37
|
-
def do_build
|
38
|
-
cookbook_install(self)
|
39
|
-
true
|
40
|
-
end
|
41
|
-
|
42
|
-
# 8
|
43
|
-
def do_check
|
44
|
-
cookbook_test(self)
|
45
|
-
true
|
46
|
-
end
|
47
|
-
|
48
|
-
# 9
|
49
|
-
def do_install
|
50
|
-
knife_push(self)
|
51
|
-
true
|
52
|
-
end
|
53
|
-
|
54
|
-
# 10
|
55
|
-
def do_strip
|
56
|
-
super
|
57
|
-
cookbook_push(self)
|
58
|
-
true
|
59
|
-
end
|
60
|
-
|
61
|
-
# 11
|
62
|
-
def do_end
|
63
|
-
super
|
64
|
-
supermarket_push(self)
|
65
|
-
true
|
66
|
-
end
|
67
|
-
|
68
|
-
def studio_available?
|
69
|
-
is_binary_available?('kitchen') && is_binary_available?('knife') && super
|
70
|
-
end
|
71
|
-
end
|
72
|
-
end
|
@@ -1,45 +0,0 @@
|
|
1
|
-
require_relative 'habitat-studio'
|
2
|
-
|
3
|
-
module Context
|
4
|
-
class ContextCucumberStudio < DefaultStudio
|
5
|
-
banner "knife context cucumber studio"
|
6
|
-
|
7
|
-
deps do
|
8
|
-
Knife::DefaultKnifeContext.load_deps
|
9
|
-
end
|
10
|
-
|
11
|
-
def run
|
12
|
-
case name_args[1]
|
13
|
-
when 'destroy'
|
14
|
-
execute_command(%w(knife context cookbook studio destroy)) if name_args[0] == 'kitchen'
|
15
|
-
when 'enter'
|
16
|
-
execute_command(%w(knife context habitat studio enter)) if name_args[0] == 'habitat'
|
17
|
-
when 'build'
|
18
|
-
execute_command(%w(knife context habitat studio build) + name_args) if name_args[0] == 'habitat'
|
19
|
-
else
|
20
|
-
if name_args[0]
|
21
|
-
additionnal_tag = name_args[1].nil? ? [] : ['--tags', "@#{name_args[1]}"]
|
22
|
-
case name_args[0]
|
23
|
-
when 'cycle'
|
24
|
-
cucumber(self, ['--profile', 'preinit'] + additionnal_tag)
|
25
|
-
cucumber(self, ['--profile', 'initialize'] + additionnal_tag)
|
26
|
-
cucumber(self, ['--profile', 'planning'] + additionnal_tag)
|
27
|
-
cucumber(self, ['--profile', 'execution'] + additionnal_tag)
|
28
|
-
cucumber(self, ['--profile', 'closure'] + additionnal_tag)
|
29
|
-
cucumber(self, ['--profile', 'post_mortem'] + additionnal_tag)
|
30
|
-
when 'bump'
|
31
|
-
execute_command(%w(chef exec git version-bump patch))
|
32
|
-
else
|
33
|
-
cucumber(self, ['--profile', name_args[0]] + additionnal_tag)
|
34
|
-
end
|
35
|
-
else
|
36
|
-
cucumber(self)
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
def studio_available?
|
42
|
-
is_binary_available?('cucumber') && super
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
@@ -1,179 +0,0 @@
|
|
1
|
-
|
2
|
-
require_relative 'deploy/context'
|
3
|
-
require_relative 'deploy/chef'
|
4
|
-
require_relative 'deploy/cookbook'
|
5
|
-
require_relative 'deploy/cucumber'
|
6
|
-
require_relative 'deploy/deployer'
|
7
|
-
require_relative 'deploy/git'
|
8
|
-
require_relative 'deploy/habitat'
|
9
|
-
require_relative 'deploy/ruby'
|
10
|
-
require_relative 'deploy/vagrant'
|
11
|
-
|
12
|
-
module Context
|
13
|
-
module CucumberSuiteHelper
|
14
|
-
include Context::CommandHelper
|
15
|
-
include DeployHelpers::DeployerHelper
|
16
|
-
include DeployHelpers::ChefHelper
|
17
|
-
include DeployHelpers::GitHelper
|
18
|
-
include DeployHelpers::RubyHelper
|
19
|
-
include DeployHelpers::ContextHelper
|
20
|
-
include DeployHelpers::CookbookHelper
|
21
|
-
include DeployHelpers::HabitatHelper
|
22
|
-
include DeployHelpers::CucumberHelper
|
23
|
-
|
24
|
-
include Studio::Base
|
25
|
-
include Studio::Default
|
26
|
-
include Steps::Deploy
|
27
|
-
|
28
|
-
def context_suite
|
29
|
-
if @context_suite.nil?
|
30
|
-
@context_suite = OpenStruct.new
|
31
|
-
@context_suite.status_file = 'deploy-status.json'
|
32
|
-
# @context_suite.suite_kitchen = "patatae"
|
33
|
-
@context_suite.status = :initialisation
|
34
|
-
end
|
35
|
-
@context_suite
|
36
|
-
end
|
37
|
-
|
38
|
-
def verify_kitchen_status
|
39
|
-
context_suite.status = case kitchen_status['last_action']
|
40
|
-
when "verify"
|
41
|
-
kitchen_status['last_error'].nil? ? :verified : :verification_fail
|
42
|
-
when "converge"
|
43
|
-
kitchen_status['last_error'].nil? ? :converged : :converge_fail
|
44
|
-
when nil
|
45
|
-
:destroyed
|
46
|
-
else
|
47
|
-
warning_context_log("Kitchen status", kitchen_status['last_action'].inspect)
|
48
|
-
:unknown
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
def dirty_branch?
|
53
|
-
`git status --porcelain`.split('\n').count > 0
|
54
|
-
end
|
55
|
-
|
56
|
-
def branch_exist?
|
57
|
-
system("git branch --list #{context_suite.branch_name}")
|
58
|
-
end
|
59
|
-
|
60
|
-
def git_commit_successfully?
|
61
|
-
system("git commit -m 'Automatic cucumber commit on branch #{context_suite.branch_name}'")
|
62
|
-
end
|
63
|
-
|
64
|
-
def merge_with_branch_successfull?(source_branch)
|
65
|
-
system("git merge #{source_branch} #{context_suite.branch_name}")
|
66
|
-
end
|
67
|
-
|
68
|
-
def merge_to_master_successfull?
|
69
|
-
merge_with_branch_successfull?(context_suite.branch_name, 'master')
|
70
|
-
end
|
71
|
-
|
72
|
-
def switch_branch_successful?
|
73
|
-
system("git checkout #{context_suite.branch_name}")
|
74
|
-
end
|
75
|
-
|
76
|
-
def kitchen_suite_exist?
|
77
|
-
system("kitchen list #{context_suite.suite_kitchen}")
|
78
|
-
end
|
79
|
-
|
80
|
-
def verify_kitchen?
|
81
|
-
system("kitchen verify #{context_suite.suite_kitchen}")
|
82
|
-
end
|
83
|
-
|
84
|
-
def verify_secret?(secret_key)
|
85
|
-
system("hab origin secret list | grep #{secret_key}")
|
86
|
-
end
|
87
|
-
|
88
|
-
def kitchen_converged_successfully?
|
89
|
-
system("kitchen converge #{context_suite.suite_kitchen}")
|
90
|
-
end
|
91
|
-
|
92
|
-
def kitchen_destroyed_correctly?
|
93
|
-
system("kitchen destroy #{context_suite.suite_kitchen}")
|
94
|
-
end
|
95
|
-
|
96
|
-
def kitchen_tested_successfully?
|
97
|
-
system("kitchen test #{context_suite.suite_kitchen}")
|
98
|
-
end
|
99
|
-
|
100
|
-
def habitat_task_different?
|
101
|
-
jop_id = last_job_status[1]
|
102
|
-
jop_id != File.read('HAB_BUILD_ID')
|
103
|
-
end
|
104
|
-
|
105
|
-
def habitat_task_completed?
|
106
|
-
jop_status = last_job_status[2]
|
107
|
-
jop_status == 'Complete'
|
108
|
-
end
|
109
|
-
|
110
|
-
def job_status_raw
|
111
|
-
`hab bldr job status --origin #{context_suite.organisation_name} | grep #{context_suite.organisation_name}/#{context_suite.application_name}`
|
112
|
-
end
|
113
|
-
|
114
|
-
def last_job_status
|
115
|
-
job_status_arr = job_status_raw.split('\n')
|
116
|
-
jop_status = job_status_arr[0].split(' ')
|
117
|
-
end
|
118
|
-
|
119
|
-
def habitat_new_task?
|
120
|
-
jop_status = last_job_status[2]
|
121
|
-
jop_status == 'Dispatching'
|
122
|
-
end
|
123
|
-
|
124
|
-
def write_build_id
|
125
|
-
jop_id = last_job_status[1]
|
126
|
-
File.write('HAB_BUILD_ID', jop_id)
|
127
|
-
end
|
128
|
-
|
129
|
-
def write_cookbook_version
|
130
|
-
short_version = Gem::Version.new(GVB.version).canonical_segments[0..2].join('.')
|
131
|
-
File.write('VERSION', short_version)
|
132
|
-
File.write('DATE', GVB.date)
|
133
|
-
File.write('habitat/plan.sh/VERSION', short_version)
|
134
|
-
File.write('habitat/plan.sh/DATE', GVB.date)
|
135
|
-
end
|
136
|
-
|
137
|
-
def verify_habitat?
|
138
|
-
system("hab studio run echo")
|
139
|
-
end
|
140
|
-
|
141
|
-
def plan_build_successfully?
|
142
|
-
system("hab studio build #{context_suite.plan_path}")
|
143
|
-
end
|
144
|
-
|
145
|
-
def context_status
|
146
|
-
JSON.parse(File.read(context_suite.status_file))[:status]
|
147
|
-
end
|
148
|
-
|
149
|
-
def kitchen_status
|
150
|
-
JSON.parse(`kitchen list #{context_suite.suite_kitchen} --json`).detect{|suite| suite['instance'].include?(context_suite.suite_kitchen)}
|
151
|
-
end
|
152
|
-
|
153
|
-
def command_available?(app_name, sub_command)
|
154
|
-
system("knife #{app_name} #{sub_command}")
|
155
|
-
end
|
156
|
-
|
157
|
-
def stop_test(message, status)
|
158
|
-
wrap_message = "#{status}:: #{message}"
|
159
|
-
update_status status
|
160
|
-
abort(wrap_message)
|
161
|
-
end
|
162
|
-
|
163
|
-
def update_status(new_status)
|
164
|
-
context_suite.status = new_status
|
165
|
-
update_status_file
|
166
|
-
end
|
167
|
-
|
168
|
-
def update_status_file
|
169
|
-
File.write(context_suite.status_file, JSON.pretty_generate({
|
170
|
-
status_file: context_suite.status_file,
|
171
|
-
kitchen_suite: context_suite.kitchen_suite,
|
172
|
-
plan_path: context_suite.plan_path,
|
173
|
-
branch_name: context_suite.branch_name,
|
174
|
-
status: context_suite.status,
|
175
|
-
}
|
176
|
-
))
|
177
|
-
end
|
178
|
-
end
|
179
|
-
end
|
@@ -1,174 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'bundler'
|
3
|
-
require 'fileutils'
|
4
|
-
require 'json'
|
5
|
-
|
6
|
-
require 'git-version-bump'
|
7
|
-
|
8
|
-
require_relative 'helpers/command'
|
9
|
-
require_relative 'helpers/rake_tasks'
|
10
|
-
|
11
|
-
require_relative 'studio/default'
|
12
|
-
require_relative 'studio/deployer'
|
13
|
-
|
14
|
-
require_relative 'steps/deploy'
|
15
|
-
|
16
|
-
require_relative 'knife/default_knife_context'
|
17
|
-
require_relative 'cucumber-suite'
|
18
|
-
|
19
|
-
# require_relative 'ruby-studio'
|
20
|
-
# require_relative 'cookbook-studio'
|
21
|
-
# require_relative 'habitat-studio'
|
22
|
-
# require_relative 'cucumber-studio'
|
23
|
-
|
24
|
-
module Context
|
25
|
-
class DefaultStudio < Knife::DefaultKnifeContext
|
26
|
-
include CucumberSuiteHelper
|
27
|
-
|
28
|
-
# attr_reader :context_name
|
29
|
-
# attr_reader :context_folder
|
30
|
-
|
31
|
-
# attr_accessor :existing_cucumber_runtime
|
32
|
-
# attr_accessor :existing_cucumber_configuration
|
33
|
-
|
34
|
-
# attr_reader :organisation_name
|
35
|
-
|
36
|
-
attr_reader :ruby_studio
|
37
|
-
attr_reader :cookbook_studio
|
38
|
-
attr_reader :habitat_studio
|
39
|
-
attr_reader :cucumber_studio
|
40
|
-
|
41
|
-
# attr_reader :context_state
|
42
|
-
|
43
|
-
banner 'knife default studio'
|
44
|
-
|
45
|
-
deps do
|
46
|
-
end
|
47
|
-
|
48
|
-
option :context_name,
|
49
|
-
:short => '-N',
|
50
|
-
:long => '--context-name',
|
51
|
-
:description => "Name of the context"
|
52
|
-
|
53
|
-
option :ruby_studio,
|
54
|
-
:short => '-B',
|
55
|
-
:long => '--ruby-studio',
|
56
|
-
:description => "Path of the ruby studio"
|
57
|
-
|
58
|
-
option :cookbook_studio,
|
59
|
-
:short => '-B',
|
60
|
-
:long => '--cookbook-studio',
|
61
|
-
:description => "Path of the cookbook studio"
|
62
|
-
|
63
|
-
option :habitat_studio,
|
64
|
-
:short => '-H',
|
65
|
-
:long => '--habitat-studio',
|
66
|
-
:description => "Path of the habitat studio"
|
67
|
-
|
68
|
-
option :cucumber_studio,
|
69
|
-
:short => '-C',
|
70
|
-
:long => '--cucumber-studio',
|
71
|
-
:description => "Path of the cucumber studio"
|
72
|
-
|
73
|
-
option :context_state,
|
74
|
-
:short => '-S',
|
75
|
-
:long => '--context-state',
|
76
|
-
:description => "Set the value of the state before run"
|
77
|
-
|
78
|
-
# def initialize(argv)
|
79
|
-
# end
|
80
|
-
|
81
|
-
# def initialize(context_organisation_name, deployer_context_name, deploycontext_folder, default_ruby_studio = nil)
|
82
|
-
# @context_name = deployer_context_name
|
83
|
-
# @context_folder = deploycontext_folder # move_folder(deploycontext_folder)
|
84
|
-
# @organisation_name = context_organisation_name
|
85
|
-
# @ruby_studio = default_ruby_studio
|
86
|
-
# end
|
87
|
-
|
88
|
-
def context_name
|
89
|
-
config[:context_name]
|
90
|
-
end
|
91
|
-
|
92
|
-
def context_folder
|
93
|
-
config[:context_folder]
|
94
|
-
end
|
95
|
-
|
96
|
-
def existing_cucumber_runtime
|
97
|
-
config[:existing_cucumber_runtime]
|
98
|
-
end
|
99
|
-
|
100
|
-
def existing_cucumber_configuration
|
101
|
-
config[:existing_cucumber_configuration]
|
102
|
-
end
|
103
|
-
|
104
|
-
def organisation_name
|
105
|
-
config[:organisation_name]
|
106
|
-
end
|
107
|
-
|
108
|
-
def ruby_studio
|
109
|
-
@ruby_studio = RubyStudio.new if @ruby_studio.nil?
|
110
|
-
@ruby_studio
|
111
|
-
end
|
112
|
-
|
113
|
-
def cookbook_studio
|
114
|
-
@cookbook_studio = CookbookStudio.new if @cookbook_studio.nil?
|
115
|
-
@cookbook_studio
|
116
|
-
end
|
117
|
-
|
118
|
-
def habitat_studio
|
119
|
-
@habitat_studio = HabitatStudio.new if @habitat_studio.nil?
|
120
|
-
@habitat_studio
|
121
|
-
end
|
122
|
-
|
123
|
-
def cucumber_studio
|
124
|
-
@cucumber_studio = CucumberStudio.new if @cucumber_studio.nil?
|
125
|
-
@cucumber_studio
|
126
|
-
end
|
127
|
-
|
128
|
-
def studio_order
|
129
|
-
[ruby_studio, cookbook_studio, habitat_studio, cucumber_studio]
|
130
|
-
end
|
131
|
-
|
132
|
-
def do_begin
|
133
|
-
# @ruby_studio = Context::RubyStudio.new(organisation_name, context_name, context_folder) if ruby_studio.nil?
|
134
|
-
|
135
|
-
# @cookbook_studio = Context::CookbookStudio.new(organisation_name, context_name, context_folder, ruby_studio) if cookbook_studio.nil?
|
136
|
-
|
137
|
-
# @habitat_studio = Context::HabitatStudio.new(organisation_name, context_name, context_folder, ruby_studio) if habitat_studio.nil?
|
138
|
-
|
139
|
-
# @cucumber_studio = Context::CucumberStudio.new(organisation_name, context_name, context_folder, ruby_studio) if cucumber_studio.nil?
|
140
|
-
|
141
|
-
studio_order
|
142
|
-
end
|
143
|
-
|
144
|
-
# 2
|
145
|
-
def do_download
|
146
|
-
git_build(self)
|
147
|
-
end
|
148
|
-
|
149
|
-
# 3
|
150
|
-
def do_verify
|
151
|
-
git_build(self)
|
152
|
-
end
|
153
|
-
|
154
|
-
# 4
|
155
|
-
def do_clean
|
156
|
-
delete_file_only_if_exist(get_context_file(self, 'respond.txt'))
|
157
|
-
true
|
158
|
-
end
|
159
|
-
|
160
|
-
# 10
|
161
|
-
def do_strip
|
162
|
-
git_build(self)
|
163
|
-
end
|
164
|
-
|
165
|
-
# 11
|
166
|
-
def do_end
|
167
|
-
git_commit(self)
|
168
|
-
end
|
169
|
-
|
170
|
-
def studio_available?
|
171
|
-
is_binary_available?('git')
|
172
|
-
end
|
173
|
-
end
|
174
|
-
end
|