deploy_rubygem 0.60.4 → 0.60.5

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: 3388802794154c834921961f66099f3aa8f0e70ed436f4906fc7b8a101f3cb72
4
- data.tar.gz: 024aba991f3b84dfff859855229c8851f8ff0eb1f5fefa6ca72c42090cd4ce8f
3
+ metadata.gz: b46534489fbc676e1cafd33d24882ec3a52a5e12ce14e241235ae7a730e94ff0
4
+ data.tar.gz: 1aec76802ed9d0d78320d19df474063e50f32979ef37e9a7f40d687e60f8063b
5
5
  SHA512:
6
- metadata.gz: 5a752952cd5da1bccc92c1348c46792696698b69414bca2a92fea356ab6cb00eee413e38b49319ef17aa0d1970e34a0c0385fc3bbe186182963c5fe4a4492d38
7
- data.tar.gz: 265d66f29d787b2790d5e29b1a845b389d9d98d836f3676a9490d24c168cf177fc038bfb04ab736ad866ecbb6243587c26cc54d394e5acea3c960558c9d52427
6
+ metadata.gz: cc9bd2bbd6e0c348b4f39d800e987e72dd647f4d8359364b8d2197471a5f7914e9a4f0232402cc048dbcc3a620a99a4820b054c579f607876e580ec52c5d7f5f
7
+ data.tar.gz: 699abadf754c54747852902744121e6323839d376462c5d4a355e1fee66cfbddf0d1288d87492b7b03800923b79abb8c592393846673ae04f8943162bacf8d60
checksums.yaml.gz.sig CHANGED
Binary file
data/.rspec CHANGED
@@ -1,4 +1,3 @@
1
1
  --format documentation
2
2
  --color
3
3
  --require spec_helper
4
- --require unit_deploy_rubygem
data/.rubocop.yml CHANGED
@@ -21,3 +21,7 @@ Metrics/AbcSize:
21
21
 
22
22
  Layout/CommentIndentation:
23
23
  Enabled: false
24
+
25
+ Metrics/MethodLength:
26
+ Enabled: true
27
+ Max: 15
data/LICENSE.txt CHANGED
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2024 Jimmy Provencher
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
data/Rakefile CHANGED
@@ -3,15 +3,15 @@
3
3
  require 'bundler/gem_tasks'
4
4
  require 'rspec/core/rake_task'
5
5
 
6
- RSpec::Core::RakeTask.new(:spec)
7
-
8
6
  require 'rubocop/rake_task'
9
7
 
8
+ RSpec::Core::RakeTask.new(:spec)
10
9
  RuboCop::RakeTask.new
11
10
 
12
- # require 'git-version-bump/rake-tasks'
13
-
14
- # task default: %i[spec rubocop] + ['version:bump:minor']
15
-
16
- task default: %i[rubocop spec]
17
- task circleci: %i[rubocop install:local spec]
11
+ task test_framework: %i[clean rubocop spec]
12
+ task default: %i[test_framework build install:local]
13
+ task cicd: %i[default release test_version]
14
+ task test_version: %i[install compliance]
15
+ task :compliance do
16
+ system('inspec exec git@github.com:JimboDragonGit/rubygem_baseline.git --input-file compliance.yml')
17
+ end
@@ -1,7 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'deploy_rubygem/project'
4
- require 'deploy_rubygem/kitchen'
3
+ require_relative 'project'
4
+ require_relative 'kitchen'
5
+ require_relative 'inspec'
6
+ require_relative 'rubygem'
5
7
 
6
8
  # DeployRubygem - deploy a gem using rake
7
9
  # Containing a class
@@ -13,7 +15,9 @@ module DeployRubygem
13
15
  def initialize(new_cookbook_info)
14
16
  super(new_cookbook_info)
15
17
  @profiles = cookbook_info[:compliance_profiles].map do |profile_name|
16
- Inspec.new(profile_name)
18
+ input_file = File.join(%w[compliance inputs] + ["#{cookbook_name}.yml"])
19
+ waiver_file = File.join(%w[compliance waivers] + ["#{cookbook_name}.yml"])
20
+ Inspec.new(profile_name, input_file, waiver_file)
17
21
  end
18
22
  @kitchens = cookbook_info[:kitchens].map do |kitchen_name|
19
23
  Kitchen.new(kitchen_name, self)
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'deploy_rubygem/project'
4
-
5
3
  # DeployRubygem - deploy a gem using rake
6
4
  # Containing a class
7
5
  module DeployRubygem
@@ -9,19 +7,30 @@ module DeployRubygem
9
7
  class Inspec
10
8
  attr_reader :inspec_name, :input_file
11
9
 
12
- def initialize(inspec_name, input_file = nil)
10
+ def initialize(inspec_name, input_file = nil, waiver_file = nil)
13
11
  @inspec_name = inspec_name
14
12
  @input_file = input_file
13
+ @waiver_file = waiver_file
15
14
  end
16
15
 
17
16
  def apply
18
17
  puts "ActuaL Dir #{Dir.pwd}"
19
18
  puts "inspec_name = #{inspec_name}"
20
19
  puts "input_file = #{input_file}"
20
+ puts "waiver_file = #{waiver_file}"
21
21
  system("inspec check compliance/profiles/#{inspec_name}")
22
- cmd_opt = ''
23
- cmd_opt = "--input-file #{input_file}" unless input_file.nil?
24
- system("inspec exec compliance/profiles/#{inspec_name} #{cmd_opt}")
22
+ cmd_opt = []
23
+
24
+ unless input_file.nil?
25
+ cmd_opt << '--input-file'
26
+ cmd_opt << input_file
27
+ end
28
+
29
+ unless waiver_file.nil?
30
+ cmd_opt << '--waiver-file'
31
+ cmd_opt << waiver_file
32
+ end
33
+ system("inspec exec compliance/profiles/#{inspec_name} #{cmd_opt.join(' ')}")
25
34
  end
26
35
 
27
36
  def update
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'deploy_rubygem/inspec'
4
-
5
3
  # DeployRubygem - deploy a gem using rake
6
4
  # Containing a class
7
5
  module DeployRubygem
@@ -47,7 +47,7 @@ module DeployRubygem
47
47
  end
48
48
 
49
49
  def short_version
50
- "#{major_version}.#{minor_version}.#{patch_version}"
50
+ Gem::Version.new("#{major_version}.#{minor_version}.#{patch_version}")
51
51
  end
52
52
  end
53
53
 
@@ -108,10 +108,9 @@ module DeployRubygem
108
108
  end
109
109
 
110
110
  def git_commit
111
- system('git add .') || exit(106)
112
- system("git commit -m \"Deploying #{project_name}_$(git version-bump show)\"")
113
- system("git commit -m 'Self valifated for version #{GVB.version}'") || exit(107)
114
- system('git push') || exit(108)
111
+ system('git add .') || return
112
+ system("git commit -m 'Self validated for version #{GVB.version}'") || return
113
+ system('git push') || abort("Cannot push #{project_name} #{GVB.version}")
115
114
  end
116
115
 
117
116
  def gvb_version
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'deploy_rubygem/cookbook'
3
+ require_relative 'project'
4
+ require_relative 'cookbook'
4
5
 
5
6
  # DeployRubygem - deploy a gem using rake
6
7
  # Containing a class
@@ -54,17 +55,18 @@ module DeployRubygem
54
55
 
55
56
  def rake_test
56
57
  File.delete('Gemfile.lock') if File.exist?('Gemfile.lock')
57
- system('bundle') || exit(100)
58
- system('rake') || exit(101)
59
- system('rake build') || exit(102)
60
- system('rake install:local') || exit(103)
58
+ system('bundle') || return
59
+ system('bundle install') || return
60
+ system('rake') || return
61
+ # system('rake build') &&
62
+ # system('rake install:local') &&
61
63
  end
62
64
 
63
65
  def rake_release
64
66
  change_to_project_folder
65
67
  git_commit
66
- system('rake install') || exit(104)
67
- system('rake release') || exit(105)
68
+ system('rake install') || abort("Cannot rake install #{project_name} #{GVB.version}")
69
+ # system('rake release') || exit(105)
68
70
  end
69
71
 
70
72
  def release
@@ -78,7 +80,7 @@ module DeployRubygem
78
80
  deploy_cookbooks
79
81
  change_to_project_folder
80
82
 
81
- release
83
+ # release
82
84
  test_compliance
83
85
  end
84
86
  end
@@ -2,8 +2,8 @@
2
2
 
3
3
  require 'git-version-bump'
4
4
 
5
- require 'deploy_rubygem/rubygem'
6
- require 'deploy_rubygem/deploy_rubygem_options'
5
+ require_relative 'rubygem'
6
+ require_relative 'deploy_rubygem_options'
7
7
 
8
8
  # Set version for DeployRubygem
9
9
  module DeployRubygem
@@ -16,5 +16,6 @@ module DeployRubygem
16
16
  @self_project
17
17
  end
18
18
 
19
- VERSION = new_deploy_rubygem.gvb_version.short_version
19
+ # VERSION = new_deploy_rubygem.gvb_version.short_version
20
+ VERSION = '0.60.5'
20
21
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'deploy_rubygem/version'
3
+ require_relative 'deploy_rubygem/version'
4
4
 
5
5
  # DeployRubygem - deploy a gem using rake
6
6
  module DeployRubygem
data.tar.gz.sig CHANGED
@@ -1,4 +1,3 @@
1
- �6�������D�1q��� m�{���/荳�V� �o����N�ߵ��[:����cV�~�ޓ�
2
- gm}
3
- �켕���N[��h�ׂ~��K����+�f�����b�=����"�ř��8I�I����P��^4��D.=�~�]�n{�u�Hp^0W}�`/�
4
- �_�X�L���Հ�0«���N�% �H�T�:�_R&����ЂSdI����S� �S����'�`s#��O�������Ñ��!j��g�ޯ����V��5�.�ܝ[�x'q���.U��范����៥�^}�U �����d��;(i�w-��#�Ǖ-A`V��� ~,�����j�a��l����@�u�{]��ࡘ[{�AK%�0vO$
1
+ �ڸ�D��)��b�%H*�����
2
+ P�!�iEH�;��Ʈ�:��0}c����%ޤ�Wq��l�<+;� bG{n��F���˻��Z���C/z����V�L�\�Z�B]� �S�M��ӻ�a��R3א���Jh�]M��ś��X���b�r�Z������ 8���F����m�b��Q�(ݞI�5�ڟ�U��������v�|kj�(L�Fє`*�cj,
3
+
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.4
4
+ version: 0.60.5
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-06 00:00:00.000000000 Z
36
+ date: 2024-06-08 00:00:00.000000000 Z
37
37
  dependencies:
38
38
  - !ruby/object:Gem::Dependency
39
39
  name: git-version-bump
@@ -63,6 +63,20 @@ dependencies:
63
63
  - - "~>"
64
64
  - !ruby/object:Gem::Version
65
65
  version: 3.13.0
66
+ - !ruby/object:Gem::Dependency
67
+ name: rspec-core
68
+ requirement: !ruby/object:Gem::Requirement
69
+ requirements:
70
+ - - "~>"
71
+ - !ruby/object:Gem::Version
72
+ version: 3.13.0
73
+ type: :runtime
74
+ prerelease: false
75
+ version_requirements: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - "~>"
78
+ - !ruby/object:Gem::Version
79
+ version: 3.13.0
66
80
  - !ruby/object:Gem::Dependency
67
81
  name: rspec-support
68
82
  requirement: !ruby/object:Gem::Requirement
@@ -120,30 +134,20 @@ extra_rdoc_files:
120
134
  - README.md
121
135
  - LICENSE
122
136
  files:
123
- - ".circleci/config.yml"
124
- - ".gitignore"
125
137
  - ".kitchen/logs/kitchen.log"
126
138
  - ".rspec"
127
139
  - ".rubocop.yml"
128
140
  - CHANGELOG.md
129
141
  - CODE_OF_CONDUCT.md
130
- - Gemfile
131
142
  - LICENSE
132
143
  - LICENSE.txt
133
144
  - README.md
134
145
  - Rakefile
135
- - bin/console
136
- - bin/deploy_jimbo_management_site_website
137
146
  - bin/deploy_jimbodragon
138
147
  - bin/deploy_rubygem
139
148
  - bin/deploy_rubygem_manually
140
- - bin/deploy_with_habitat
141
- - bin/inspec_deploy_rubygem
142
- - bin/local_test_deploy_rubygem
143
149
  - bin/prepare_workstation
144
- - bin/setup
145
150
  - bin/test_deploy_rubygem
146
- - deploy_rubygem.gemspec
147
151
  - exe/deploy_rubygem
148
152
  - lib/deploy_rubygem.rb
149
153
  - lib/deploy_rubygem/cookbook.rb
@@ -154,11 +158,6 @@ files:
154
158
  - lib/deploy_rubygem/rubygem.rb
155
159
  - lib/deploy_rubygem/version.rb
156
160
  - sig/deploy_rubygem.rbs
157
- - spec/deploy_rubygem_spec.rb
158
- - spec/generate_test_cookbook.rb
159
- - spec/jimbo_management_site.rb
160
- - spec/spec_helper.rb
161
- - spec/unit_deploy_rubygem.rb
162
161
  homepage: https://github.com/JimboDragonGit/deploy_rubygem
163
162
  licenses:
164
163
  - MIT
metadata.gz.sig CHANGED
@@ -1,2 +1 @@
1
- X(��1 �����e�/9oE��W9%������YLI��{2��KJ�B�4^��7aʑ���_����qa�:��!�rn�3�R���/��'gD�8�eU��x��g@ϻ E�j�*&��D�^����d���ԟ���{��7��Kw��V���`h׀_��tw
2
- �+�A�_��-�G��������G��ӿy=� S�5ya1b�]f[ޞ.���De�Vz^��G���N%�R��C4�c�Tw:?� :�M)$�*c��>�~$ͩ~����WpQ�W#m�rN�/�p\^�0�ҫ�X��\<P��&�N�7q�$CT_ȋ��I=���W����w
1
+ G6
data/.circleci/config.yml DELETED
@@ -1,112 +0,0 @@
1
- version: 2.1
2
-
3
- jobs:
4
- latest_install:
5
- docker:
6
- - image: cimg/ruby:3.1.2
7
- auth:
8
- username: $DOCKERHUB_USER
9
- password: $DOCKERHUB_PASSWORD # context / project UI env-var reference
10
-
11
- environment: {}
12
- working_directory: /home/circleci/deploy_rubygem
13
- steps:
14
- - checkout
15
- - run: |
16
- set -xu
17
- echo 'github.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl' >> ~/.ssh/known_hosts
18
- echo 'github.com ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEmKSENjQEezOmxkZMy7opKgwFB9nkt5YRrYMjNuG5N87uRgg6CLrbo5wAdT/y6v0mKV0U2w0WZ2YB/++Tpockg=' >> ~/.ssh/known_hosts
19
- echo 'github.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCj7ndNxQowgcQnjshcLrqPEiiphnt+VTTvDP6mHBL9j1aNUkY4Ue1gvwnGLVlOhGeYrnZaMgRK6+PKCUXaDbC7qtbW8gIkhL7aGCsOr/C56SJMy/BCZfxd1nWzAOxSDPgVsmerOBYfNqltV9/hWCqBywINIR+5dIg6JTJ72pcEpEjcYgXkE2YEFXV1JHnsKgbLWNlhScqb2UmyRkQyytRLtL+38TGxkxCflmO+5Z8CSSNY7GidjMIZ7Q4zMjA2n1nGrlTDkzwDCsw+wqFPGQA179cnfGWOWRVruj16z6XyvxvjJwbz0wQZ75XK5tKSb7FNyeIEs4TT4jk+S4dhPeAUC5y+bDYirYgM4GC7uEnztnZyaVWQ7B381AK4Qdrwt51ZqExKbQpTUNn+EjqoTwvqNj4kqx5QUCI0ThS/YkOxJCXmPUWZbhjpCg56i+2aB6CmK2JGhn57K5mj0MNdBXA4/WnwH6XoPWJzK5Nyu2zB3nAZp+S5hpQs+p1vN1/wsjk=' >> ~/.ssh/known_hosts
20
- cat ~/.ssh/known_hosts
21
- ssh git@github.com || echo
22
- gem install deploy_rubygem
23
- chefrepo_checkout:
24
- docker:
25
- - image: cimg/ruby:3.1.2
26
- auth:
27
- username: $DOCKERHUB_USER
28
- password: $DOCKERHUB_PASSWORD # context / project UI env-var reference
29
-
30
- environment: {}
31
- working_directory: /home/circleci/deploy_rubygem
32
- steps:
33
- - checkout
34
- - run: |
35
- set -xu
36
- echo 'github.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl' >> ~/.ssh/known_hosts
37
- echo 'github.com ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEmKSENjQEezOmxkZMy7opKgwFB9nkt5YRrYMjNuG5N87uRgg6CLrbo5wAdT/y6v0mKV0U2w0WZ2YB/++Tpockg=' >> ~/.ssh/known_hosts
38
- echo 'github.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCj7ndNxQowgcQnjshcLrqPEiiphnt+VTTvDP6mHBL9j1aNUkY4Ue1gvwnGLVlOhGeYrnZaMgRK6+PKCUXaDbC7qtbW8gIkhL7aGCsOr/C56SJMy/BCZfxd1nWzAOxSDPgVsmerOBYfNqltV9/hWCqBywINIR+5dIg6JTJ72pcEpEjcYgXkE2YEFXV1JHnsKgbLWNlhScqb2UmyRkQyytRLtL+38TGxkxCflmO+5Z8CSSNY7GidjMIZ7Q4zMjA2n1nGrlTDkzwDCsw+wqFPGQA179cnfGWOWRVruj16z6XyvxvjJwbz0wQZ75XK5tKSb7FNyeIEs4TT4jk+S4dhPeAUC5y+bDYirYgM4GC7uEnztnZyaVWQ7B381AK4Qdrwt51ZqExKbQpTUNn+EjqoTwvqNj4kqx5QUCI0ThS/YkOxJCXmPUWZbhjpCg56i+2aB6CmK2JGhn57K5mj0MNdBXA4/WnwH6XoPWJzK5Nyu2zB3nAZp+S5hpQs+p1vN1/wsjk=' >> ~/.ssh/known_hosts
39
- cat ~/.ssh/known_hosts
40
- ssh git@github.com || echo
41
- gem install deploy_rubygem
42
- deploy_public:
43
- docker:
44
- - image: cimg/ruby:3.1.2
45
- auth:
46
- username: $DOCKERHUB_USER
47
- password: $DOCKERHUB_PASSWORD # context / project UI env-var reference
48
-
49
- environment: {}
50
- working_directory: /home/circleci/deploy_rubygem
51
- steps:
52
- - checkout
53
- - run: |
54
- set -xu
55
- echo 'github.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl' >> ~/.ssh/known_hosts
56
- echo 'github.com ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEmKSENjQEezOmxkZMy7opKgwFB9nkt5YRrYMjNuG5N87uRgg6CLrbo5wAdT/y6v0mKV0U2w0WZ2YB/++Tpockg=' >> ~/.ssh/known_hosts
57
- echo 'github.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCj7ndNxQowgcQnjshcLrqPEiiphnt+VTTvDP6mHBL9j1aNUkY4Ue1gvwnGLVlOhGeYrnZaMgRK6+PKCUXaDbC7qtbW8gIkhL7aGCsOr/C56SJMy/BCZfxd1nWzAOxSDPgVsmerOBYfNqltV9/hWCqBywINIR+5dIg6JTJ72pcEpEjcYgXkE2YEFXV1JHnsKgbLWNlhScqb2UmyRkQyytRLtL+38TGxkxCflmO+5Z8CSSNY7GidjMIZ7Q4zMjA2n1nGrlTDkzwDCsw+wqFPGQA179cnfGWOWRVruj16z6XyvxvjJwbz0wQZ75XK5tKSb7FNyeIEs4TT4jk+S4dhPeAUC5y+bDYirYgM4GC7uEnztnZyaVWQ7B381AK4Qdrwt51ZqExKbQpTUNn+EjqoTwvqNj4kqx5QUCI0ThS/YkOxJCXmPUWZbhjpCg56i+2aB6CmK2JGhn57K5mj0MNdBXA4/WnwH6XoPWJzK5Nyu2zB3nAZp+S5hpQs+p1vN1/wsjk=' >> ~/.ssh/known_hosts
58
- cat ~/.ssh/known_hosts
59
- ssh git@github.com || echo
60
- gem install deploy_rubygem
61
-
62
- deploy_rubygem
63
- execute_local:
64
- docker:
65
- - image: cimg/ruby:3.1.2
66
- auth:
67
- username: $DOCKERHUB_USER
68
- password: $DOCKERHUB_PASSWORD # context / project UI env-var reference
69
-
70
- environment: {}
71
- working_directory: /home/circleci/deploy_rubygem
72
- steps:
73
- - checkout
74
- - run: |
75
- ruby bin/deploy_rubygem
76
- execute_rake:
77
- docker:
78
- - image: cimg/ruby:3.1.2
79
- auth:
80
- username: $DOCKERHUB_USER
81
- password: $DOCKERHUB_PASSWORD # context / project UI env-var reference
82
-
83
- environment: {}
84
- working_directory: /home/circleci/deploy_rubygem
85
- steps:
86
- - checkout
87
- - run: |
88
- gem install git-version-bump
89
- bundle install
90
- rake circleci
91
- #...
92
- workflows:
93
- version: 2
94
- deploy_rubygem:
95
- jobs:
96
- - latest_install:
97
- filters:
98
- branches:
99
- only: master
100
- - execute_local:
101
- filters:
102
- branches:
103
- only: master
104
- - deploy_public:
105
- filters:
106
- branches:
107
- only: master
108
- - execute_rake:
109
- filters:
110
- branches:
111
- only: master
112
-
data/.gitignore DELETED
@@ -1,59 +0,0 @@
1
- *.gem
2
- *.rbc
3
- /.config
4
- /coverage/
5
- /InstalledFiles
6
- /pkg/
7
- /spec/reports/
8
- /spec/examples.txt
9
- /test/tmp/
10
- /test/version_tmp/
11
- /tmp/
12
-
13
- # Used by dotenv library to load environment variables.
14
- # .env
15
-
16
- # Ignore Byebug command history file.
17
- .byebug_history
18
-
19
- ## Specific to RubyMotion:
20
- .dat*
21
- .repl_history
22
- build/
23
- *.bridgesupport
24
- build-iPhoneOS/
25
- build-iPhoneSimulator/
26
-
27
- ## Specific to RubyMotion (use of CocoaPods):
28
- #
29
- # We recommend against adding the Pods directory to your .gitignore. However
30
- # you should judge for yourself, the pros and cons are mentioned at:
31
- # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
32
- #
33
- # vendor/Pods/
34
-
35
- ## Documentation cache and generated files:
36
- /.yardoc/
37
- /_yardoc/
38
- /doc/
39
- /rdoc/
40
-
41
- ## Environment normalization:
42
- /.bundle/
43
- /vendor/bundle
44
- /lib/bundler/man/
45
-
46
- # for a library or gem, you might want to ignore these files since the code is
47
- # intended to run in multiple environments; otherwise, check them in:
48
- # Gemfile.lock
49
- # .ruby-version
50
- # .ruby-gemset
51
-
52
- # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
53
- .rvmrc
54
-
55
- # Used by RuboCop. Remote config files pulled in from inherit_from directive.
56
- # .rubocop-https?--*
57
- Gemfile.lock
58
- .rspec_status
59
- inspec.lock
data/Gemfile DELETED
@@ -1,13 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source 'https://rubygems.org'
4
-
5
- # Specify your gem's dependencies in deploy_rubygem.gemspec
6
- gemspec
7
-
8
- # gem 'git-version-bump', '0.19.1'
9
-
10
- # gem 'rake', '~> 13.0'
11
- # gem 'rspec', '~> 3.13.0'
12
- # gem 'rspec-aupport', '~> 3.13.0'
13
- # gem 'rubocop', '~> 1.21'
data/bin/console DELETED
@@ -1,11 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- require 'bundler/setup'
5
- require 'deploy_rubygem'
6
-
7
- # You can add fixtures and/or initialization code here to make experimenting
8
- # with your gem easier. You can also use a different console, if you like.
9
-
10
- require 'irb'
11
- IRB.start(__FILE__)
@@ -1,11 +0,0 @@
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
- DeployRubygem.new_deploy_rubygem.cookbooks.select do |cookbook|
9
- puts "CHecking cookbook #{cookbook.cookbook_name}"
10
- cookbook.cookbook_name.match 'jimbo_management_site'
11
- end.first.deploy
@@ -1,23 +0,0 @@
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 'json'
7
- require 'deploy_rubygem'
8
-
9
- def inspect_query(query)
10
- puts "class = #{query.class}"
11
- # puts "class = #{query}"
12
- end
13
-
14
- query = JSON.parse(`knife search node name:habitat_chef_client_builder --format json`)
15
-
16
- puts query['results']
17
- query['rows'].each do |client|
18
- puts client['name']
19
- `knife node delete #{client['name']} -y`
20
- `knife client delete #{client['name']} -y`
21
- end
22
-
23
- `hab pkg build habitat/plan.sh`
@@ -1,14 +0,0 @@
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
- profile_options = DeployRubygem::DeployRubygemOptions.new
9
- jimbo_option = profile_options.jimbo_management_site_profile
10
-
11
- inspec_profile = DeployRubygem::Inspec.new(jimbo_option[:profile], jimbo_option[:input])
12
-
13
- inspec_profile.update
14
- inspec_profile.apply
@@ -1,8 +0,0 @@
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
- DeployRubygem.new_deploy_rubygem.release
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here
@@ -1,75 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'git-version-bump'
4
-
5
- ::Gem::Specification.new do |s|
6
- s.name = 'deploy_rubygem'
7
- s.license = 'MIT'
8
- s.authors = ['Jimmy Provencher']
9
- s.email = ['jimbo_dragon@hotmail.com']
10
- s.homepage = 'https://github.com/JimboDragonGit/deploy_rubygem'
11
- s.summary = 'A auto chef bootstrapper and wrapper cookbook to deploy code and context'
12
- 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 ;)'
13
-
14
- s.version = "#{GVB.major_version}.#{GVB.minor_version}.#{GVB.patch_version}"
15
- s.date = GVB.date
16
-
17
- # all_files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
18
- # s.files = all_files.grep(%r!^(exe|libraries|rubocop)/|^.rubocop.yml$!)
19
- # code_folder = 'libraries/'
20
- # s.files = %w(README.md LICENSE bin/selfbootstrap libraries/selfbootstrap.rb ) + Dir.glob('libraries/**/*') # + Dir.glob('{bin,lib,certs,test}/**/*')
21
- # s.require_paths = [code_folder]
22
- # s.executables = %w(selfbootstrap)
23
- # s.bindir = 'exe'
24
-
25
- s.files = `git ls-files`.split("\n")
26
- s.executables = %w[
27
- deploy_rubygem
28
- prepare_workstation
29
- test_deploy_rubygem
30
- deploy_rubygem_manually
31
- deploy_jimbodragon
32
- ]
33
-
34
- # s.cert_chain = [File.expand_path('../jimbodragon/certs/public/jimbodragon.pem')]
35
- # s.signing_key = File.expand_path('../jimbodragon/certs/private/jimbodragon-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_rubygem/issues',
40
- 'changelog_uri' => 'https://github.com/JimboDragonGit/deploy_rubygem/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 = '>= 3.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-version-bump')
54
- s.add_runtime_dependency('rspec', '~> 3.13.0')
55
- s.add_runtime_dependency('rspec-support', '~> 3.13.0')
56
- s.add_runtime_dependency('rubocop-rake')
57
- s.add_runtime_dependency('rubocop-rspec')
58
-
59
- # s.add_runtime_dependency('deploy-context')
60
-
61
- # s.add_runtime_dependency('colorator', '~> 1.0')
62
- # s.add_runtime_dependency('em-websocket', '~> 0.5')
63
- # s.add_runtime_dependency('i18n', '~> 1.0')
64
- # s.add_runtime_dependency('jekyll-sass-converter', '>= 2.0', '< 4.0')
65
- # s.add_runtime_dependency('jekyll-watch', '~> 2.0')
66
- # s.add_runtime_dependency('kramdown', '~> 2.3', '>= 2.3.1')
67
- # s.add_runtime_dependency('kramdown-parser-gfm', '~> 1.0')
68
- # s.add_runtime_dependency('liquid', '~> 4.0')
69
- # s.add_runtime_dependency('mercenary', '>= 0.3.6', '< 0.5')
70
- # s.add_runtime_dependency('pathutil', '~> 0.9')
71
- # s.add_runtime_dependency('rouge', '>= 3.0', '< 5.0')
72
- # s.add_runtime_dependency('safe_yaml', '~> 1.0')
73
- # s.add_runtime_dependency('terminal-table', '>= 1.8', '< 4.0')
74
- # s.add_runtime_dependency('webrick', '~> 1.7')
75
- end
@@ -1,21 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # RSpec.describe 'Publishing itself' do
4
- # it "deploy itself" do
5
- # self_deploy = DeployRubygem.self_deploy
6
- # expect(self_deploy).not_to be nil
7
- # end
8
-
9
- # it "deploy jimbo_management_site" do
10
- # jimbo_management_site_deploy = DeployRubygem.deploy_jimbo_management_site
11
- # expect(jimbo_management_site_deploy).not_to be nil
12
- # end
13
-
14
- # it "has pre latest version publish" do
15
- # expect(`gem list -r deploy_rubygem`).to include("deploy_rubygem (#{Gem::Version.new("#{GVB.major_version}.#{GVB.minor_version - 1}.1")})")
16
- # end
17
-
18
- # it "has latest version publish" do
19
- # expect(`gem list -r deploy_rubygem`).not_to include("deploy_rubygem (#{GVB.version}})")
20
- # end
21
- # end
@@ -1,21 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # RSpec.describe 'testing with cookbook' do
4
- # it "create a test cookbook" do
5
- # change_repo = DeployRubygem.change_to_directory(DeployRubygem.chefrepo_path, 'git@github.com:JimboDragonGit/jimbodragon.git')
6
- # expect(change_repo).not_to be nil
7
- # expect(change_repo).to include DeployRubygem.chefrepo_path
8
- # end
9
-
10
- # it "Change to jimbo_management_site folder" do
11
- # change_repo = DeployRubygem.change_to_directory(DeployRubygem.jimbo_management_site_path, 'git@github.com:JimboDragonGit/jimbo_management_site.git')
12
- # expect(change_repo).not_to be nil
13
- # expect(change_repo).to include DeployRubygem.jimbo_management_site_path
14
- # end
15
-
16
- # it "Change to deploy_rubygem folder" do
17
- # change_repo = DeployRubygem.change_to_directory(DeployRubygem.deploy_rubygem_path, 'git@github.com:JimboDragonGit/deploy_rubygem.git')
18
- # expect(change_repo).not_to be nil
19
- # expect(change_repo).to include DeployRubygem.deploy_rubygem_path
20
- # end
21
- # end
@@ -1,50 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- RSpec.describe 'Get jimbo_management_site cookbook' do
4
- it 'should not be null' do
5
- expect(jimbo_management_site_cookbook).not_to be nil
6
- end
7
- it 'should be a Project' do
8
- expect(jimbo_management_site_cookbook).to be_kind_of(DeployRubygem::Project)
9
- end
10
- it 'should be a Cookbook' do
11
- expect(jimbo_management_site_cookbook).to be_kind_of(DeployRubygem::Cookbook)
12
- end
13
- %w[deploy].each do |method|
14
- it "should have method #{method}" do
15
- expect(jimbo_management_site_cookbook.methods.include?(method.to_sym)).to eq(true)
16
- end
17
- end
18
- end
19
-
20
- RSpec.describe 'Upload jimbo_management_site cookbook' do
21
- it 'should switch to cookbook folder' do
22
- switch_output = jimbo_management_site_cookbook.switch_to_cookbook
23
- expect(switch_output).to be_kind_of(String)
24
- expect(switch_output).to eq(jimbo_management_site_cookbook.path)
25
- end
26
- it 'should save progress' do
27
- expect(jimbo_management_site_cookbook.save_progress).to be true
28
- end
29
- it 'should upload cookbook' do
30
- upload_cookbook_output = jimbo_management_site_cookbook.upload_cookbook
31
- expect(upload_cookbook_output).to be_kind_of(Array)
32
- expect(upload_cookbook_output).to match(jimbo_management_site_cookbook.groups)
33
- end
34
- end
35
-
36
- RSpec.describe 'Test jimbo_management_site cookbook' do
37
- it 'should prepare test environment' do
38
- prepare_test_environment_output = jimbo_management_site_cookbook.prepare_test_environment
39
- expect(prepare_test_environment_output).to be_kind_of(Array)
40
- expect(prepare_test_environment_output).to match(jimbo_management_site_cookbook.kitchens)
41
- end
42
- it 'should verify' do
43
- verify_output = jimbo_management_site_cookbook.verify
44
- expect(verify_output).to be_kind_of(Array)
45
- expect(verify_output).to match(jimbo_management_site_cookbook.execute_profiles)
46
- end
47
- it 'should save progress again' do
48
- expect(jimbo_management_site_cookbook.save_progress).to be true
49
- end
50
- end
data/spec/spec_helper.rb DELETED
@@ -1,25 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'deploy_rubygem'
4
-
5
- RSpec.configure do |config|
6
- # Enable flags like --only-failures and --next-failure
7
- config.example_status_persistence_file_path = '.rspec_status'
8
-
9
- # Disable RSpec exposing methods globally on `Module` and `main`
10
- config.disable_monkey_patching!
11
-
12
- config.expect_with :rspec do |c|
13
- c.syntax = :expect
14
- end
15
- end
16
-
17
- def deploy_rubygem
18
- DeployRubygem.new_deploy_rubygem
19
- end
20
-
21
- def jimbo_management_site_cookbook
22
- deploy_rubygem.cookbooks.select do |cookbook|
23
- cookbook.cookbook_name.match? 'jimbo_management_site'
24
- end.first
25
- end
@@ -1,73 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- RSpec.describe deploy_rubygem.gvb_version do
4
- it 'has a version number' do
5
- expect(deploy_rubygem.gvb_version).not_to be nil
6
- expect(deploy_rubygem.gvb_version).to be_kind_of(DeployRubygem::Project::DeployVersion)
7
- end
8
-
9
- %w[major_version minor_version patch_version].each do |method_name|
10
- it "has the method #{method_name}" do
11
- expect(deploy_rubygem.gvb_version.send(method_name)).to be_kind_of(Integer)
12
- end
13
- end
14
- end
15
-
16
- RSpec.describe DeployRubygem do
17
- it 'has a version number' do
18
- expect(DeployRubygem::VERSION).not_to be nil
19
- end
20
-
21
- it 'has pre latest version publish' do
22
- project_version = deploy_rubygem.gvb_version
23
- maj_ver = project_version.major_version
24
- min_ver = project_version.minor_version
25
- version_to_check = "deploy_rubygem (#{Gem::Version.new("#{maj_ver}.#{min_ver - 1}.1")})"
26
- expect(`gem list -r deploy_rubygem`).to include(version_to_check)
27
- end
28
- end
29
-
30
- RSpec.describe "Testing #{DeployRubygem}" do
31
- it 'has a Project Name' do
32
- expect(deploy_rubygem.project_name).not_to be nil
33
- end
34
- it 'has Project Options' do
35
- expect(deploy_rubygem.project_options).not_to be nil
36
- end
37
- end
38
-
39
- RSpec.describe "Testing gem #{deploy_rubygem.project_name}" do
40
- it 'should not be null' do
41
- expect(deploy_rubygem).not_to be nil
42
- end
43
- it 'should be a Project' do
44
- expect(deploy_rubygem).to be_kind_of(DeployRubygem::Project)
45
- end
46
- it 'should be a Rubygem' do
47
- expect(deploy_rubygem).to be_kind_of(DeployRubygem::Rubygem)
48
- end
49
- it 'should get a Project Name' do
50
- expect(deploy_rubygem.project_name).to eq(DeployRubygem.project_name)
51
- end
52
- end
53
-
54
- RSpec.describe "Install #{deploy_rubygem.project_name}" do
55
- it 'Change to deploy_rubygem folder' do
56
- change_repo = deploy_rubygem.change_to_project_folder
57
- expect(change_repo).not_to be nil
58
- expect(Dir.pwd).to eq(deploy_rubygem.path)
59
- end
60
-
61
- it 'Change to Chef repo folder' do
62
- change_repo = deploy_rubygem.change_to_chefrepo
63
- expect(change_repo).not_to be nil
64
- expect(change_repo).to eq(deploy_rubygem.chefrepo_path)
65
- expect(Dir.pwd).to eq(deploy_rubygem.chefrepo_path)
66
- end
67
-
68
- it 'Should list his cookbooks dependencies' do
69
- cookbooks = deploy_rubygem.cookbooks
70
- expect(cookbooks).not_to be nil
71
- expect(cookbooks).to be_kind_of(Array)
72
- end
73
- end