jimbodragon_acceptance_test 0.1.4 → 0.1.6

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: 80fdadd35ebee8e99e50d2c1369091f7af0122101539eb1a8fdbfb2ce0743624
4
- data.tar.gz: 06caf57680cf80bc5744afa8920f1032fa2f4f894459abafc1b740d4ae781a08
3
+ metadata.gz: 57bf783d8528b4238096588ffb868b6f4dc2665d03995ebbbf9007e0e750ed4b
4
+ data.tar.gz: d50188ebac6a8ef1438fc9813069eaa4d9cf66013b242199555f870fda97a00f
5
5
  SHA512:
6
- metadata.gz: ae872b8737f44ace2bf8ac8100dc145a30b2507b8c775ad2f3d9003042989fc91697300827d4b292d4bbbbdc07ee3c3d13e448c330919208cb2a4d3c36eebe59
7
- data.tar.gz: 585469dcd9caa11b3bda6b904449622a1bb22a9b62c3b7b6838530d8890b9315e0450a58c24706a2ac8d6b3af4f7d83900f71a1a37f24dca4a9c212ceec2ac71
6
+ metadata.gz: c7cb78fc63d3506a58ec736f82d8f334c0573faacd70599680c4e9bcdd9c2bb7bc91ce7aa8d6000cb61e0c5605a8ae6b12658fcb509573f7c7dca17b84d42f41
7
+ data.tar.gz: 2f0bde12bf91593efffadfa7e42f68eb7442d0131fa26581d6db2a8e047bbaa31a6f63592a880565c8108017bd272520b3cdb864f18f71ed922bc312e3579b4a
checksums.yaml.gz.sig CHANGED
Binary file
@@ -4,67 +4,9 @@
4
4
  # https://twitter.com/mitchellh/status/283014103189053442
5
5
  Signal.trap('INT') { exit 1 }
6
6
 
7
- require_relative ENV['ENVIRONMENT_FILE'] if !ENV['ENVIRONMENT_FILE'].nil? && ::File.exist?(ENV['ENVIRONMENT_FILE'])
7
+ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), %w(.. lib))
8
+ require 'rubygems' unless defined?(Gem)
9
+ require 'jimbodragon'
10
+ require 'jimbodragon/main'
8
11
 
9
- module JimboDragon
10
- module AcceptanceTests
11
- module StartCucumber
12
- def self.start_chef_client
13
- extend JimboDragon::AcceptanceTests::StartCucumber
14
- start_project
15
- end
16
-
17
- def install_chef
18
- system('curl -L https://omnitruck.chef.io/install.sh | sudo bash -s -- -s once -P chef-client')
19
- end
20
-
21
- def run_project
22
- # [
23
- # 'circleci config process .circleci/config.yml > process.yml',
24
- # 'circleci local execute -c process.yml --job jimbodragon_acceptance_test',
25
- # # 'chef exec hab plan render plan.sh/x86_64-linux/plan.sh',
26
- # 'chef exec hab studio build',
27
- # 'chef exec cucumber',
28
- # ].each { |command| system command }
29
- # end
30
-
31
- [
32
- 'cucumber',
33
- "chef-client -r #{ENV['NAMED_RUN_LIST']}",
34
- 'chef exec hab studio build',
35
- "chef gem build #{ENV['GEM_PROJECT_NAME']}.gemspec",
36
- "chef gem push #{ENV['GEM_PROJECT_NAME']}-#{ENV['GEM_PROJECT_VERSION']}.gem",
37
- "chef exec knife cookbook upload #{[
38
- ENV['NAMED_RUN_LIST'],
39
- ENV['GEM_PROJECT_NAME'],
40
- 'chef-git-server',
41
- 'chefserver',
42
- 'chef_workstation_initialize',
43
- 'infra_chef',
44
- 'jimbodragon',
45
- 'jimbodragon_infra_chef',
46
- 'virtualbox',
47
- ].flatten}",
48
- # 'chef exec circleci config process .circleci/config.yml > process.yml',
49
- # "chef exec circleci local execute -c process.yml --job #{ENV['GEM_PROJECT_NAME']}",
50
- ].each { |command| system command }
51
- end
52
-
53
- def prepare_project
54
- install_chef
55
- end
56
-
57
- def finalize_project
58
- system('knife node show $(hostname) -z')
59
- end
60
-
61
- def start_project
62
- prepare_project
63
- run_project
64
- finalize_project
65
- end
66
- end
67
- end
68
- end
69
-
70
- JimboDragon::AcceptanceTests::StartCucumber.start_chef_client
12
+ JimboDragon::Main.new(self).converge
data/client.rb CHANGED
@@ -1,3 +1,4 @@
1
- require_relative 'lib/knife'
1
+ require_relative 'env' if ::File.exist?('env.rb')
2
+ require_relative 'lib/jimbodragon'
2
3
 
3
- JimboDragon.loading_chef(self)
4
+ JimboDragon.converge(self)
data/knife.rb CHANGED
@@ -1,3 +1,4 @@
1
- require_relative 'lib/knife'
1
+ require_relative 'env' if ::File.exist?('env.rb')
2
+ require_relative 'lib/jimbodragon'
2
3
 
3
- JimboDragon.loading_chef(self)
4
+ JimboDragon.converge(self)
@@ -0,0 +1,55 @@
1
+ require_relative 'jimbodragon/main'
2
+
3
+ require_relative 'jimbodragon/convergence'
4
+ require_relative 'jimbodragon/deploy'
5
+ require_relative 'jimbodragon/knife'
6
+
7
+ module JimboDragon
8
+ def self.converge(knife_or_chefclient)
9
+ extend JimboDragon::JimboEnv
10
+ extend JimboDragon::Convergence
11
+
12
+ deploy = JimboDragon::Deploy.new
13
+
14
+ case knife_or_chefclient
15
+ when JimboDragon::Main
16
+ install_chef
17
+ [
18
+ "chef exec knife cookbook upload #{[
19
+ JimboDragon::JimboEnv::NAMED_RUN_LIST,
20
+ JimboDragon::JimboEnv::GEM_PROJECT_NAME,
21
+ ].flatten.join(' ')}",
22
+ "chef-client -r #{JimboDragon::JimboEnv::NAMED_RUN_LIST}",
23
+ "chef gem build #{JimboDragon::JimboEnv::GEM_PROJECT_NAME}.gemspec",
24
+ "chef gem push #{JimboDragon::JimboEnv::GEM_PROJECT_NAME}-#{JimboDragon::JimboEnv::GEM_PROJECT_VERSION}.gem",
25
+ ].each do |command|
26
+ puts "Executing command #{command}"
27
+ deploy.deploy_commands.push command
28
+ end
29
+ else
30
+ case knife_or_chefclient.to_s
31
+ when 'ChefConfig::Config'
32
+ Chef::Log.warn('Haha Chef is now in use')
33
+ JimboDragon::Knife.new(knife_or_chefclient).load_knife
34
+ else
35
+ if respond_to? :logger
36
+ logger.warn "knife_or_chefclient = #{logger.class}"
37
+ case logger
38
+ when nil
39
+ logger.warn "knife_or_chefclient = #{logger.class}"
40
+ else
41
+ logger.warn "knife_or_chefclient = #{knife_or_chefclient.class}"
42
+ end
43
+ elsif respond_to? :Chef
44
+ Chef::Log.warn "knife_or_chefclient = #{knife_or_chefclient.to_s}"
45
+ else
46
+ puts "knife_or_chefclient = #{knife_or_chefclient.to_s}"
47
+ end
48
+ end
49
+ end
50
+
51
+ prepare_project
52
+ deploy.execute_deploy_command
53
+ finalize_project
54
+ end
55
+ end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jimbodragon_acceptance_test
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jimmy Provencher
@@ -35,7 +35,7 @@ cert_chain:
35
35
  +V3ectLBpuoKM8f/ZFMnUPA0mAv5e7J6u9IBwyNj/cy+wLOAbpPdmhoKZXCpQcno
36
36
  ysBBJbi//0tgFWwC4vOaDMch
37
37
  -----END CERTIFICATE-----
38
- date: 2022-12-16 00:00:00.000000000 Z
38
+ date: 2022-12-17 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: chef
@@ -95,7 +95,7 @@ files:
95
95
  - bin/jimbodragon_acceptance_test
96
96
  - client.rb
97
97
  - knife.rb
98
- - lib/knife.rb
98
+ - lib/jimbodragon.rb
99
99
  homepage: https://github.com/JimboDragonGit/jimbodragon_acceptance_test
100
100
  licenses:
101
101
  - MIT
metadata.gz.sig CHANGED
Binary file
data/lib/knife.rb DELETED
@@ -1,68 +0,0 @@
1
-
2
- module JimboDragon
3
- def self.loading_chef(knife_or_chefclient)
4
- JimboDragon.Knife.new(knife_or_chefclient)
5
- end
6
-
7
- class Knife
8
- attr_accessor :knife_or_chefclient
9
-
10
- def send_to_chef(method, parameter)
11
- knife_or_chefclient.send(method, parameter)
12
- end
13
-
14
- def initialize(knife_or_chefclient)
15
- @knife_or_chefclient = knife_or_chefclient
16
- send_to_chef(:chef_license, 'accept')
17
- send_to_chef(:log_level, :info)
18
- send_to_chef(:node_name, ENV['KNIFE_USER'])
19
-
20
- send_to_chef(:client_key, "#{chef_repo_path}/profiles.d/#{ENV['KNIFE_USER']}/chef/#{ENV['KNIFE_USER']}.pem")
21
- send_to_chef(:chef_server_url, 'https://api.chef.io/organizations/jimbodragon')
22
-
23
- send_to_chef(:chef_repo_path, chef_repo_path)
24
- send_to_chef(:cookbook_path, [
25
- "#{chef_repo_path}/cookbooks/",
26
- "#{chef_repo_path}/libraries/",
27
- "#{chef_repo_path}/resources/",
28
- "#{chef_repo_path}/berks-cookbooks/",
29
- ]
30
- )
31
- send_to_chef(:data_bags_path, "#{chef_repo_path}/data_bags")
32
- send_to_chef(:environment_path, "#{chef_repo_path}/environments")
33
- send_to_chef(:node_path, "#{chef_repo_path}/nodes")
34
- send_to_chef(:policy_group_path, "#{chef_repo_path}/policy_group")
35
- send_to_chef(:policy_path, "#{chef_repo_path}/policies")
36
- send_to_chef(:role_path, "#{chef_repo_path}/roles")
37
- send_to_chef(:log_location, "#{chef_repo_path}/logs/#{ENV['KNIFE_USER']}.log")
38
- send_to_chef(:cache_path, "#{chef_repo_path}/.chef/local-mode-cache")
39
- send_to_chef(:checksum_path, "#{chef_repo_path}/.chef/local-mode-cache/checksums")
40
- send_to_chef(:acl_path, "#{chef_repo_path}/acls")
41
- send_to_chef(:client_d_dir, "#{chef_repo_path}/.chef/client.d")
42
- send_to_chef(:client_key_path, "#{chef_repo_path}/client_keys")
43
- send_to_chef(:client_path, "#{chef_repo_path}/clients")
44
- send_to_chef(:color, true)
45
- send_to_chef(:config_d_dir, "#{chef_repo_path}/.chef/config.d")
46
- send_to_chef(:config_dir, "#{chef_repo_path}/.chef")
47
- send_to_chef(:container_path, "#{chef_repo_path}/containers")
48
- send_to_chef(:cookbook_artifact_path, "#{chef_repo_path}/cookbook_artifacts")
49
- send_to_chef(:enable_reporting, false)
50
- send_to_chef(:file_backup_path, "#{chef_repo_path}/.chef/local-mode-cache/backup")
51
- send_to_chef(:file_cache_path, "#{chef_repo_path}/.chef/local-mode-cache/cache")
52
- send_to_chef(:group_path, "#{chef_repo_path}/groups")
53
- send_to_chef(:lockfile, "#{chef_repo_path}/.chef/local-mode-cache/cache/chef-client-running.pid")
54
- send_to_chef(:ohai_segment_plugin_path, "#{chef_repo_path}/.chef/ohai/cookbook_plugins")
55
- send_to_chef(:solo_d_dir, "#{chef_repo_path}/.chef/solo.d")
56
- send_to_chef(:user_path, "#{chef_repo_path}/users")
57
- send_to_chef(:syntax_check_cache_path, "#{chef_repo_path}/.chef/syntaxcache")
58
- send_to_chef(:trusted_certs_dir, "#{chef_repo_path}/.chef/trusted_certs")
59
- send_to_chef(:validation_client_name, "#{ENV['HAB_ORIGIN']}-validator")
60
- send_to_chef(:data_bag_encrypt_version, 3)
61
- send_to_chef(:named_run_list, NAMED_RUN_LIST)
62
- end
63
-
64
- def chef_repo_path
65
-
66
- end
67
- end
68
- end