jimbodragon_acceptance_test 0.1.1 → 0.1.2

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: 788d3bdde1637420a6ea2fcb6748411b1a391e0645d0075fd3013233ccd30c48
4
- data.tar.gz: 8612e4a250d5e2ea2a3bd8c0b6b6f2eacdc7cb89e175b17d5110f9e410c93525
3
+ metadata.gz: 2757fc95ac29fc62dd8a725fccf1fdefc88afc259c35e31a1f4f23f9ef59a5dc
4
+ data.tar.gz: f2d71bec5961816543ae06a20b9de94494667d2c405b1b772dae5d217a4ae7a3
5
5
  SHA512:
6
- metadata.gz: 18e583c3bc7c458642fd2b3172526fbb88857f800716f9d2f0f5c9be4c707d5f68f6fc3df33d9416d4b39fb4b0ad305a455e2b8748f453469e6b1c292bdc9a3c
7
- data.tar.gz: ff109d7bb57cbf83bda0653b5b580ebaab06cb075fb6a91846bb69af45b392fd97c9e1171c158652e234b391565a56185a0996500e9a5686ef7d413302c27d83
6
+ metadata.gz: 4b9ce3d6e6daa27af071bd258b3c399d67825d6b8302c212adcfb91119b920038637e4e7b5b40fa5165494a00053294eb99f8cc19959139389132fe10b81a37d
7
+ data.tar.gz: 3e2eda8fd20654ed38a8b6f0543731d51605572e28e88d78e16674e53147a26bd166a508d4184687bf3251b662cb55b2ff42176c1175ccf8f8562f6eb31cdf7c
checksums.yaml.gz.sig CHANGED
Binary file
@@ -1,46 +1,70 @@
1
1
  #!/opt/chef-workstation/embedded/bin/ruby
2
+
2
3
  # Trap interrupts to quit cleanly. See
3
4
  # https://twitter.com/mitchellh/status/283014103189053442
4
5
  Signal.trap('INT') { exit 1 }
6
+
7
+ require_relative ENV['ENVIRONMENT_FILE'] if !ENV['ENVIRONMENT_FILE'].nil? && ::File.exist?(ENV['ENVIRONMENT_FILE'])
8
+
5
9
  module JimboDragon
6
10
  module AcceptanceTests
7
11
  module StartCucumber
8
- def self.start
12
+ def self.start_chef_client
9
13
  extend JimboDragon::AcceptanceTests::StartCucumber
10
14
  start_project
11
15
  end
12
-
16
+
13
17
  def install_chef
14
- system('curl -L https://omnitruck.chef.io/install.sh | sudo bash -s -- -s once -P chef-workstation')
15
- end
16
-
17
- def install_cucumber
18
- system('chef gem install cucumber')
18
+ system('curl -L https://omnitruck.chef.io/install.sh | sudo bash -s -- -s once -P chef-client')
19
19
  end
20
-
21
- def run_project()
22
- system('chef exec cucumber')
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 }
23
51
  end
24
-
25
- def prepare_project(project_name)
52
+
53
+ def prepare_project
26
54
  install_chef
27
- install_cucumber
28
55
  end
29
-
30
- def finalize_project()
56
+
57
+ def finalize_project
31
58
  system('knife node show $(hostname) -z')
32
59
  end
33
-
34
- def start_project(project_name)
35
- current_file=__FILE__
36
- current_parameter=ARGV
37
- echo "Running project $project_name"
38
- prepare_project project_name
39
- run_project project_name
60
+
61
+ def start_project
62
+ prepare_project
63
+ run_project
40
64
  finalize_project
41
65
  end
42
66
  end
43
67
  end
44
68
  end
45
69
 
46
- JimboDragon::AcceptanceTests::StartCucumber.start
70
+ JimboDragon::AcceptanceTests::StartCucumber.start_chef_client
data/client.rb ADDED
@@ -0,0 +1 @@
1
+ require_relative 'common_knife'
data/common_knife.rb ADDED
@@ -0,0 +1,53 @@
1
+
2
+ require_relative 'env' if ::File.exist?('env.rb')
3
+
4
+ module JimboDragon
5
+ def self.loading_chef(knife_or_chefclient)
6
+ knife_or_chefclient.send(:chef_license, 'accept')
7
+ knife_or_chefclient.send(:log_level, :info)
8
+ knife_or_chefclient.send(:node_name, KNIFE_USER)
9
+
10
+ knife_or_chefclient.send(:client_key, "chef_repo/profiles.d/#{KNIFE_USER}/chef/#{KNIFE_USER}.pem")
11
+ knife_or_chefclient.send(:chef_server_url, 'https://api.chef.io/organizations/jimbodragon')
12
+
13
+ knife_or_chefclient.send(:chef_repo_path, 'chef_repo')
14
+ knife_or_chefclient.send(:cookbook_path, [
15
+ 'chef_repo/cookbooks',
16
+ 'chef_repo/libraries',
17
+ 'chef_repo/resources',
18
+ 'chef_repo/berks-cookbooks',
19
+ ]
20
+ )
21
+ knife_or_chefclient.send(:data_bags_path, 'chef_repo/data_bags')
22
+ knife_or_chefclient.send(:environment_path, 'chef_repo/environments')
23
+ knife_or_chefclient.send(:node_path, 'chef_repo/nodes')
24
+ knife_or_chefclient.send(:policy_group_path, 'chef_repo/policy_group')
25
+ knife_or_chefclient.send(:policy_path, 'chef_repo/policies')
26
+ knife_or_chefclient.send(:role_path, 'chef_repo/roles')
27
+ knife_or_chefclient.send(:log_location, "chef_repo/logs/#{KNIFE_USER}.log")
28
+ knife_or_chefclient.send(:cache_path, 'chef_repo/.chef/local-mode-cache')
29
+ knife_or_chefclient.send(:checksum_path, 'chef_repo/.chef/local-mode-cache/checksums')
30
+ knife_or_chefclient.send(:acl_path, 'chef_repo/acls')
31
+ knife_or_chefclient.send(:client_d_dir, 'chef_repo/.chef/client.d')
32
+ knife_or_chefclient.send(:client_key_path, 'chef_repo/client_keys')
33
+ knife_or_chefclient.send(:client_path, 'chef_repo/clients')
34
+ knife_or_chefclient.send(:color, true)
35
+ knife_or_chefclient.send(:config_d_dir, 'chef_repo/.chef/config.d')
36
+ knife_or_chefclient.send(:config_dir, 'chef_repo/.chef')
37
+ knife_or_chefclient.send(:container_path, 'chef_repo/containers')
38
+ knife_or_chefclient.send(:cookbook_artifact_path, 'chef_repo/cookbook_artifacts')
39
+ knife_or_chefclient.send(:enable_reporting, false)
40
+ knife_or_chefclient.send(:file_backup_path, 'chef_repo/.chef/local-mode-cache/backup')
41
+ knife_or_chefclient.send(:file_cache_path, 'chef_repo/.chef/local-mode-cache/cache')
42
+ knife_or_chefclient.send(:group_path, 'chef_repo/groups')
43
+ knife_or_chefclient.send(:lockfile, 'chef_repo/.chef/local-mode-cache/cache/chef-client-running.pid')
44
+ knife_or_chefclient.send(:ohai_segment_plugin_path, 'chef_repo/.chef/ohai/cookbook_plugins')
45
+ knife_or_chefclient.send(:solo_d_dir, 'chef_repo/.chef/solo.d')
46
+ knife_or_chefclient.send(:user_path, 'chef_repo/users')
47
+ knife_or_chefclient.send(:syntax_check_cache_path, 'chef_repo/.chef/syntaxcache')
48
+ knife_or_chefclient.send(:trusted_certs_dir, 'chef_repo/.chef/trusted_certs')
49
+ knife_or_chefclient.send(:validation_client_name, 'exemple-chef-validator')
50
+ knife_or_chefclient.send(:data_bag_encrypt_version, 3)
51
+ knife_or_chefclient.send(:named_run_list, NAMED_RUN_LIST)
52
+ end
53
+ end
data/knife.rb ADDED
@@ -0,0 +1,3 @@
1
+ require_relative 'common_knife'
2
+
3
+ JimboDragon.loading_chef(self)
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.1
4
+ version: 0.1.2
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-12 00:00:00.000000000 Z
38
+ date: 2022-12-16 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: chef
@@ -93,6 +93,9 @@ files:
93
93
  - LICENSE
94
94
  - README.md
95
95
  - bin/jimbodragon_acceptance_test
96
+ - client.rb
97
+ - common_knife.rb
98
+ - knife.rb
96
99
  homepage: https://github.com/JimboDragonGit/jimbodragon_acceptance_test
97
100
  licenses:
98
101
  - MIT
metadata.gz.sig CHANGED
Binary file