community_cookbook_releaser 0.1.3 → 1.0.0
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 +4 -4
- data/README.md +15 -0
- data/bin/ccr +12 -9
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fbc1dc8fc24f108e9313d6661dd578b7d8c2e27c
|
4
|
+
data.tar.gz: 66bec6a22daf9bb161ae7cc543eaeb161d27796e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d975764baa561b80148ebd4e7c6002ae421c6690d13ac704e9f952ec94c2206d59fa870248c47e286d46d186bbb29124ad0040949ab000b1e10c9f8ef1d646b
|
7
|
+
data.tar.gz: f851913282c10bea43114fdc121446afee3ce0fa7171781b185af8c908afb026b3bc0d5f3411acff1649a0b2e940200798103e9b1ca1d7505162fd589d3f011d
|
data/README.md
CHANGED
@@ -1,2 +1,17 @@
|
|
1
1
|
# community_cookbook_releaser
|
2
2
|
A simple script to aid in version bumps and changelog generation for Chef managed community cookbooks
|
3
|
+
|
4
|
+
## Usage
|
5
|
+
|
6
|
+
Create a CHANGELOG.md in the current cookbook directory that conforms to the Chef Cookbook community standard. It should contain:
|
7
|
+
|
8
|
+
> This file is used to list changes made in each version of the X cookbook
|
9
|
+
|
10
|
+
Create a `~/.ccr_config.yml` with the following content:
|
11
|
+
|
12
|
+
```yaml
|
13
|
+
token: GITHUB_PERSONAL_ACCESS_TOKEN
|
14
|
+
github_organization: YOUR_GITHUB_USER_OR_ORG
|
15
|
+
```
|
16
|
+
|
17
|
+
Replace the values as appropriate. The access token needs to have `repo:public_repo` if it is public/open source or `repo:all` if it is private. The github organization will default to `chef-cookbooks` if it is not specified.
|
data/bin/ccr
CHANGED
@@ -33,14 +33,20 @@ end
|
|
33
33
|
def parse_config
|
34
34
|
file_or_error('~/.ccr_config.yml')
|
35
35
|
|
36
|
-
|
36
|
+
yconfig = YAML.load_file(File.expand_path('~/.ccr_config.yml'))
|
37
|
+
yconfig['github_organization'] ||= 'chef-cookbooks'
|
37
38
|
|
38
|
-
unless
|
39
|
+
unless yconfig['token']
|
39
40
|
puts_red("~/.ccr_config.yml does not contain a 'token' value. Cannot continue without a Github token!")
|
40
41
|
exit 1
|
41
42
|
end
|
42
43
|
|
43
|
-
|
44
|
+
yconfig
|
45
|
+
end
|
46
|
+
|
47
|
+
def config
|
48
|
+
@config ||= parse_config
|
49
|
+
@config
|
44
50
|
end
|
45
51
|
|
46
52
|
def bump_version(old_version)
|
@@ -94,11 +100,11 @@ def write_updated_changelog(new_version)
|
|
94
100
|
end
|
95
101
|
|
96
102
|
def changes_since_last_tag
|
97
|
-
client = Octokit::Client.new(access_token:
|
103
|
+
client = Octokit::Client.new(access_token: config['token'])
|
98
104
|
Octokit.auto_paginate = true
|
99
105
|
cb_name = File.split(Dir.getwd)[-1]
|
100
|
-
last_tag_sha = client.tags("
|
101
|
-
commit_data = client.compare("
|
106
|
+
last_tag_sha = client.tags("#{config['github_organization']}/#{cb_name}")[0][:commit][:sha]
|
107
|
+
commit_data = client.compare("#{config['github_organization']}/#{cb_name}", last_tag_sha, 'master')
|
102
108
|
commit_messages = []
|
103
109
|
commit_data['commits'].each do |commit|
|
104
110
|
msg = commit['commit']['message'].split("\n")[0] # get just the commit title not the entire thing
|
@@ -114,9 +120,6 @@ puts "\e[3mA simple script to aid in version bumps and changelog generation for
|
|
114
120
|
# make sure the world of cookbooks looks like we're assuming
|
115
121
|
fail_if_cb_files
|
116
122
|
|
117
|
-
# load the YAML config
|
118
|
-
@config = parse_config
|
119
|
-
|
120
123
|
new_cookbook_version = prompted_new_version
|
121
124
|
update_metadata_version(current_metadata_version, new_cookbook_version)
|
122
125
|
write_updated_changelog(new_cookbook_version)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: community_cookbook_releaser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Smith
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-10-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: octokit
|
@@ -36,7 +36,7 @@ files:
|
|
36
36
|
- LICENSE
|
37
37
|
- README.md
|
38
38
|
- bin/ccr
|
39
|
-
homepage:
|
39
|
+
homepage: https://www.chef.io
|
40
40
|
licenses:
|
41
41
|
- Apache-2.0
|
42
42
|
metadata: {}
|
@@ -56,7 +56,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
56
56
|
version: '0'
|
57
57
|
requirements: []
|
58
58
|
rubyforge_project:
|
59
|
-
rubygems_version: 2.6.
|
59
|
+
rubygems_version: 2.6.13
|
60
60
|
signing_key:
|
61
61
|
specification_version: 4
|
62
62
|
summary: A simple script in gem form for releasing chef managed community cookbooks.
|