supermarket_sync 0.1.1 → 0.2.1

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: 52a518a7503723522c18fbb65db7766c9188728a8421b64a28dda5e3b65b2433
4
- data.tar.gz: 7bf193b9587237aed34ab1272114e4046da7dc7deab0d670a5075fcbca091d66
3
+ metadata.gz: 2143773eceb2c709194462cddbe7e86668103200914d3320ba484b44f49bfe41
4
+ data.tar.gz: a7f2c525fc4d4c4aa8e802cbcc5129f58677755c0dcf68a698932dac3c05cb6a
5
5
  SHA512:
6
- metadata.gz: 4d1b8edab2bf62739d39ea24a1b5b984043118548c54d3827a875316bacde7f347df17f463931ac026407069597599a665e161a918b86822d6008b3bd7f458b8
7
- data.tar.gz: 2a550526c4a2e07b7c185bc81bb92c57b571bab389612b69d7057322b95642d49541ca510bb15c18c96a1f00f66c6f214293d8da106ea983d544f0dbc746c70a
6
+ metadata.gz: 376808c3196ea284e269c1dcb7b03b8e95ab80e0e402d0d6c37ce363f4c18d89e10fa0e82ca7c835837bc7be2999f8aa9f242851b405d7307a76966af4a715c9
7
+ data.tar.gz: 74cc90b50981dce699e683545fc1c95fa6bb1541469c2bbe845191c3ef51762a5ef8a3b25f4a1a7ef589642f35405808f28a8892faa2ffc4d817895c719ac864
@@ -0,0 +1,36 @@
1
+ name: Ruby
2
+ on: [push]
3
+ jobs:
4
+ test:
5
+ name: Build
6
+ runs-on: ubuntu-latest
7
+ container: ruby:3.0
8
+ steps:
9
+ - name: Check out code
10
+ uses: actions/checkout@v2
11
+ with:
12
+ fetch-depth: 0
13
+
14
+ - name: Git Info
15
+ id: git
16
+ run: |
17
+ echo ::set-output name=SOURCE_NAME::${GITHUB_REF#refs/*/}
18
+ echo ::set-output name=SOURCE_BRANCH::${GITHUB_REF#refs/heads/}
19
+ echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/}
20
+
21
+ - name: Test
22
+ env:
23
+ ABC: '123'
24
+ run: |
25
+ gem install rubocop --no-document
26
+ rubocop
27
+
28
+ - name: Release
29
+ if: startsWith(github.ref, 'refs/tags/')
30
+ env:
31
+ ABC: '123'
32
+ run: |
33
+ gem install dpl --no-document
34
+ find . -type f -exec chmod o--w "{}" \;
35
+
36
+ - run: dpl --provider=rubygems --api-key=$RUBYGEMS_API_KEY --gem=supermarket_sync
data/.gitlab-ci.yml CHANGED
@@ -4,8 +4,8 @@ before_script:
4
4
  - gem install bundler --no-document
5
5
  - bundle install --jobs $(nproc) --path vendor/bundle
6
6
 
7
- test:Ruby 2.5:
8
- image: ruby:2.5
7
+ test:Ruby 3.0:
8
+ image: ruby:3.0
9
9
  cache:
10
10
  paths:
11
11
  - .bundle
@@ -13,12 +13,12 @@ test:Ruby 2.5:
13
13
  script:
14
14
  - bundle exec rubocop
15
15
  tags:
16
- - ruby
16
+ - docker
17
17
  except:
18
18
  - tags
19
19
 
20
- release:Ruby 2.5:
21
- image: ruby:2.5
20
+ release:Ruby 3.0:
21
+ image: ruby:3.0
22
22
  cache:
23
23
  paths:
24
24
  - .bundle
@@ -33,6 +33,6 @@ release:Ruby 2.5:
33
33
  paths:
34
34
  - ./*.gem
35
35
  tags:
36
- - ruby
36
+ - docker
37
37
  only:
38
38
  - tags
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- ruby-2.5.3
1
+ ruby-3.0.2
data/CHANGELOG.md CHANGED
@@ -2,12 +2,20 @@ SupermarketSync Changelog
2
2
  =========================
3
3
  This file is used to list changes made in each version of the `supermarket_sync` gem.
4
4
 
5
- v0.1.1 (2016-11-12)
5
+ v0.1.3 (2019-8-2)
6
+ -------------------
7
+ - Ignore cookbook category due to deprecation
8
+
9
+ v0.1.2 (2018-11-12)
10
+ -------------------
11
+ - Expose more configuration via environment variables
12
+
13
+ v0.1.1 (2018-11-12)
6
14
  -------------------
7
15
  - Fix for non-existing cookbooks
8
16
  - Rename function to avoid potential namespace collision
9
17
  - Add a read-only mode for testing purposes
10
18
 
11
- v0.1.0 (2016-11-09)
19
+ v0.1.0 (2018-11-09)
12
20
  -------------------
13
21
  - Initial Release
@@ -5,7 +5,7 @@
5
5
  #
6
6
  # The MIT License (MIT)
7
7
  #
8
- # Copyright:: 2018, Brian Dwyer - Broadridge Financial Solutions
8
+ # Copyright:: 2021, Brian Dwyer - Broadridge Financial Solutions
9
9
  #
10
10
 
11
11
  require 'mixlib/cli'
@@ -5,7 +5,7 @@
5
5
  #
6
6
  # The MIT License (MIT)
7
7
  #
8
- # Copyright:: 2018, Brian Dwyer - Broadridge Financial Solutions
8
+ # Copyright:: 2021, Brian Dwyer - Broadridge Financial Solutions
9
9
  #
10
10
 
11
11
  require 'supermarket_sync/helpers/configuration'
@@ -25,10 +25,10 @@ module SupermarketSync
25
25
  define_setting :author, 'Brian Dwyer - Broadridge Financial Services'
26
26
 
27
27
  # => Config File
28
- define_setting :config_file, File.join(root, 'config', 'config.json')
28
+ define_setting :config_file, ENV['SM_SYNC_CONFIG'] || File.join(root, 'config', 'config.json')
29
29
 
30
30
  # => Cookbooks File
31
- define_setting :cookbooks_file, File.join(root, 'config', 'cookbooks.json')
31
+ define_setting :cookbooks_file, ENV['SM_SYNC_COOKBOOKS'] || File.join(root, 'config', 'cookbooks.json')
32
32
 
33
33
  # => Supermarket Configuration
34
34
  define_setting :supermarkets, {}
@@ -5,7 +5,7 @@
5
5
  #
6
6
  # The MIT License (MIT)
7
7
  #
8
- # Copyright:: 2018, Brian Dwyer - Broadridge Financial Solutions
8
+ # Copyright:: 2021, Brian Dwyer - Broadridge Financial Solutions
9
9
  #
10
10
 
11
11
  require 'slack-notifier'
@@ -5,14 +5,14 @@
5
5
  #
6
6
  # The MIT License (MIT)
7
7
  #
8
- # Copyright:: 2018, Brian Dwyer - Broadridge Financial Solutions
8
+ # Copyright:: 2021, Brian Dwyer - Broadridge Financial Solutions
9
9
  #
10
10
 
11
11
  require 'chef/http/json_input'
12
12
  require 'chef/http/json_output'
13
13
  require 'chef/http/remote_request_id'
14
14
  require 'chef/http/simple_json'
15
- require 'chef/cookbook_site_streaming_uploader'
15
+ require 'chef/knife/core/cookbook_site_streaming_uploader'
16
16
  require 'mixlib/cli'
17
17
  require 'supermarket_sync/notifier'
18
18
 
@@ -67,7 +67,7 @@ module SupermarketSync
67
67
  tgz = src.streaming_request("/api/v1/cookbooks/#{cookbook}/versions/#{latest}/download")
68
68
 
69
69
  # => Upload the Cookbook
70
- upload(source_meta['category'], tgz) unless Config.read_only
70
+ upload('other', tgz) unless Config.read_only
71
71
 
72
72
  # => Remove the Tempfile
73
73
  begin
@@ -136,7 +136,7 @@ module SupermarketSync
136
136
  private def upload(category, tarball) # rubocop: disable AbcSize, MethodLength
137
137
  uri = URI.parse(dest.url)
138
138
  uri.path = '/api/v1/cookbooks'
139
- resp = Chef::CookbookSiteStreamingUploader.post(
139
+ resp = Chef::Knife::Core::CookbookSiteStreamingUploader.post(
140
140
  uri.to_s, Chef::Config[:node_name], Chef::Config[:client_key],
141
141
  tarball: ::File.open(tarball),
142
142
  cookbook: Chef::JSONCompat.to_json(category: category)
@@ -5,7 +5,7 @@
5
5
  #
6
6
  # The MIT License (MIT)
7
7
  #
8
- # Copyright:: 2018, Brian Dwyer - Broadridge Financial Solutions
8
+ # Copyright:: 2021, Brian Dwyer - Broadridge Financial Solutions
9
9
  #
10
10
 
11
11
  require 'json'
@@ -1,3 +1,3 @@
1
1
  module SupermarketSync
2
- VERSION = '0.1.1'.freeze
2
+ VERSION = '0.2.1'.freeze
3
3
  end
@@ -28,12 +28,13 @@ Gem::Specification.new do |spec|
28
28
  spec.require_paths = ['lib']
29
29
 
30
30
  # => Dependencies
31
- spec.add_runtime_dependency 'chef', '> 12.19.36'
32
- spec.add_runtime_dependency 'slack-notifier', '~> 2.3.2'
31
+ spec.add_runtime_dependency 'knife', '>= 17.1', '< 18.0'
32
+ spec.add_runtime_dependency 'mixlib-cli', '>= 2.1.1', '< 3.0'
33
+ spec.add_runtime_dependency 'slack-notifier', '~> 2.4.0'
33
34
 
34
35
  # => Development Dependencies
35
- spec.add_development_dependency 'bundler', '~> 1.12'
36
- spec.add_development_dependency 'rake', '~> 10.0'
36
+ spec.add_development_dependency 'bundler', '~> 2.0'
37
+ spec.add_development_dependency 'rake', '>= 12.3.3'
37
38
  spec.add_development_dependency 'rspec', '~> 3.0'
38
39
  spec.add_development_dependency 'rubocop', '= 0.55'
39
40
  end
metadata CHANGED
@@ -1,71 +1,97 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: supermarket_sync
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Dwyer
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-11-12 00:00:00.000000000 Z
11
+ date: 2021-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: chef
14
+ name: knife
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 12.19.36
19
+ version: '17.1'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '18.0'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - ">"
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: '17.1'
30
+ - - "<"
25
31
  - !ruby/object:Gem::Version
26
- version: 12.19.36
32
+ version: '18.0'
33
+ - !ruby/object:Gem::Dependency
34
+ name: mixlib-cli
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: 2.1.1
40
+ - - "<"
41
+ - !ruby/object:Gem::Version
42
+ version: '3.0'
43
+ type: :runtime
44
+ prerelease: false
45
+ version_requirements: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: 2.1.1
50
+ - - "<"
51
+ - !ruby/object:Gem::Version
52
+ version: '3.0'
27
53
  - !ruby/object:Gem::Dependency
28
54
  name: slack-notifier
29
55
  requirement: !ruby/object:Gem::Requirement
30
56
  requirements:
31
57
  - - "~>"
32
58
  - !ruby/object:Gem::Version
33
- version: 2.3.2
59
+ version: 2.4.0
34
60
  type: :runtime
35
61
  prerelease: false
36
62
  version_requirements: !ruby/object:Gem::Requirement
37
63
  requirements:
38
64
  - - "~>"
39
65
  - !ruby/object:Gem::Version
40
- version: 2.3.2
66
+ version: 2.4.0
41
67
  - !ruby/object:Gem::Dependency
42
68
  name: bundler
43
69
  requirement: !ruby/object:Gem::Requirement
44
70
  requirements:
45
71
  - - "~>"
46
72
  - !ruby/object:Gem::Version
47
- version: '1.12'
73
+ version: '2.0'
48
74
  type: :development
49
75
  prerelease: false
50
76
  version_requirements: !ruby/object:Gem::Requirement
51
77
  requirements:
52
78
  - - "~>"
53
79
  - !ruby/object:Gem::Version
54
- version: '1.12'
80
+ version: '2.0'
55
81
  - !ruby/object:Gem::Dependency
56
82
  name: rake
57
83
  requirement: !ruby/object:Gem::Requirement
58
84
  requirements:
59
- - - "~>"
85
+ - - ">="
60
86
  - !ruby/object:Gem::Version
61
- version: '10.0'
87
+ version: 12.3.3
62
88
  type: :development
63
89
  prerelease: false
64
90
  version_requirements: !ruby/object:Gem::Requirement
65
91
  requirements:
66
- - - "~>"
92
+ - - ">="
67
93
  - !ruby/object:Gem::Version
68
- version: '10.0'
94
+ version: 12.3.3
69
95
  - !ruby/object:Gem::Dependency
70
96
  name: rspec
71
97
  requirement: !ruby/object:Gem::Requirement
@@ -94,7 +120,7 @@ dependencies:
94
120
  - - '='
95
121
  - !ruby/object:Gem::Version
96
122
  version: '0.55'
97
- description:
123
+ description:
98
124
  email:
99
125
  - chef@broadridge.com
100
126
  executables:
@@ -102,6 +128,7 @@ executables:
102
128
  extensions: []
103
129
  extra_rdoc_files: []
104
130
  files:
131
+ - ".github/workflows/ruby.yml"
105
132
  - ".gitignore"
106
133
  - ".gitlab-ci.yml"
107
134
  - ".rubocop.yml"
@@ -131,7 +158,7 @@ licenses:
131
158
  - MIT
132
159
  metadata:
133
160
  allowed_push_host: https://rubygems.org
134
- post_install_message:
161
+ post_install_message:
135
162
  rdoc_options: []
136
163
  require_paths:
137
164
  - lib
@@ -146,9 +173,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
146
173
  - !ruby/object:Gem::Version
147
174
  version: '0'
148
175
  requirements: []
149
- rubyforge_project:
150
- rubygems_version: 2.7.8
151
- signing_key:
176
+ rubygems_version: 3.2.22
177
+ signing_key:
152
178
  specification_version: 4
153
179
  summary: Utility to synchronize Chef Supermarkets
154
180
  test_files: []