gitscape 1.5.7 → 1.6.1
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/gitscape +2 -0
- data/lib/gitscape/base.rb +23 -3
- data/lib/gitscape/version.rb +1 -1
- metadata +4 -4
data/bin/gitscape
CHANGED
data/lib/gitscape/base.rb
CHANGED
@@ -81,7 +81,7 @@ class Gitscape::Base
|
|
81
81
|
puts `git checkout live`
|
82
82
|
puts `git pull origin`
|
83
83
|
|
84
|
-
if hotfix_branch.length == 0
|
84
|
+
if hotfix_branch.to_s.length == 0
|
85
85
|
exception_message = "*** Improper Usage ***\nExpected Usage: hotfix_start <hotfix_name> [--[no-]push]"
|
86
86
|
raise exception_message
|
87
87
|
end
|
@@ -93,11 +93,11 @@ class Gitscape::Base
|
|
93
93
|
puts `git push origin #{hotfix_branch}` if options[:push]
|
94
94
|
end
|
95
95
|
|
96
|
-
def hotfix_finish hotfix_branch=nil, options={:env_depth=>:staging, :push=>true, :update_env=>
|
96
|
+
def hotfix_finish hotfix_branch=nil, options={:env_depth=>:staging, :push=>true, :update_env=>false}
|
97
97
|
# option defaults
|
98
98
|
options[:env_depth] = :staging if options[:env_depth].nil?
|
99
99
|
options[:push] = true if options[:push].nil?
|
100
|
-
options[:update_env] =
|
100
|
+
options[:update_env] = false if options[:update_env].nil?
|
101
101
|
|
102
102
|
usage_string = "expected usage: hotfix_finish [<hotfix_branch>]
|
103
103
|
hotfix_branch: the name of the hotfix branch to finish.
|
@@ -292,6 +292,26 @@ class Gitscape::Base
|
|
292
292
|
puts `git push origin master`
|
293
293
|
end
|
294
294
|
end
|
295
|
+
|
296
|
+
def tag_cleanup options={:push => true}
|
297
|
+
# Handle default options
|
298
|
+
options[:push] = true if options[:push].nil?
|
299
|
+
|
300
|
+
# Do a fetch in order to ensure we have all the latest tags
|
301
|
+
`git fetch`
|
302
|
+
|
303
|
+
# Select which tags to keep.
|
304
|
+
# We currently keep tags which fulfill any of the following
|
305
|
+
# 1. starts with 'service/'
|
306
|
+
# 2. starts with 'rollback-to/' or 'live/', and has an iteration number >= the live_iteration number - 3
|
307
|
+
tags = `git tag`.split "\n"
|
308
|
+
tags_to_delete = tags.select { |tag| !(!/^service\//.match(tag).nil? || /^(?:live|rollback-to)\/i(\d+)/.match(tag).to_a[1].to_i >= live_iteration - 3) }
|
309
|
+
|
310
|
+
puts "Deleting the following tags.\nThese changes #{options[:push] ? "will" : "will not"} be pushed to origin.\n"
|
311
|
+
|
312
|
+
tags_to_delete.each { |tag| puts `git tag -d #{tag}` }
|
313
|
+
tags_to_delete.each { |tag| puts `git push origin :refs/tags/#{tag}` } if options[:push]
|
314
|
+
end
|
295
315
|
|
296
316
|
# Returns true if the supplied Git commit hash or reference exists
|
297
317
|
def self.commit_exists?(commit_id)
|
data/lib/gitscape/version.rb
CHANGED
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 1
|
7
|
-
-
|
8
|
-
-
|
9
|
-
version: 1.
|
7
|
+
- 6
|
8
|
+
- 1
|
9
|
+
version: 1.6.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Jon Botelho
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2013-
|
18
|
+
date: 2013-05-01 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|