gitscape 1.2 → 1.3

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.
data/bin/gitscape CHANGED
@@ -17,6 +17,8 @@ else
17
17
  Gitscape::Base.new.hotfix_start ARGV[1]
18
18
  when "hotfix_finish"
19
19
  Gitscape::Base.new.hotfix_finish ARGV[1]
20
+ when "release_start"
21
+ Gitscape::Base.new.release_start
20
22
  when "release_finish"
21
23
  Gitscape::Base.new.release_finish ARGV[1].to_i
22
24
  else
data/lib/gitscape/base.rb CHANGED
@@ -57,14 +57,14 @@ class Gitscape::Base
57
57
  live_current_version_number
58
58
  end
59
59
 
60
- def git_has_conflicts puts_conflicts=true
61
- conflicts_status = `git status --porcelain | grep UU`
62
- has_conflicts = conflicts_status.length > 0
60
+ def git_has_conflicts puts_conflicts=true
61
+ conflicts_status = `git status --porcelain | grep UU`
62
+ has_conflicts = conflicts_status.length > 0
63
63
 
64
- puts conflicts_status if has_conflicts && puts_conflicts
64
+ puts conflicts_status if has_conflicts && puts_conflicts
65
65
 
66
- has_conflicts
67
- end
66
+ has_conflicts
67
+ end
68
68
 
69
69
  def hotfix_start(hotfix_branch_name=nil)
70
70
  checkout "live"
@@ -127,6 +127,42 @@ class Gitscape::Base
127
127
  `git checkout #{previous_branch}`
128
128
  end
129
129
 
130
+ def release_start
131
+ # Switch to master branch
132
+ # puts"About to checkout master"
133
+ `git checkout master`
134
+ # puts"Checkout of master branch successful"
135
+
136
+ # Check that the working copy is clean
137
+ exit 1 unless git_working_copy_is_clean
138
+
139
+ # Figure out the previous and new version numbers
140
+ version_file = File.new("version", "r")
141
+ previous_version_number = version_file.read.delete("i").to_i
142
+ new_version_number = previous_version_number + 1
143
+
144
+ # Get the new release_branch_name
145
+ release_branch_name = "i#{new_version_number}"
146
+
147
+ # Cut the branch
148
+ `git checkout -b "release/#{release_branch_name}" master`
149
+ exit 1 unless $?.exitstatus == 0
150
+
151
+ # Bump the version number
152
+ `echo "#{release_branch_name}" > ./version`
153
+ exit 1 unless $?.exitstatus == 0
154
+
155
+ # Commit the bump
156
+ `git commit -a -m "Begin #{release_branch_name} release candidate"`
157
+ exit 1 unless $?.exitstatus == 0
158
+
159
+ # Push to origin
160
+ `git push origin -u "release/#{release_branch_name}"`
161
+ exit 1 unless $?.exitstatus == 0
162
+ `git push origin "release/#{release_branch_name}:qa"`
163
+ exit 1 unless $?.exitstatus == 0
164
+ end
165
+
130
166
  def release_finish new_version_number=0
131
167
  # Check if the working copy is clean, if not, exit
132
168
  exit 1 unless git_working_copy_is_clean
@@ -1,3 +1,3 @@
1
1
  module Gitscape
2
- VERSION = '1.2'
2
+ VERSION = '1.3'
3
3
  end
metadata CHANGED
@@ -4,8 +4,8 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 1
7
- - 2
8
- version: "1.2"
7
+ - 3
8
+ version: "1.3"
9
9
  platform: ruby
10
10
  authors:
11
11
  - Jon Botelho