cookbook-release 1.6.0 → 1.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +15 -0
- data/.github/workflows/release.yml +18 -0
- data/README.md +1 -0
- data/Rakefile +6 -0
- data/cookbook-release.gemspec +1 -1
- data/lib/cookbook-release/git-utilities.rb +1 -0
- data/lib/cookbook-release/release.rb +2 -1
- data/lib/cookbook-release/supermarket.rb +4 -4
- data/lib/cookbook-release.rb +1 -0
- data/spec/release_spec.rb +2 -1
- metadata +6 -6
- data/.travis.yml +0 -12
- data/Rakefile.rb +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7538788e3e44d58e55dfe48772447e2a3bb907ae4b2d4cff09fcafc54c824335
|
4
|
+
data.tar.gz: 43b8f4c6cc08721f3afc8cbf1c49252480d23ce504d2ab3694c158af2a7f9600
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab64808c6d9ea7a0355e03e3caf20597786f61c29f3606ca57bbf2228c9aa4b674b02a7b133bb094b0c1cf493ad63083cbb42384ae180f88216b7e6d527a1614
|
7
|
+
data.tar.gz: 47de72ef77bdc293efffea2617868e40379ac24cd5b160d283730427ff71ba54560fd72f636f9b31b81e896f1b3d762170a9957c40923485e5ad00035cc061b2
|
@@ -0,0 +1,15 @@
|
|
1
|
+
name: Tests
|
2
|
+
on: [push, pull_request]
|
3
|
+
jobs:
|
4
|
+
test:
|
5
|
+
runs-on: ubuntu-latest
|
6
|
+
strategy:
|
7
|
+
matrix:
|
8
|
+
ruby-version: ['2.5', '2.7']
|
9
|
+
steps:
|
10
|
+
- uses: actions/checkout@v2
|
11
|
+
- uses: ruby/setup-ruby@v1
|
12
|
+
with:
|
13
|
+
ruby-version: ${{ matrix.ruby-version }}
|
14
|
+
bundler-cache: true
|
15
|
+
- run: bundle exec rake
|
@@ -0,0 +1,18 @@
|
|
1
|
+
name: Release
|
2
|
+
on:
|
3
|
+
push:
|
4
|
+
tags: [ '*' ]
|
5
|
+
jobs:
|
6
|
+
release:
|
7
|
+
runs-on: ubuntu-latest
|
8
|
+
steps:
|
9
|
+
- uses: actions/checkout@v2
|
10
|
+
- uses: ruby/setup-ruby@v1
|
11
|
+
with:
|
12
|
+
ruby-version: 2.7
|
13
|
+
- run: |
|
14
|
+
install -D -m 600 <(echo -e "---\n:rubygems_api_key: ${RUBYGEMS_API_KEY}") $HOME/.gem/credentials
|
15
|
+
gem build *.gemspec
|
16
|
+
gem push *.gem
|
17
|
+
env:
|
18
|
+
RUBYGEMS_API_KEY: ${{secrets.RUBYGEMS_API_KEY}}
|
data/README.md
CHANGED
@@ -63,6 +63,7 @@ Optional environment variables:
|
|
63
63
|
|
64
64
|
```
|
65
65
|
export COOKBOOK_CATEGORY="Other" # defaults to Other
|
66
|
+
export SKIP_COOKOOK_UPLOAD=true #Just prepare release and push tag to git, but don't upload
|
66
67
|
```
|
67
68
|
|
68
69
|
Note: this setup is intended to be used in a CI system such as jenkins or travis.
|
data/Rakefile
ADDED
data/cookbook-release.gemspec
CHANGED
@@ -6,7 +6,7 @@ require 'English'
|
|
6
6
|
|
7
7
|
Gem::Specification.new do |spec|
|
8
8
|
spec.name = 'cookbook-release'
|
9
|
-
spec.version = '1.
|
9
|
+
spec.version = '1.8.0'
|
10
10
|
spec.authors = ['Grégoire Seux']
|
11
11
|
spec.email = 'g.seux@criteo.com'
|
12
12
|
spec.summary = 'Provide primitives (and rake tasks) to release a cookbook'
|
@@ -34,6 +34,7 @@ module CookbookRelease
|
|
34
34
|
def initialize(git, opts={})
|
35
35
|
@git = git
|
36
36
|
@no_prompt = opts[:no_prompt]
|
37
|
+
@skip_upload = opts[:skip_upload]
|
37
38
|
@git.no_prompt = @no_prompt
|
38
39
|
@category = opts[:category] || 'Other'
|
39
40
|
end
|
@@ -108,7 +109,7 @@ module CookbookRelease
|
|
108
109
|
exit 1 unless agreed
|
109
110
|
git.push_tag(new_version)
|
110
111
|
supermarket = Supermarket.new
|
111
|
-
supermarket.publish_ck(@category)
|
112
|
+
supermarket.publish_ck(@category, git.sub_dir) unless @skip_upload
|
112
113
|
rescue
|
113
114
|
puts HighLine.color("Release aborted, you have to reset to previous state manually", :red)
|
114
115
|
puts ":use with care: #{git.reset_command(new_version)}"
|
@@ -8,7 +8,7 @@ require 'json'
|
|
8
8
|
module CookbookRelease
|
9
9
|
class Supermarket
|
10
10
|
|
11
|
-
# This code is adapted from "knife cookbook share" and travis dpl provider
|
11
|
+
# This code is adapted from "knife cookbook share" and travis dpl provider
|
12
12
|
# for supermarket.
|
13
13
|
|
14
14
|
def initialize(opts={})
|
@@ -20,11 +20,11 @@ module CookbookRelease
|
|
20
20
|
|
21
21
|
include ::Chef::Mixin::ShellOut
|
22
22
|
|
23
|
-
def publish_ck(category)
|
24
|
-
ck = ::Chef::Cookbook::CookbookVersionLoader.new('.')
|
23
|
+
def publish_ck(category, path = nil)
|
24
|
+
ck = ::Chef::Cookbook::CookbookVersionLoader.new(path || '.')
|
25
25
|
ck.load!
|
26
26
|
cookbook = ck.cookbook_version
|
27
|
-
# we have to provide a rest option otherwise it will try to load a
|
27
|
+
# we have to provide a rest option otherwise it will try to load a
|
28
28
|
# client.pem key
|
29
29
|
::Chef::CookbookUploader.new(cookbook, rest: 'fake_rest').validate_cookbooks
|
30
30
|
|
data/lib/cookbook-release.rb
CHANGED
data/spec/release_spec.rb
CHANGED
@@ -36,12 +36,13 @@ describe Release do
|
|
36
36
|
:push_tag => true,
|
37
37
|
)
|
38
38
|
allow(git).to receive(:no_prompt=)
|
39
|
+
allow(git).to receive(:sub_dir).and_return(nil)
|
39
40
|
release = Release.new(git, no_prompt: true)
|
40
41
|
|
41
42
|
supermarket = double('supermarket')
|
42
43
|
expect(CookbookRelease::Supermarket).to receive(:new).and_return(supermarket)
|
43
44
|
|
44
|
-
expect(supermarket).to receive(:publish_ck).with('Other')
|
45
|
+
expect(supermarket).to receive(:publish_ck).with('Other', nil)
|
45
46
|
release.release!
|
46
47
|
end
|
47
48
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cookbook-release
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Grégoire Seux
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-05-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: semantic
|
@@ -162,12 +162,13 @@ executables: []
|
|
162
162
|
extensions: []
|
163
163
|
extra_rdoc_files: []
|
164
164
|
files:
|
165
|
+
- ".github/workflows/ci.yml"
|
166
|
+
- ".github/workflows/release.yml"
|
165
167
|
- ".gitignore"
|
166
|
-
- ".travis.yml"
|
167
168
|
- Gemfile
|
168
169
|
- LICENSE.txt
|
169
170
|
- README.md
|
170
|
-
- Rakefile
|
171
|
+
- Rakefile
|
171
172
|
- cookbook-release.gemspec
|
172
173
|
- lib/cookbook-release.rb
|
173
174
|
- lib/cookbook-release/changelog.rb
|
@@ -200,8 +201,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
200
201
|
- !ruby/object:Gem::Version
|
201
202
|
version: '0'
|
202
203
|
requirements: []
|
203
|
-
|
204
|
-
rubygems_version: 2.7.6.2
|
204
|
+
rubygems_version: 3.1.6
|
205
205
|
signing_key:
|
206
206
|
specification_version: 4
|
207
207
|
summary: Provide primitives (and rake tasks) to release a cookbook
|
data/.travis.yml
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
rvm:
|
3
|
-
- 2.4.0
|
4
|
-
deploy:
|
5
|
-
provider: rubygems
|
6
|
-
api_key:
|
7
|
-
secure: ylfB0GIaZxPfZ6/dSJIPujfSt3vxqVFg16lqTBq/2AAZ0qwKTZi9qeM/QZDLMX28vCXmTsYxHGepmyvv0PvJaKvy7E6YBzIKz1Y1vsEZFeAFrgIQq9cDvc4wIX2eFjI7N1ChyaRgi+YYK4BSVfKjYqGBfXk5Wyh7uqNEuWE7FzABV+RxXoHcNi+AhYkCX3NF80qNukXRtiB7XTQj6CP4Wd+Dm25iOUwx8/zNMce8Z8V3j2ysvR4Vtm/soDsr/+Z+27wIdP0VqwElV1FxtR9km8MIJhmzSsnzcvgqJpRmMvO6HLZFzwqnLBzCoPYJqm3K+uQSSfll5LbaNtixlBzIusgtGgm1UjQy1YDGkPexJd5K5CuC/LW78Y7Zrl3CeT34RDlICoztEjhJxFry3EvFxPT03lVQx5z5Fc55/u0hy3mBCiHbxHxAPJLMOtehfv35bzOS7Jv3+otBm/8jn9dXO2pJJdwxL9W2wrzljWkly4yemwceMvtMYf+xnf1zdTnMYoqkYGGl0KutbFL69w78w7BwTFQIhcJOO+g27C6V8vHtqU0U5JOgE/QNg3yWhzhQjgCpzQhmuO+Bcs3Jq2T/OcqTfwM6gufNe+Gq2TdEfeH5Y0WcRtTKJBVVQ4XWFtgONE1C1hNBFLyh7GNZDQQVYBT3c/MXeV5Q++rVJYOdSrw=
|
8
|
-
gem: cookbook-release
|
9
|
-
on:
|
10
|
-
tags: true
|
11
|
-
repo: criteo/cookbook-release
|
12
|
-
skip_cleanup: 'true'
|