release_manager 0.9.0 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +3 -0
- data/Gemfile.lock +2 -2
- data/README.md +29 -0
- data/lib/release_manager/changelog.rb +18 -0
- data/lib/release_manager/git/credentials.rb +0 -1
- data/lib/release_manager/puppet_module.rb +4 -3
- data/lib/release_manager/release.rb +12 -3
- data/lib/release_manager/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 40f987ae556eeffe3ab2fca6e4aba94cc54ca9660ce44c7f1780827a1b2cab74
|
4
|
+
data.tar.gz: 6e0612667bd4a50e5cd332d6825ae44415e1080dd1d7abeafc6fcad41847cd23
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9466b5af4b5be8e33b696f89e5601684226c4a7585ffcfd53ae990674793d539304b3fcdfda81450a7067bebed0386c8b42f2b6a3a6a3b25379404f3751c1560
|
7
|
+
data.tar.gz: a04bbe4f4b2783f529ee58793ccf88e9de8c2fed7ef73d4cc6884d40d60e09e442ad0c4111fe56a75431af6a7b53f154e83f566e72f65356033a3e487a532175
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -407,6 +407,35 @@ ssh-add
|
|
407
407
|
|
408
408
|
```
|
409
409
|
|
410
|
+
### Unable to exchange encryption keys
|
411
|
+
If you see an error message related to `Unable to exchange encryption keys` you may be dealing with an issue on your git server openssh
|
412
|
+
does not support the key exchange that libssh2 supports. Libssh2 is used by release_manager so it is important they can negotiate on the same algorithm.
|
413
|
+
|
414
|
+
There are two possible fixes for this.
|
415
|
+
|
416
|
+
* Update libssh2 to 1.7.x+
|
417
|
+
|
418
|
+
You can grab the libssh2 library on your puppetserver with r10k should you not have access to libssh2-1.7.0+
|
419
|
+
|
420
|
+
`cp /opt/puppetlabs/server/apps/r10k/lib/libssh2.so.1.0.1 /usr/lib64/libssh2.so.1.0.1`
|
421
|
+
|
422
|
+
Note: you will actually want to copy the the library whereever release_manager is used. Additionally you need to recompile
|
423
|
+
the rugged gem, only after updating libssh2 in /usr/lib64
|
424
|
+
|
425
|
+
`gem uninstall rugged && gem install rugged `
|
426
|
+
|
427
|
+
|
428
|
+
If you don't want to update libssh2 you should add support more more algorithms on the git server.
|
429
|
+
|
430
|
+
|
431
|
+
```
|
432
|
+
# /etc/ssh/sshd_config
|
433
|
+
|
434
|
+
KexAlgorithms hmac-sha2-512
|
435
|
+
```
|
436
|
+
|
437
|
+
Note: you should have more algorithms as that is an example only.
|
438
|
+
|
410
439
|
## Development
|
411
440
|
|
412
441
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
@@ -35,6 +35,7 @@ class Changelog < WorkflowAction
|
|
35
35
|
@root_dir
|
36
36
|
end
|
37
37
|
|
38
|
+
# Create the changelog entries and commit
|
38
39
|
# @param remote [Boolean] - if the commit is a remote git on the vcs server
|
39
40
|
# @return [String] - sha of the commit
|
40
41
|
def run(remote = false, branch = 'master')
|
@@ -79,6 +80,23 @@ class Changelog < WorkflowAction
|
|
79
80
|
!!changelog_lines.each_index.find {|index| changelog_lines[index] =~ /\A\s*\#{2}\s*Version #{version}/i }
|
80
81
|
end
|
81
82
|
|
83
|
+
# @return [Array] - array of lines of the unreleased content, text between unreleased and next version
|
84
|
+
def get_unreleased_content
|
85
|
+
unreleased_index
|
86
|
+
start_content = changelog_lines.slice((unreleased_index + 1), changelog_lines.count)
|
87
|
+
start_content.slice_when {|a,b| b.downcase.start_with?('## version') }.map {|d| d}.first
|
88
|
+
end
|
89
|
+
|
90
|
+
# @return [Array] - array of lines of the specified version content, text between specified version and next version
|
91
|
+
# @param [String] - the version of content you want
|
92
|
+
# @note - returns empty string if version is not found
|
93
|
+
def get_version_content(version)
|
94
|
+
start_index = changelog_lines.find_index {|line| line.downcase.include?("version #{version}") }
|
95
|
+
return nil unless start_index
|
96
|
+
start_content = changelog_lines.slice((start_index + 1), changelog_lines.count)
|
97
|
+
start_content.slice_when {|a,b| b.downcase.start_with?('## version') }.map {|d| d}.first
|
98
|
+
end
|
99
|
+
|
82
100
|
# @returns [Array[String]] - inserts the version header in the change log and returns the entire array of lines
|
83
101
|
def update_unreleased
|
84
102
|
time = Time.now.strftime("%B %d, %Y")
|
@@ -74,7 +74,6 @@ module ReleaseManager
|
|
74
74
|
# this method does currently now work
|
75
75
|
def ssh_key_credentials(url = nil)
|
76
76
|
logger.error("Must use ssh-agent, please run ssh-agent zsh, then ssh-add to load your ssh key")
|
77
|
-
exit 1
|
78
77
|
unless File.readable?(global_private_key)
|
79
78
|
raise Exception.new("Unable to use SSH key auth for %{url}: private key %{private_key} is missing or unreadable" % {url: url.inspect, private_key: global_private_key.inspect} )
|
80
79
|
end
|
@@ -140,12 +140,13 @@ class PuppetModule < WorkflowAction
|
|
140
140
|
|
141
141
|
# @param remote [Boolean] - create the tag remotely using the remote VCS
|
142
142
|
# @param id [String] - the commit id to tag to
|
143
|
-
|
143
|
+
# @param remote [Boolean] - use the vcs adapter instead of local tag
|
144
|
+
# @param release_notes [Boolean] - add release notes to the tag when remote is true
|
145
|
+
def tag_module(remote = false, id = nil, release_notes = nil)
|
144
146
|
id ||= repo.head.target_id
|
145
147
|
if remote
|
146
|
-
# TODO add release_notes as the last argument, currently nil
|
147
148
|
# where we get the latest from the changelog
|
148
|
-
create_tag(source, "v#{version}", id, "v#{version}",
|
149
|
+
create_tag(source, "v#{version}", id, "v#{version}", release_notes)
|
149
150
|
else
|
150
151
|
create_local_tag("v#{version}", id)
|
151
152
|
end
|
@@ -34,12 +34,18 @@ class Release
|
|
34
34
|
puppet_module.next_version(level)
|
35
35
|
end
|
36
36
|
|
37
|
+
def release_notes
|
38
|
+
notes = changelog.get_version_content(version) || changelog.get_unreleased_content || []
|
39
|
+
notes.join(" ")
|
40
|
+
end
|
41
|
+
|
42
|
+
# @param id [String] - the commit id to tag to
|
37
43
|
def tag(id)
|
38
44
|
if dry_run?
|
39
45
|
logger.info "Would have just tagged the module to #{version}"
|
40
46
|
return
|
41
47
|
end
|
42
|
-
puppet_module.tag_module(options[:remote], id)
|
48
|
+
puppet_module.tag_module(options[:remote], id, release_notes)
|
43
49
|
end
|
44
50
|
|
45
51
|
def bump
|
@@ -55,14 +61,17 @@ class Release
|
|
55
61
|
puppet_module.commit_metadata(options[:remote])
|
56
62
|
end
|
57
63
|
|
64
|
+
def changelog
|
65
|
+
@changelog ||= Changelog.new(puppet_module.path, version, {:commit => true})
|
66
|
+
end
|
67
|
+
|
58
68
|
# @return [String] - sha of the commit
|
59
69
|
def bump_log
|
60
70
|
if dry_run?
|
61
71
|
logger.info "Would have just bumped the CHANGELOG to version #{version}"
|
62
72
|
return
|
63
73
|
end
|
64
|
-
|
65
|
-
log.run(options[:remote], puppet_module.src_branch)
|
74
|
+
changelog.run(options[:remote], puppet_module.src_branch)
|
66
75
|
end
|
67
76
|
|
68
77
|
# @param id [String] - a ref spec to push
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: release_manager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Corey Osman
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-07-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gitlab
|
@@ -200,7 +200,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
200
200
|
version: '0'
|
201
201
|
requirements: []
|
202
202
|
rubyforge_project:
|
203
|
-
rubygems_version: 2.
|
203
|
+
rubygems_version: 2.7.7
|
204
204
|
signing_key:
|
205
205
|
specification_version: 4
|
206
206
|
summary: Release tools for puppet code
|