gitscape 1.2 → 1.3
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 +42 -6
- data/lib/gitscape/version.rb +1 -1
- metadata +2 -2
data/bin/gitscape
CHANGED
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
|
-
|
61
|
-
|
62
|
-
|
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
|
-
|
64
|
+
puts conflicts_status if has_conflicts && puts_conflicts
|
65
65
|
|
66
|
-
|
67
|
-
|
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
|
data/lib/gitscape/version.rb
CHANGED