deploy-context 2.13.17 → 2.13.19

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +1 -4
  3. data.tar.gz.sig +0 -0
  4. metadata +1 -34
  5. metadata.gz.sig +0 -0
  6. data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/context-knife-context.rb +0 -26
  7. data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/context-manager.rb +0 -100
  8. data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/cookbook-studio.rb +0 -72
  9. data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/cucumber-studio.rb +0 -45
  10. data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/cucumber-suite.rb +0 -179
  11. data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/default-studio.rb +0 -174
  12. data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/deploy/chef.rb +0 -57
  13. data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/deploy/context.rb +0 -42
  14. data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/deploy/cookbook.rb +0 -121
  15. data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/deploy/cucumber.rb +0 -42
  16. data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/deploy/deployer.rb +0 -83
  17. data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/deploy/git.rb +0 -62
  18. data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/deploy/habitat.rb +0 -112
  19. data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/deploy/ruby.rb +0 -138
  20. data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/deploy/vagrant.rb +0 -7
  21. data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/habitat-studio.rb +0 -50
  22. data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/helpers/command.rb +0 -91
  23. data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/helpers/gemspec.rb +0 -91
  24. data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/helpers/rake_tasks.rb +0 -150
  25. data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/knife/default_knife_context.rb +0 -35
  26. data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/knife/dummy_knife.rb +0 -43
  27. data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/ruby-studio.rb +0 -56
  28. data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/steps/deploy.rb +0 -61
  29. data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/studio/base.rb +0 -167
  30. data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/studio/default.rb +0 -38
  31. data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context/studio/deployer.rb +0 -24
  32. data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context.rb +0 -65
  33. data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-definitions/deploy-context-cucumber.rb +0 -18
  34. data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-definitions/deploy-context-git.rb +0 -47
  35. data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-definitions/deploy-context-habitat.rb +0 -82
  36. data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-definitions/deploy-context-kitchen.rb +0 -67
  37. data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-definitions/deploy-context-knife.rb +0 -45
  38. data/home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-definitions/deploy-context-rake.rb +0 -12
@@ -1,50 +0,0 @@
1
- require_relative 'cookbook-studio'
2
-
3
- module Context
4
- class ContextHabitatStudio < DefaultStudio
5
- banner "knife context habitat studio"
6
-
7
- deps do
8
- Knife::DefaultKnifeContext.load_deps
9
- end
10
-
11
- def run
12
- if name_args.count > 2
13
- context_log "name_args = #{name_args[2...]}"
14
- habitat(self, %w(studio) + name_args[2...])
15
- end
16
- end
17
-
18
- def do_clean
19
- super
20
- delete_file_only_if_exist(get_context_file(self, 'respond.txt'))
21
- delete_folder_only_if_exist(get_context_file(self, 'results/logs'))
22
- true
23
- end
24
-
25
- def do_install
26
- super
27
- bundle_gem self, ['install', context_name]
28
- build_habitat(self)
29
- true
30
- end
31
-
32
- # 10
33
- def do_strip
34
- super
35
- Dir.chdir context_folder
36
- start_habitat_job(self)
37
- true
38
- end
39
-
40
- # 11
41
- def do_end
42
- super
43
- promote_habitat(self)
44
- end
45
-
46
- def studio_available?
47
- is_binary_available?('hab') && super
48
- end
49
- end
50
- end
@@ -1,91 +0,0 @@
1
- module Context
2
- module CommandHelper
3
- def debug?
4
- ENV.key?('CONTEXTDEBUG') && ! ENV['CONTEXTDEBUG'].nil? && ENV['CONTEXTDEBUG']
5
- end
6
-
7
- def context_log(message)
8
- return log message if respond_to? :log
9
- puts message
10
- end
11
-
12
- def debug_context_log(name, message)
13
- return debug_log message if respond_to? :debug_log
14
- debug_message = "\n\n#{name} DEBUG: #{message}\n\n"
15
- context_log debug_message if debug?
16
- end
17
-
18
- def warning_context_log(name, message)
19
- return warning_log message if respond_to? :warning_log
20
- warning_message = "\n\n#{name} WARNING: #{message}\n\n"
21
- context_log warning_message
22
- end
23
-
24
- def error_context_log(name, message)
25
- return error_log message if respond_to? :error_log
26
- error_message = "\n\n#{name} ERROR: #{message}\n\n"
27
- context_log error_message
28
- context_log caller
29
- abort(error_message)
30
- exit 1
31
- end
32
-
33
- def is_admin?
34
- Process::Sys.getuid != 0
35
- end
36
-
37
- def temp_dir
38
- File.join(context_folder, 'results')
39
- end
40
-
41
- def get_shell_data(command_line)
42
- debug_context_log 'Get data from command', command_line
43
- `#{command_line.join(' ')}`
44
- end
45
-
46
- def execute_command(command, command_type = :system)
47
- command_state = case command_type
48
- when :system
49
- system(command.join(' '))
50
- when :run_as_admin
51
- execute_command(sudo_command(command), command_type)
52
- when :get_data
53
- debug_context_log "get data command = #{command} on type #{command_type}"
54
- get_shell_data(command)
55
- when :fork
56
- fork(command.join(' '))
57
- else
58
- error_context_log(context_name, "Unknown command type #{command_type}")
59
- end
60
- debug_context_log 'Execute Command', "\n\nexecuted command #{command.join(' ')}"
61
- command_state
62
- end
63
-
64
- def sudo_command(command)
65
- if ! Gem.win_platform? && Process::Sys.getuid != 0
66
- ['sudo'] + command
67
- else
68
- command
69
- end
70
- end
71
-
72
- def write_in_system_file(file, content)
73
- debug_context_log "Write in file system", [file, content]
74
- system("touch #{file}")
75
- ::File.write(file, content)
76
- system("chmod 644 #{file}") unless Gem.win_platform?
77
- end
78
-
79
- def delete_file_only_if_exist(file)
80
- FileUtils.rm file if File.exist? file
81
- end
82
-
83
- def delete_folder_only_if_exist(folder)
84
- FileUtils.rm_dir folder if File.exist? folder
85
- end
86
-
87
- def is_binary_available?(binary_name)
88
- execute_command(['which', binary_name])
89
- end
90
- end
91
- end
@@ -1,91 +0,0 @@
1
-
2
- module Context
3
- module GemHelpers
4
- def deploycontext_gem_specification(s, deploycontext_rootfolder, libraries_folder, steps_folder = '')
5
- s.name = 'deploy-context'
6
- s.license = 'MIT'
7
- s.authors = ['Jimmy Provencher']
8
- s.email = ['jimbo_dragon@hotmail.com']
9
- s.homepage = 'https://github.com/JimboDragonGit/deploy-context'
10
- s.summary = 'A auto chef bootstrapper and wrapper cookbook to deploy code and context'
11
- s.description = 'Using Chef cookbook style and force any script using it to switch to chef even if it is not install. It will install it tho ;)'
12
-
13
- s.version = File.read(File.join(deploycontext_rootfolder, 'VERSION'))
14
- s.date = File.read(File.join(deploycontext_rootfolder, 'DATE'))
15
-
16
- # all_files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
17
- # s.files = all_files.grep(%r!^(exe|libraries|rubocop)/|^.rubocop.yml$!)
18
- # code_folder = 'libraries/'
19
- # s.files = %w(README.md LICENSE bin/selfbootstrap libraries/selfbootstrap.rb ) + Dir.glob('libraries/**/*') # + Dir.glob('{bin,lib,certs,test}/**/*')
20
- # s.require_paths = [code_folder]
21
- # s.executables = %w(selfbootstrap)
22
- # s.bindir = 'exe'
23
-
24
-
25
- # s.extra_rdoc_files = ["README.md", 'VERSION', 'DATE']
26
- # s.files = `git ls-files`.split("\n")
27
- libraries_glob = Dir.glob(File.join(libraries_folder, '**/*'))
28
- libraries_glob = libraries_glob + Dir.glob(File.join(steps_folder, '*')) unless steps_folder.empty?
29
- s.files = libraries_glob
30
- s.executables = [
31
- 'deploy-context'
32
- ]
33
-
34
- s.cert_chain = [File.join(ENV['HOME'], '.gem/gem-public_cert.pem')]
35
- s.signing_key = File.join(ENV['HOME'], '.gem/gem-private_key.pem') if $PROGRAM_NAME =~ /gem\z/
36
-
37
- s.metadata = {
38
- # 'source_code_uri' => '/home/git/selfbootstrap.git/',
39
- 'bug_tracker_uri' => 'https://github.com/JimboDragonGit/deploy-context/issues',
40
- 'changelog_uri' => 'https://github.com/JimboDragonGit/deploy-context/releases',
41
- 'homepage_uri' => s.homepage,
42
- }
43
-
44
- s.rdoc_options = ['--charset=UTF-8']
45
- # s.extra_rdoc_files = %w(README.md LICENSE)
46
-
47
- # s.required_ruby_version = '>= 2.5.0'
48
- # s.required_rubygems_version = '>= 2.7.0'
49
-
50
- # s.add_development_dependency('chef')
51
- # s.add_development_dependency('test-kitchen')
52
-
53
- # s.add_runtime_dependency('git')
54
- # s.add_runtime_dependency('git_cli')
55
- # s.add_runtime_dependency('chef')
56
- # s.add_runtime_dependency('test-kitchen')
57
- # s.add_runtime_dependency('chef-bin')
58
- # s.add_runtime_dependency('chef-cli')
59
- # s.add_runtime_dependency('cheffish')
60
- # s.add_runtime_dependency('knife')
61
- # s.add_runtime_dependency('knife-ec2')
62
-
63
- s.add_runtime_dependency('inspec')
64
- s.add_runtime_dependency('kitchen-vagrant')
65
- s.add_runtime_dependency('kitchen-dokken')
66
- s.add_runtime_dependency('kitchen-ec2')
67
- s.add_runtime_dependency('simplecov')
68
- s.add_runtime_dependency('cucumber')
69
- s.add_runtime_dependency('down')
70
- s.add_runtime_dependency('unix-crypt')
71
- s.add_runtime_dependency('ruby-shadow')
72
- s.add_runtime_dependency('securerandom')
73
- s.add_runtime_dependency('git-version-bump')
74
-
75
- # s.add_runtime_dependency('colorator', '~> 1.0')
76
- # s.add_runtime_dependency('em-websocket', '~> 0.5')
77
- # s.add_runtime_dependency('i18n', '~> 1.0')
78
- # s.add_runtime_dependency('jekyll-sass-converter', '>= 2.0', '< 4.0')
79
- # s.add_runtime_dependency('jekyll-watch', '~> 2.0')
80
- # s.add_runtime_dependency('kramdown', '~> 2.3', '>= 2.3.1')
81
- # s.add_runtime_dependency('kramdown-parser-gfm', '~> 1.0')
82
- # s.add_runtime_dependency('liquid', '~> 4.0')
83
- # s.add_runtime_dependency('mercenary', '>= 0.3.6', '< 0.5')
84
- # s.add_runtime_dependency('pathutil', '~> 0.9')
85
- # s.add_runtime_dependency('rouge', '>= 3.0', '< 5.0')
86
- # s.add_runtime_dependency('safe_yaml', '~> 1.0')
87
- # s.add_runtime_dependency('terminal-table', '>= 1.8', '< 4.0')
88
- # s.add_runtime_dependency('webrick', '~> 1.7')
89
- end
90
- end
91
- end
@@ -1,150 +0,0 @@
1
- module Context
2
- module RakeTasks
3
- def define_deploy_context_tasks(deployer)
4
- deployer.load_public_dependencies
5
- Bundler::GemHelper.install_tasks
6
-
7
- Rake::RDocTask.new do |rd|
8
- rd.main = "README.md"
9
- rd.title = 'deploy-context'
10
- rd.rdoc_files.include("README.md", "lib/**/*.rb")
11
- end
12
-
13
- namespace :deploycontext do
14
- task :mix_cookbook => "deploycontext:push_cookbook" do
15
- deployer.do_mix_cookbook
16
- end
17
-
18
- task :push_cookbook => "deploycontext:install" do
19
- deployer.do_end
20
- end
21
-
22
- task :install do
23
- deployer.do_install
24
- end
25
-
26
- # task :bump => "deploycontext:commit" do
27
- # deployer.bump
28
- # end
29
-
30
- # task :test => "deploycontext:help" do
31
- # deployer.test
32
- # end
33
-
34
- # task :release => "deploycontext:commit" do
35
- # deployer.release
36
- # end
37
-
38
- # task :commit => "deploycontext:default" do
39
- # deployer.commit
40
- # end
41
-
42
- # task :push => "deploycontext:commit" do
43
- # deployer.push
44
- # end
45
-
46
- task :help do
47
- deployer.help
48
- end
49
-
50
- namespace :studio do
51
- task :promote => "deploycontext:studio:release" do
52
- deployer.do_end
53
- end
54
-
55
- task :build => "deploycontext:studio:habitat" do
56
- deployer.do_build
57
- end
58
-
59
- task :install => "deploycontext:studio:build" do
60
- deployer.do_install
61
- end
62
-
63
- task :release => "deploycontext:studio:install" do
64
- deployer.do_release
65
- end
66
-
67
- task :habitat do
68
- deployer.do_build_in_habitat
69
- end
70
-
71
- task :kitchen do
72
- deployer.test_with_kitchen
73
- end
74
- end
75
-
76
- namespace :plan do
77
- task :do_mix_cookbook do
78
- deployer.do_mix_cookbook
79
- end
80
-
81
- task :do_begin do
82
- deployer.do_begin
83
- end
84
-
85
- task :do_download do
86
- deployer.do_download
87
- end
88
-
89
- task :do_verify do
90
- deployer.do_verify
91
- end
92
-
93
- task :do_clean do
94
- deployer.do_clean
95
- end
96
-
97
- task :do_unpack do
98
- deployer.do_unpack
99
- end
100
-
101
- task :do_prepare do
102
- deployer.do_prepare
103
- end
104
-
105
- task :do_build do
106
- deployer.do_build
107
- end
108
-
109
- task :do_check do
110
- deployer.do_check
111
- end
112
-
113
- task :do_install do
114
- deployer.do_install
115
- end
116
-
117
- task :do_strip do
118
- deployer.do_strip
119
- end
120
-
121
- task :do_end do
122
- deployer.do_end
123
- end
124
- end
125
-
126
- namespace :deployer do
127
- task :cookbook do
128
- deployer.cookbook_test(deployer)
129
- end
130
-
131
- task :cucumber do
132
- deployer.cucumber_test(deployer)
133
- end
134
- end
135
-
136
- namespace :features do
137
- Cucumber::Rake::Task.new(:strict) do |t|
138
- t.cucumber_opts = "--format pretty" # Any valid command line option can go here.
139
- t.profile = "strict"
140
- end
141
-
142
- Cucumber::Rake::Task.new(:html_report) do |t|
143
- t.cucumber_opts = "--format pretty" # Any valid command line option can go here.
144
- t.profile = "html_report"
145
- end
146
- end
147
- end
148
- end
149
- end
150
- end
@@ -1,35 +0,0 @@
1
- require_relative 'dummy_knife.rb'
2
-
3
- module Context
4
- module Knife
5
- class DefaultKnifeContext < Chef::Knife
6
- include Context::CommandHelper
7
-
8
- banner "knife default knife context"
9
-
10
- deps do
11
- end
12
-
13
- option :context_name,
14
- :long => '--context-name VALUE',
15
- :boolean => false,
16
- :description => "The name of the context we running on"
17
-
18
- option :context_folder,
19
- :long => '--context-path VALUE',
20
- :description => "Path of the context"
21
-
22
- option :organisation_name,
23
- :long => '--organisation-name VALUE',
24
- :description => "Organisation name of the context"
25
-
26
- def run
27
- if config[:context_name]
28
- context_log "Running on context #{config[:context_name]}, config = #{config.inspect}\n#{name_args}"
29
- else
30
- warning_context_log self, "Running on context without name"
31
- end
32
- end
33
- end
34
- end
35
- end
@@ -1,43 +0,0 @@
1
- begin
2
- require 'chef/knife'
3
- rescue Exception => e
4
- puts "Failed to load chef/knife module, loading a dummy module instead"
5
-
6
- class Chef
7
- class Knife
8
- def self.banner(banner_flags)
9
- end
10
-
11
- def self.deps
12
- end
13
-
14
- def self.option(name,*argv)
15
- end
16
- end
17
- end
18
- end
19
-
20
- module Context
21
- module Knife
22
- class MannequinKnifeContext < Chef::Knife
23
- banner "knife mannequin knife context"
24
-
25
- deps do
26
- end
27
-
28
- option :mannequin,
29
- :description => "Just a dummy example"
30
-
31
- def run
32
- # deployer.send(config[:omg])
33
- if config[:mannequin]
34
- # Oh yeah, we are pumped.
35
- puts "Dummy Mannequin ;)"
36
- else
37
- # meh
38
- puts "Where is my Dummy Mannequin!!!!"
39
- end
40
- end
41
- end
42
- end
43
- end
@@ -1,56 +0,0 @@
1
- require_relative 'default-studio'
2
-
3
- module Context
4
- class ContextRubyStudio < DefaultStudio
5
- banner "knife context ruby studio"
6
-
7
- deps do
8
- Knife::DefaultKnifeContext.load_deps
9
- end
10
-
11
- option :omg,
12
- :short => '-O',
13
- :long => '--omg',
14
- :description => "I'm so excited! 9"
15
-
16
- def run
17
- if config[:omg]
18
- puts "OMG HELLO WORLD!!!9!!99"
19
- else
20
- puts "I am just a fucking example. 9"
21
- end
22
- end
23
-
24
- # 2
25
- def do_download
26
- super
27
- system('bundle install')
28
- true
29
- end
30
-
31
- # 2
32
- # def do_verify
33
- # super
34
- # cucumber(self)
35
- # true
36
- # end
37
-
38
- # 4
39
- def do_clean
40
- super
41
- delete_file_only_if_exist(get_context_file(self, 'Gemfile.lock'))
42
- true
43
- end
44
-
45
- # 9
46
- def do_end
47
- super
48
- ruby_release(self)
49
- true
50
- end
51
-
52
- def studio_present?
53
- execute_command('which ruby') || super
54
- end
55
- end
56
- end
@@ -1,61 +0,0 @@
1
-
2
- module Context
3
- module Steps
4
- module Deploy
5
- def define_steps(deployer)
6
- deployer.load_public_dependencies
7
- # Étantdonnéque('le projet {word} à une dernière version de disponible dans git') do |project_name|
8
- # context_exec [project_name, 'cycle']
9
-
10
- # if project_name == deployer.context_name
11
- # Dir.chdir deployer.context_folder
12
- # else
13
- # Dir.chdir File.join(deployer.contexts_container(deployer), project_name)
14
- # end
15
- # end
16
-
17
- Alors('démarrer un simple cycle de {word}') do |project_name|
18
- pending
19
- # context_exec [project_name, 'cycle'] || abort("#{project_name} ERROR: Issue with life cycle")
20
- end
21
-
22
- Alors('déployer le projet {word}') do |project_name|
23
- abort("Deployer failed to update") unless deployer.do_begin
24
- pending
25
- # context_exec [project_name, 'release'] || abort("#{project_name} ERROR: Issue with deploy steps")
26
- end
27
-
28
- Alors('tester le projet {word}') do |project_name|
29
- pending
30
- # context_exec [project_name, 'test'] || abort("#{project_name} ERROR: Issue with testing steps")
31
- end
32
-
33
- Étantdonnéque('le projet {word} à du code à updater') do |project_name|
34
- abort("Not on a dirty studio") unless deployer.on_a_dirty_studio?
35
- # context_exec [project_name, 'check_code_to_update'] || abort("#{project_name} ERROR: Issue to check updated code")
36
- end
37
-
38
- Alors('bumper la version du patch de {word}') do |project_name|
39
- pending
40
- # context_exec [project_name, 'bump'] || abort("#{project_name} ERROR: Issue with bumping version")
41
- end
42
-
43
- Étantdonnéque('le projet {word} à la bonne version d\'installer') do |project_name|
44
- abort("Not the latest version installed") unless deployer.current_version_installed?
45
- end
46
-
47
- Étantdonnéque('le projet {word} à une nouvelle version de disponible') do |project_name|
48
- abort("Latest version installed") if deployer.current_version_installed?
49
- end
50
-
51
- Étantdonnéque('le projet {word} est chargé') do |project_name|
52
- abort("Latest version installed") if deployer.current_version_installed?
53
- end
54
-
55
- Quand('le studio est disponible') do
56
- abort("Studio not available") unless deployer.studio_available?
57
- end
58
- end
59
- end
60
- end
61
- end