deploy_rubygem 0.60.27 → 0.60.29

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f31d81507808f01b00e557cae5407deaaa40ff353fcb90cd61a75634b00b58b2
4
- data.tar.gz: 2a2dd320c28307e18277feb6d2abd2511cef283755f279b01d6a3404d9b52b8a
3
+ metadata.gz: ec76c875f88949500709195f51e3deadc201423d45165a07d7091eea4ac83af7
4
+ data.tar.gz: f9ae71f8b5f2165373adae80916ef66afcfb9fd55cbaaff6a4e31ff840f0f9e7
5
5
  SHA512:
6
- metadata.gz: fc773514db8df804e390ff6922831bdd5f000a2c034af32af278b12b7dde61ed1972bfdf7acdb744e58e92e2a8e59ab3913de93a48cdc49dd41aed9ee321f000
7
- data.tar.gz: 497480380c8e1de9b606bef7ec5043eceee7b1f023877ab0213a02e12f2979ddb049b5b0f855e16c33c45739b6d25b2e50f8d1c630404920d5bf49c99a1b48e6
6
+ metadata.gz: 676f0eb83748ac8da940f8a6fb3183f26204bf7c639725ac79f39764c64c63b8dc82926471afe21e39d6533bd5943e02bb7f552a860a3999bd5d187339d6da72
7
+ data.tar.gz: 3b0db7dc3ceb3e5ffdedf12ea975fc534748cba32fc89de9ed19b93bab97da1c25d938dbe8a57735ebd24d0441df7ceb63832794b69c7490dafb8594b739215c
checksums.yaml.gz.sig CHANGED
Binary file
data/Rakefile CHANGED
@@ -17,7 +17,7 @@ task test_version: %i[install compliance]
17
17
  task :compliance do
18
18
  system('inspec exec compliance')
19
19
  end
20
- task developper: %i[rubocop push default release]
20
+ task developper: %i[rubocop push default]
21
21
  task :push do
22
22
  system('git add .')
23
23
  system("git commit -m 'Rake pusing version #{DeployRubygem::VERSION}'")
@@ -0,0 +1,14 @@
1
+ #!/opt/chef-workstation/embedded/bin/ruby
2
+ # Signal.trap('INT') { exit 1 }
3
+
4
+ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), %w[.. lib])
5
+ require 'rubygems' unless defined?(Gem)
6
+ require 'deploy_rubygem'
7
+
8
+ workstation_options = JSON.parse(File.read(ARGV[0]))
9
+
10
+ if workstation_options['user_folder'] == '/root'
11
+ DeployRubygem::ChefNode.new(workstation_options).boostrap
12
+ else
13
+ DeployRubygem::Workstation.new(workstation_options).boostrap_workstation
14
+ end
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'json'
4
+
5
+ system('curl -L https://omnitruck.chef.io/install.sh > install.sh')
6
+ system('sudo bash install.sh -P chef-workstation')
7
+
8
+ workstation_options = {
9
+ user_folder: '/root',
10
+ node_name: ENV['NODENAME'],
11
+ knife_name: ENV['KNIFE_NAME'],
12
+ policyname: ENV['POLICYNAME'],
13
+ policygroup: ENV['POLICYGROUP'],
14
+ chef_server_url: ENV['CHEF_SERVER_URL'],
15
+ chef_client_key: ENV['CHEF_CLIENT_KEY'],
16
+ chef_knife_key: ENV['CHEF_KNIFE_KEY']
17
+ }
18
+
19
+ File.write('node_options', JSON.generate(workstation_options))
20
+ system('sudo bootstrap_chef_workstation node_options')
21
+
22
+ workstation_options[:user_folder] = ENV['HOME']
23
+ File.write('workstation_options', JSON.generate(workstation_options))
24
+ system('bootstrap_chef_workstation workstation_options')
@@ -17,7 +17,7 @@ module DeployRubygem
17
17
  @profiles = cookbook_info[:compliance_profiles].map do |profile_name|
18
18
  input_file = File.join(%w[compliance inputs] + ["#{cookbook_name}.yml"])
19
19
  waiver_file = File.join(%w[compliance waivers] + ["#{cookbook_name}.yml"])
20
- InspecTestor.new(profile_name, input_file, waiver_file)
20
+ InspecTestor.new(File.join(%w[compliance profiles], profile_name.to_s), input_file, waiver_file)
21
21
  end
22
22
  @kitchens = cookbook_info[:kitchens].map do |kitchen_name|
23
23
  Kitchen.new(kitchen_name, self)
@@ -27,6 +27,14 @@ module DeployRubygem
27
27
  end
28
28
  end
29
29
 
30
+ def generate
31
+ return if Dir.exist?(cookbook_path)
32
+
33
+ Dir.chdir(File.dirname(cookbook_path)) do
34
+ system("chef generate cookbook #{cookbook_name}")
35
+ end
36
+ end
37
+
30
38
  def cookbook_name
31
39
  project_name
32
40
  end
@@ -28,17 +28,17 @@ module DeployRubygem
28
28
  puts "waiver_file = #{waiver_file}"
29
29
 
30
30
  check
31
- system("inspec exec #{inspec_path} #{inspec_options.join(' ')}")
31
+ system("chef inspec exec #{inspec_path} #{inspec_options.join(' ')}")
32
32
  end
33
33
 
34
34
  def update
35
35
  clean
36
- system("inspec vendor #{inspec_path} ")
36
+ system("chef inspec vendor #{inspec_path} ")
37
37
  end
38
38
 
39
39
  def save_as_html(html_file)
40
40
  check
41
- system("inspec exec #{inspec_path} #{inspec_options.join(' ')} --reporter html:#{html_file}")
41
+ system("chef inspec exec #{inspec_path} #{inspec_options.join(' ')} --reporter html:#{html_file}")
42
42
  end
43
43
 
44
44
  def test_json
@@ -1,19 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative 'rubygem'
4
- require_relative 'deploy_rubygem_options'
5
4
 
6
5
  # Set version for DeployRubygem
7
6
  module DeployRubygem
8
- def self.project_name
9
- 'deploy_rubygem'
10
- end
11
-
12
- def self.new_deploy_rubygem
13
- @self_project = Rubygem.new(DeployRubygemOptions.new.compile) if @self_project.nil?
14
- @self_project
15
- end
16
-
17
7
  # VERSION = new_deploy_rubygem.gvb_version.short_version
18
- VERSION = '0.60.27'
8
+ VERSION = '0.60.29'
19
9
  end
@@ -2,30 +2,40 @@
2
2
 
3
3
  require_relative 'deploy_rubygem/version'
4
4
 
5
- # DeployRubygem - deploy a gem using rake
5
+ # DeployRubygem module helper for rubygem
6
6
  module DeployRubygem
7
- def deploy_rubygem
8
- DeployRubygem.new_deploy_rubygem
7
+ def rubygem_test
8
+ DeployRubygem.deployer
9
9
  end
10
10
 
11
- def jimbo_management_site_cookbook
12
- deploy_rubygem.cookbooks.select do |cookbook|
13
- cookbook.cookbook_name.match? 'jimbo_management_site'
14
- end.first
11
+ def self.exemple_cookbook
12
+ {
13
+ git: 'git@git.exemple.com:/Exemple/exemple_cookbook.git',
14
+ path: File.join(ENV['HOME'], 'jimbo_management_site'),
15
+ kitchens: %w[base],
16
+ compliance_profiles: {
17
+ input: 'compliance/inputs/user.yml',
18
+ profile: 'jimbodragon-management-site'
19
+ },
20
+ execute_profiles: %w[jimbodragon-accept],
21
+ groups: %w[base]
22
+ }
15
23
  end
16
- end
17
24
 
18
- # s.add_runtime_dependency('colorator', '~> 1.0')
19
- # s.add_runtime_dependency('em-websocket', '~> 0.5')
20
- # s.add_runtime_dependency('i18n', '~> 1.0')
21
- # s.add_runtime_dependency('jekyll-sass-converter', '>= 2.0', '< 4.0')
22
- # s.add_runtime_dependency('jekyll-watch', '~> 2.0')
23
- # s.add_runtime_dependency('kramdown', '~> 2.3', '>= 2.3.1')
24
- # s.add_runtime_dependency('kramdown-parser-gfm', '~> 1.0')
25
- # s.add_runtime_dependency('liquid', '~> 4.0')
26
- # s.add_runtime_dependency('mercenary', '>= 0.3.6', '< 0.5')
27
- # s.add_runtime_dependency('pathutil', '~> 0.9')
28
- # s.add_runtime_dependency('rouge', '>= 3.0', '< 5.0')
29
- # s.add_runtime_dependency('safe_yaml', '~> 1.0')
30
- # s.add_runtime_dependency('terminal-table', '>= 1.8', '< 4.0')
31
- # s.add_runtime_dependency('webrick', '~> 1.7')
25
+ def self.deployer
26
+ chefrepo_path = File.join(%w[test exemple chefrepo])
27
+ project_options = {
28
+ project_name: 'rubygem_test',
29
+ git: 'git@git.exemple.com:/Exemple/rubygem',
30
+ chefrepo_git: 'git@git.exemple.com:/Exemple/chefrepo',
31
+ chefrepo_path: chefrepo_path,
32
+ binaries: %w[exemple_deploy],
33
+ dependencies: %w[deploy_rubygem],
34
+ path: File.join(chefrepo_path, %w[projects rubygem_test]),
35
+ cookbooks: {
36
+ exemple_cookbook: exemple_cookbook
37
+ }
38
+ }
39
+ @deployer ||= DeployRubygem::Project.new(project_options)
40
+ end
41
+ end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deploy_rubygem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.60.27
4
+ version: 0.60.29
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: 2024-06-11 00:00:00.000000000 Z
36
+ date: 2024-06-12 00:00:00.000000000 Z
37
37
  dependencies:
38
38
  - !ruby/object:Gem::Dependency
39
39
  name: rspec
@@ -109,7 +109,9 @@ description: Using Chef cookbook style and force any script using it to switch t
109
109
  chef even if it is not install. It will install it tho ;)
110
110
  email:
111
111
  - jimbo_dragon@hotmail.com
112
- executables: []
112
+ executables:
113
+ - install_chef_workstation
114
+ - bootstrap_chef_workstation
113
115
  extensions: []
114
116
  extra_rdoc_files:
115
117
  - README.md
@@ -124,11 +126,12 @@ files:
124
126
  - LICENSE.txt
125
127
  - README.md
126
128
  - Rakefile
129
+ - bin/bootstrap_chef_workstation
130
+ - bin/install_chef_workstation
127
131
  - exe/deploy_rubygem
128
132
  - lib/deploy_rubygem.rb
129
133
  - lib/deploy_rubygem/chef_node.rb
130
134
  - lib/deploy_rubygem/cookbook.rb
131
- - lib/deploy_rubygem/deploy_rubygem_options.rb
132
135
  - lib/deploy_rubygem/inspec_result.rb
133
136
  - lib/deploy_rubygem/inspectestor.rb
134
137
  - lib/deploy_rubygem/kitchen.rb
metadata.gz.sig CHANGED
Binary file
@@ -1,106 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # DeployRubygem - deploy a gem using rake
4
- # Containing a class
5
- module DeployRubygem
6
- # Using Inspec to deploy and manage Inspec
7
- class DeployRubygemOptions
8
- def project_name
9
- 'deploy_rubygem'
10
- end
11
-
12
- def git
13
- 'git@github.com:JimboDragonGit/deploy_rubygem.git'
14
- end
15
-
16
- def chefrepo_git
17
- 'git@github.com:JimboDragonGit/jimbodragon.git'
18
- end
19
-
20
- def chefrepo_path
21
- '/usr/local/chef/repo/jimbodragon'
22
- end
23
-
24
- def binaries
25
- %w[
26
- deploy_rubygem
27
- prepare_workstation
28
- test_deploy_rubygem
29
- deploy_jimbodragon
30
- ]
31
- end
32
-
33
- def dependencies
34
- %w[
35
- deploy_rubygem
36
- jimbo_management_site
37
- ]
38
- end
39
-
40
- def path
41
- File.join(ENV['HOME'], 'deploy_rubygem')
42
- end
43
-
44
- def jimbodragon_profiles
45
- %w[
46
- jimbodragon-accept
47
- jimbodragon-applications
48
- jimbodragon-deploy-context
49
- jimbodragon-environment
50
- jimbodragon-git
51
- ]
52
- end
53
-
54
- def workstation_profiles
55
- %w[
56
- jimbodragon-linux-baseline
57
- jimbodragon-manual-push
58
- jimbodragon-push
59
- jimbodragon-services
60
- jimbodragon-users
61
- jimbodragon-workstation
62
- ]
63
- end
64
-
65
- def compliance_profiles
66
- jimbodragon_profiles + workstation_profiles
67
- end
68
-
69
- def jimbo_management_site_cookbook
70
- {
71
- git: 'git@github.com:JimboDragonGit/jimbo_management_site.git',
72
- path: File.join(ENV['HOME'], 'jimbo_management_site'),
73
- kitchens: %w[base],
74
- compliance_profiles: compliance_profiles,
75
- execute_profiles: %w[jimbodragon-accept],
76
- groups: %w[base]
77
- }
78
- end
79
-
80
- def jimbo_management_site_profile
81
- {
82
- input: 'compliance/inputs/user.yml',
83
- profile: 'jimbodragon-management-site'
84
- }
85
- end
86
-
87
- def cookbooks
88
- {
89
- jimbo_management_site: jimbo_management_site_cookbook
90
- }
91
- end
92
-
93
- def compile
94
- {
95
- project_name: project_name,
96
- git: git,
97
- chefrepo_git: chefrepo_git,
98
- chefrepo_path: chefrepo_path,
99
- binaries: binaries,
100
- dependencies: dependencies,
101
- path: path,
102
- cookbooks: cookbooks
103
- }
104
- end
105
- end
106
- end