release_manager 0.8.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/Gemfile.lock +1 -1
- data/README.md +3 -3
- data/lib/release_manager/git/utilites.rb +2 -0
- data/lib/release_manager/r10k_deployer.rb +1 -0
- data/lib/release_manager/release.rb +31 -25
- data/lib/release_manager/remote_release.rb +23 -17
- data/lib/release_manager/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e186490a7357d97daefeaf8337a6de1fb1f12dd
|
4
|
+
data.tar.gz: b9f2e85a0497c460847291524f598e151988b28c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93b5fdde39f5917395ad9743a91a41c6be41cc3845d2e01271980015af99c6f03ec940ad908c0a4c968159aaec22c86fa7f65f7d5882b9c377dfb3d13ede8813
|
7
|
+
data.tar.gz: 1624f3df2c269bbc2128c5d5afce001f0856f3581a11f55024e7ae6367b83e6291c21e2dbd55407f40952e2d4efda63fe44b15c78f13b90a3a6d92d921f55a79
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# Release Manager
|
2
2
|
|
3
|
+
## Unreleased
|
4
|
+
|
5
|
+
## 0.8.1
|
6
|
+
* Improves error handling when tags already exist
|
7
|
+
* Fixes #12 - deploy-r10k does not write a patch file
|
3
8
|
## 0.8.0
|
4
9
|
* Allows for creating sandboxes from different targets
|
5
10
|
* Allow for releasing one off patches with release-mod
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -308,11 +308,11 @@ uses the version in metadata.json file as a reference and increments to semver i
|
|
308
308
|
|
309
309
|
Follow the steps below to create a new patch release and deploy straight to production
|
310
310
|
|
311
|
-
1. Create a new sandbox based on the branch or tag you want to fix. `sandbox-create -s v0.5.0 -n patch_0.5.1`
|
311
|
+
1. Create a new sandbox based on the branch or tag you want to fix. `sandbox-create -s upstream/v0.5.0 -n patch_0.5.1`
|
312
312
|
2. cd ~/repos/r10k-control
|
313
313
|
3. Make your changes in that branch and update the changelog
|
314
|
-
4. Push your code to the remote Git repo and activate your CI pipeline (
|
315
|
-
5. Release the new version `release-mod -l patch -s patch_0.5.1` (creates tag v0.5.1)
|
314
|
+
4. Push your code to the remote Git repo and activate your CI pipeline (recommended)
|
315
|
+
5. Release the new version `release-mod -l patch -s patch_0.5.1` (creates tag v0.5.1 from the sandbox)
|
316
316
|
6. Deploy the patch release to production `deploy-r10k -s v0.5.1 -d production`
|
317
317
|
|
318
318
|
## Configuration Settings
|
@@ -255,8 +255,10 @@ module ReleaseManager
|
|
255
255
|
# @param [String] file - the path to the patch file you want to apply
|
256
256
|
def apply_patch(file)
|
257
257
|
# TODO: change this to rugged implementation
|
258
|
+
empty = File.read(file).length < 1
|
258
259
|
logger.info("Applying patch #{file}")
|
259
260
|
output = ''
|
261
|
+
logger.debug("The patch file is empty for some reason") if empty
|
260
262
|
Dir.chdir(path) do
|
261
263
|
output = `#{git_command} apply #{file} 2>&1`
|
262
264
|
end
|
@@ -99,6 +99,7 @@ class R10kDeployer
|
|
99
99
|
return control_repo.logger.info("nothing to commit or deploy") if diff.deltas.count < 1
|
100
100
|
Tempfile.open('git_patch') do |patchfile|
|
101
101
|
patchfile.write(diff.patch)
|
102
|
+
patchfile.rewind # allows us to read from the beginning of the file
|
102
103
|
control_repo.apply_patch(patchfile.path)
|
103
104
|
control_repo.add_all
|
104
105
|
end
|
@@ -108,33 +108,39 @@ class Release
|
|
108
108
|
# currently this must be done manually by a release manager
|
109
109
|
#
|
110
110
|
def release
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
111
|
+
begin
|
112
|
+
unless auto_release?
|
113
|
+
print "Have you merged your code? Did you fetch and rebase against the upstream? Want to continue (y/n)?: ".yellow
|
114
|
+
answer = gets.downcase.chomp
|
115
|
+
if answer == 'n'
|
116
|
+
return false
|
117
|
+
end
|
116
118
|
end
|
117
|
-
end
|
118
119
|
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
120
|
+
# updates the metadata.json file to the next version
|
121
|
+
bump
|
122
|
+
# updates the changelog to the next version based on the metadata file
|
123
|
+
id = bump_log
|
124
|
+
# tags the r10k-module with the version found in the metadata.json file
|
125
|
+
tag(id)
|
126
|
+
# pushes the updated code and tags to the upstream repo
|
127
|
+
if auto_release?
|
128
|
+
push
|
129
|
+
return
|
130
|
+
end
|
131
|
+
print "Ready to release version #{version} to #{puppet_module.source}\n and forever change history(y/n)?: ".yellow
|
132
|
+
answer = gets.downcase.chomp
|
133
|
+
if answer == 'y'
|
134
|
+
push
|
135
|
+
$?.success?
|
136
|
+
else
|
137
|
+
puts "Nah, forget it, this release wasn't that cool anyways.".yellow
|
138
|
+
false
|
139
|
+
end
|
140
|
+
rescue Rugged::TagError => e
|
141
|
+
logger.fatal(e.message)
|
142
|
+
logger.fatal("You might need to rebase your branch")
|
143
|
+
exit 1
|
138
144
|
end
|
139
145
|
end
|
140
146
|
|
@@ -9,25 +9,31 @@ class RemoteRelease < Release
|
|
9
9
|
# currently this must be done manually by a release manager
|
10
10
|
#
|
11
11
|
def release
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
12
|
+
begin
|
13
|
+
unless auto_release?
|
14
|
+
print "Have you merged your code? Did you fetch and rebase against the upstream? Want to continue (y/n)?: ".yellow
|
15
|
+
answer = gets.downcase.chomp
|
16
|
+
if answer == 'n'
|
17
|
+
return false
|
18
|
+
end
|
19
|
+
print "Ready to release version #{version.next} to #{puppet_module.source}\n and forever change history(y/n)?: ".yellow
|
20
|
+
answer = gets.downcase.chomp
|
21
|
+
if answer != 'y'
|
22
|
+
puts "Nah, forget it, this release wasn't that cool anyways.".yellow
|
23
|
+
return false
|
24
|
+
end
|
23
25
|
end
|
26
|
+
# updates the metadata.js file to the next version
|
27
|
+
bump
|
28
|
+
# updates the changelog to the next version based on the metadata file
|
29
|
+
id = bump_log
|
30
|
+
# tags the r10k-module with the version found in the metadata.json file
|
31
|
+
tag(id)
|
32
|
+
rescue Rugged::TagError => e
|
33
|
+
logger.fatal(e.message)
|
34
|
+
logger.fatal("You might need to rebase your branch")
|
35
|
+
exit 1
|
24
36
|
end
|
25
|
-
# updates the metadata.js file to the next version
|
26
|
-
bump
|
27
|
-
# updates the changelog to the next version based on the metadata file
|
28
|
-
id = bump_log
|
29
|
-
# tags the r10k-module with the version found in the metadata.json file
|
30
|
-
tag(id)
|
31
37
|
end
|
32
38
|
|
33
39
|
def run
|
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.8.
|
4
|
+
version: 0.8.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: 2017-12-
|
11
|
+
date: 2017-12-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gitlab
|