deploy-context 2.1.34.1.g531fe3b → 2.1.35.2.g385b63e
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/features/step_definitions/deploy-context.rb +1 -37
- data/features/support/env.rb +2 -5
- data/lib/context-manager.rb +11 -0
- data/lib/deploy-context/deploy/cookbook.rb +38 -0
- data/lib/deploy-context/deploy/cucumber.rb +4 -0
- data/lib/deploy-context/deploy/deployer.rb +0 -20
- data/lib/deploy-context/deploy/git.rb +5 -1
- data/lib/deploy-context/deploy/ruby.rb +10 -2
- data/lib/deploy-context/deploy.rb +2 -1
- data/lib/deploy-context/step_definitions/deploy-context.rb +37 -0
- data/lib/deploy-context.rb +2 -0
- data.tar.gz.sig +0 -0
- metadata +4 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5e69109351cbcebf091e6357107eee7c07595c1b233b184efe0b8c7afb7c4761
|
4
|
+
data.tar.gz: 4edb9c7814e36ad8233fc3b972753e801abffe5c942168acb0e6278a0ac47330
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fbca0ae83a94f34c8cc6f7e676f00f79f80384d634b74b9250d313b884c3533dda41c432573dca77368431d4893312e294120c9581c3473a28e32300bc32951b
|
7
|
+
data.tar.gz: 8471de784dc04a41ff0cb2fb58bed8416102b3d8b63d53c03dea8f5cc987af45b9b54f7caf3237714e78acb762f1fd23fd07c576d6c64a5496b9715c29d85685
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -1,38 +1,2 @@
|
|
1
|
-
# Étantdonnéque('le projet {word} à une dernière version de disponible dans git') do |project_name|
|
2
|
-
# context_exec [project_name, 'once']
|
3
|
-
|
4
|
-
# if project_name == deployer.context_name
|
5
|
-
# Dir.chdir deployer.context_folder
|
6
|
-
# else
|
7
|
-
# Dir.chdir File.join(deployer.contexts_container(deployer), project_name)
|
8
|
-
# end
|
9
|
-
# end
|
10
|
-
|
11
|
-
Alors('démarrer un simple cycle de {word}') do |project_name|
|
12
|
-
context_exec [project_name, 'once'] || abort("#{project_name} ERROR: Issue with life cycle")
|
13
|
-
end
|
14
|
-
|
15
|
-
Alors('déployer le projet {word}') do |project_name|
|
16
|
-
context_exec [project_name, 'release'] || abort("#{project_name} ERROR: Issue with deploy steps")
|
17
|
-
end
|
18
|
-
|
19
|
-
Alors('tester le projet {word}') do |project_name|
|
20
|
-
context_exec [project_name, 'test'] || abort("#{project_name} ERROR: Issue with testing steps")
|
21
|
-
end
|
22
|
-
|
23
|
-
Étantdonnéque('le projet {word} à du code à updater') do |project_name|
|
24
|
-
context_exec [project_name, 'check_code_to_update'] || abort("#{project_name} ERROR: Issue to check updated code")
|
25
|
-
end
|
26
|
-
|
27
|
-
Alors('bumper la version du patch de {word}') do |project_name|
|
28
|
-
context_exec [project_name, 'bump'] || abort("#{project_name} ERROR: Issue with bumping version")
|
29
|
-
end
|
30
|
-
|
31
|
-
Étantdonnéque('le projet {word} à la bonne version d\'installer') do |project_name|
|
32
|
-
context_exec [project_name, 'check_installed_version'] || abort("#{project_name} ERROR: Issue to check installed version")
|
33
|
-
end
|
34
|
-
|
35
|
-
Étantdonnéque('le projet {word} à une nouvelle version de disponible') do |project_name|
|
36
|
-
context_exec [project_name, 'check_new_version'] || abort("#{project_name} ERROR: Issue to check newer version available")
|
37
|
-
end
|
38
1
|
|
2
|
+
require_relative '../../lib/deploy-context/step-definitions/deploy-context'
|
data/features/support/env.rb
CHANGED
@@ -1,9 +1,6 @@
|
|
1
|
-
require 'deploy-context'
|
2
1
|
|
3
|
-
|
4
|
-
Context::DeployContext.deployer
|
5
|
-
end
|
2
|
+
require_relative '../../lib/deploy-context'
|
6
3
|
|
7
4
|
def context_exec(command)
|
8
|
-
|
5
|
+
Context::DeployContext.deployer.execute_command(command.join(' '))
|
9
6
|
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module Context
|
2
|
+
class Manager
|
3
|
+
attr_reader :deployers
|
4
|
+
|
5
|
+
def get_deployer(context_name, context_path)
|
6
|
+
@deployers = Hash.new if @deployers.nil?
|
7
|
+
@deployers['deploycontext'] = Context::DeployContext.new(context_path) unless deployers.key?(context_name)
|
8
|
+
deployers[context_name]
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
module Context
|
2
|
+
module DeployHelpers
|
3
|
+
module CookbookHelper
|
4
|
+
def chef(context, commands)
|
5
|
+
context.execute_command(%w(chef) + commands)
|
6
|
+
end
|
7
|
+
|
8
|
+
def chef_exec(context, commands)
|
9
|
+
context.chef(context, %w(exec) + commands)
|
10
|
+
end
|
11
|
+
|
12
|
+
def chef_generate(context, commands)
|
13
|
+
context.chef(context, %w(generate) + commands)
|
14
|
+
end
|
15
|
+
|
16
|
+
def generate_cookbook(context, cookbook)
|
17
|
+
context.chef(context, %w(cookbook) + cookbook)
|
18
|
+
end
|
19
|
+
|
20
|
+
def kitchen(context, commands = %w(test))
|
21
|
+
context.chef_exec(context, %w(kitchen) + commands)
|
22
|
+
end
|
23
|
+
|
24
|
+
def cookbook_build(context)
|
25
|
+
context.git_build(context)
|
26
|
+
context.log "Working in folder #{Dir.pwd}\nAnd context #{context.context_name} is created in folder #{context.context_folder} at version #{context.version}"
|
27
|
+
Dir.chdir File.dirname(context.context_folder)
|
28
|
+
context.generate_cookbook(context, [context.context_name])
|
29
|
+
Dir.chdir context.context_folder
|
30
|
+
end
|
31
|
+
|
32
|
+
def cookbook_test(context)
|
33
|
+
context.log "Working in folder #{Dir.pwd}\nAnd context #{context.context_name} is created in folder #{context.context_folder} at version #{context.version}"
|
34
|
+
context.kitchen(context)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -1,6 +1,10 @@
|
|
1
1
|
module Context
|
2
2
|
module DeployHelpers
|
3
3
|
module CucumberHelper
|
4
|
+
def cucumber(context, commands = [])
|
5
|
+
context.chef_exec(context,['cucumber'] + commands)
|
6
|
+
end
|
7
|
+
|
4
8
|
def cucumber_test(context)
|
5
9
|
context.git_build(context)
|
6
10
|
context.log "Working in folder #{Dir.pwd}\nAnd context #{context.context_name} is created in folder #{context.context_folder} at version #{context.version}"
|
@@ -12,26 +12,6 @@ module Context
|
|
12
12
|
def contexts_container(context)
|
13
13
|
context.get_context_folder(context, 'contexts')
|
14
14
|
end
|
15
|
-
|
16
|
-
def chef_exec(context, commands)
|
17
|
-
context.execute_command(%w(chef exec) + commands)
|
18
|
-
end
|
19
|
-
|
20
|
-
def git(context, commands)
|
21
|
-
context.chef_exec(context,['git'] + commands)
|
22
|
-
end
|
23
|
-
|
24
|
-
def gem(context, commands)
|
25
|
-
context.chef_exec(context,['gem'] + commands)
|
26
|
-
end
|
27
|
-
|
28
|
-
def rake(context, commands)
|
29
|
-
context.chef_exec(context,['rake'] + commands)
|
30
|
-
end
|
31
|
-
|
32
|
-
def cucumber(context, commands = [])
|
33
|
-
context.chef_exec(context,['cucumber'] + commands)
|
34
|
-
end
|
35
15
|
|
36
16
|
def execute_action(context, action)
|
37
17
|
state_action = if action.nil?
|
@@ -1,6 +1,10 @@
|
|
1
1
|
module Context
|
2
2
|
module DeployHelpers
|
3
3
|
module GitHelper
|
4
|
+
def git(context, commands)
|
5
|
+
context.chef_exec(context, %w(git) + commands)
|
6
|
+
end
|
7
|
+
|
4
8
|
def git_build(context)
|
5
9
|
if context.present_localy?
|
6
10
|
Dir.chdir(context.context_folder)
|
@@ -14,7 +18,7 @@ module Context
|
|
14
18
|
|
15
19
|
def git_pull(context)
|
16
20
|
context.git_build(context) unless context.actual_working_directory?
|
17
|
-
context.git context,
|
21
|
+
context.git context, %w(pull)
|
18
22
|
end
|
19
23
|
|
20
24
|
def git_commit(context)
|
@@ -3,8 +3,16 @@ require 'rubygems'
|
|
3
3
|
module Context
|
4
4
|
module DeployHelpers
|
5
5
|
module RubyHelper
|
6
|
+
def gem(context, commands)
|
7
|
+
context.chef_exec(context, %w(gem) + commands)
|
8
|
+
end
|
9
|
+
|
10
|
+
def rake(context, commands = [])
|
11
|
+
context.chef_exec(context, %w(rake) + commands)
|
12
|
+
end
|
13
|
+
|
6
14
|
def ruby_build(context)
|
7
|
-
git_build(context)
|
15
|
+
context.git_build(context)
|
8
16
|
context.log "Working in folder #{Dir.pwd}\nAnd context #{context.context_name} is created"
|
9
17
|
check_folder get_context_folder(context, 'build')
|
10
18
|
end
|
@@ -22,7 +30,7 @@ module Context
|
|
22
30
|
end
|
23
31
|
|
24
32
|
def clean_folder(context, folder)
|
25
|
-
clean_folder = get_context_folder(context, folder)
|
33
|
+
clean_folder = context.get_context_folder(context, folder)
|
26
34
|
puts "Clean folder #{clean_folder}"
|
27
35
|
FileUtils.remove_dir(clean_folder) if Dir.exist?(clean_folder)
|
28
36
|
end
|
@@ -47,7 +47,7 @@ module Context
|
|
47
47
|
log "Check if #{context_name} is install #{version}"
|
48
48
|
if gem_installed?(self)
|
49
49
|
puts "Test context #{context_name} was successfully install on version #{version}"
|
50
|
-
|
50
|
+
cookbook_test(context)
|
51
51
|
else
|
52
52
|
abort "Test context #{context_name} has failed to install #{version}"
|
53
53
|
end
|
@@ -55,6 +55,7 @@ module Context
|
|
55
55
|
|
56
56
|
def build
|
57
57
|
ruby_build(self)
|
58
|
+
cookbook_build(self)
|
58
59
|
check_folder get_context_folder(self, 'contexts')
|
59
60
|
end
|
60
61
|
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# Étantdonnéque('le projet {word} à une dernière version de disponible dans git') do |project_name|
|
2
|
+
# context_exec [project_name, 'once']
|
3
|
+
|
4
|
+
# if project_name == deployer.context_name
|
5
|
+
# Dir.chdir deployer.context_folder
|
6
|
+
# else
|
7
|
+
# Dir.chdir File.join(deployer.contexts_container(deployer), project_name)
|
8
|
+
# end
|
9
|
+
# end
|
10
|
+
|
11
|
+
Alors('démarrer un simple cycle de {word}') do |project_name|
|
12
|
+
context_exec [project_name, 'once'] || abort("#{project_name} ERROR: Issue with life cycle")
|
13
|
+
end
|
14
|
+
|
15
|
+
Alors('déployer le projet {word}') do |project_name|
|
16
|
+
context_exec [project_name, 'release'] || abort("#{project_name} ERROR: Issue with deploy steps")
|
17
|
+
end
|
18
|
+
|
19
|
+
Alors('tester le projet {word}') do |project_name|
|
20
|
+
context_exec [project_name, 'test'] || abort("#{project_name} ERROR: Issue with testing steps")
|
21
|
+
end
|
22
|
+
|
23
|
+
Étantdonnéque('le projet {word} à du code à updater') do |project_name|
|
24
|
+
context_exec [project_name, 'check_code_to_update'] || abort("#{project_name} ERROR: Issue to check updated code")
|
25
|
+
end
|
26
|
+
|
27
|
+
Alors('bumper la version du patch de {word}') do |project_name|
|
28
|
+
context_exec [project_name, 'bump'] || abort("#{project_name} ERROR: Issue with bumping version")
|
29
|
+
end
|
30
|
+
|
31
|
+
Étantdonnéque('le projet {word} à la bonne version d\'installer') do |project_name|
|
32
|
+
context_exec [project_name, 'check_installed_version'] || abort("#{project_name} ERROR: Issue to check installed version")
|
33
|
+
end
|
34
|
+
|
35
|
+
Étantdonnéque('le projet {word} à une nouvelle version de disponible') do |project_name|
|
36
|
+
context_exec [project_name, 'check_new_version'] || abort("#{project_name} ERROR: Issue to check newer version available")
|
37
|
+
end
|
data/lib/deploy-context.rb
CHANGED
@@ -5,11 +5,13 @@ require 'git-version-bump'
|
|
5
5
|
require_relative 'deploy-context/deploy'
|
6
6
|
require_relative 'deploy-context/deploy/ruby'
|
7
7
|
require_relative 'deploy-context/deploy/cucumber'
|
8
|
+
require_relative 'deploy-context/deploy/cookbook'
|
8
9
|
|
9
10
|
module Context
|
10
11
|
class DeployContext < Deploy
|
11
12
|
include DeployHelpers::RubyHelper
|
12
13
|
include DeployHelpers::CucumberHelper
|
14
|
+
include DeployHelpers::CookbookHelper
|
13
15
|
|
14
16
|
def self.deployer
|
15
17
|
@deployer = Context::DeployContext.new(Dir.pwd) if @deployer.nil?
|
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.1.
|
4
|
+
version: 2.1.35.2.g385b63e
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jimmy Provencher
|
@@ -105,8 +105,10 @@ files:
|
|
105
105
|
- features/support/env.rb
|
106
106
|
- features/update_deployer.feature
|
107
107
|
- features/updated_git.feature
|
108
|
+
- lib/context-manager.rb
|
108
109
|
- lib/deploy-context.rb
|
109
110
|
- lib/deploy-context/deploy.rb
|
111
|
+
- lib/deploy-context/deploy/cookbook.rb
|
110
112
|
- lib/deploy-context/deploy/cucumber.rb
|
111
113
|
- lib/deploy-context/deploy/deployer.rb
|
112
114
|
- lib/deploy-context/deploy/git.rb
|
@@ -114,6 +116,7 @@ files:
|
|
114
116
|
- lib/deploy-context/helpers/binary.rb
|
115
117
|
- lib/deploy-context/helpers/command.rb
|
116
118
|
- lib/deploy-context/helpers/rake_tasks.rb
|
119
|
+
- lib/deploy-context/step_definitions/deploy-context.rb
|
117
120
|
homepage: https://github.com/JimboDragonGit/deploy-context
|
118
121
|
licenses:
|
119
122
|
- MIT
|
metadata.gz.sig
CHANGED
Binary file
|