v2gpti 1.1.7 → 1.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +13 -2
- data/lib/git-pivotal-tracker-integration/command/base.rb +5 -2
- data/lib/git-pivotal-tracker-integration/command/deliver.rb +6 -0
- data/lib/git-pivotal-tracker-integration/command/release.rb +105 -1
- data/lib/git-pivotal-tracker-integration/util/togglV8.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe2b6221257434091b88b4a24aff7334f253766d
|
4
|
+
data.tar.gz: 4f195ca1560b20de92f48950611fdb6e92bf8c4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e2d256f38ff3465216eef4c0834862a0f3929927227c4b39bc51c608668e2a22fcc6a5094b9c6bc607022c548a076a79c35b8213ab83c42ba1ddd61a55114d2
|
7
|
+
data.tar.gz: 913a21225da78e870056ed0b851b01cd2210702ace96d3e260e130724cd57d322df4d5a9db3296d8f858e5f7f02c1dbac438843891c37cf411719d3cda4d0bed
|
data/README.md
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
[pivotal-tracker]: http://www.pivotaltracker.com
|
13
13
|
|
14
14
|
|
15
|
-
## Installation
|
15
|
+
## Installation on OS X
|
16
16
|
`git-pivotal-tracker-integration` requires at least **Ruby 1.8.7** and **Git 1.8.2.1** in order to run. It is tested against Rubies _1.8.7_, _1.9.3_, and _2.0.0_.
|
17
17
|
|
18
18
|
In order to install it, do the following:
|
@@ -21,9 +21,20 @@ In order to install it, do the following:
|
|
21
21
|
2. Check your git version with `git --version`. It should be at least **Git 1.8.2.1** (It is tested against Rubies _1.8.7_, _1.9.3_, and _2.0.0_.)
|
22
22
|
3. Install with the following... (This will require admin rights, so you may need sudo.)
|
23
23
|
```plain
|
24
|
-
$ gem install v2gpti
|
24
|
+
$ sudo gem install v2gpti
|
25
25
|
```
|
26
26
|
|
27
|
+
## Installation on WINDOWS
|
28
|
+
`git-pivotal-tracker-integration` requires at least **Ruby 1.8.7** and **Git 1.8.2.1** in order to run. It is tested against Rubies _1.8.7_, _1.9.3_, and _2.0.0_.
|
29
|
+
|
30
|
+
In order to install it, do the following:
|
31
|
+
|
32
|
+
1. Check your Ruby version with `ruby -v`. It should be at least **Ruby 1.8.7**
|
33
|
+
2. Check your git version with `git --version`. It should be at least **Git 1.8.2.1** (It is tested against Rubies _1.8.7_, _1.9.3_, and _2.0.0_.)
|
34
|
+
3. Install with the following...
|
35
|
+
```plain
|
36
|
+
> gem install v2gpti
|
37
|
+
```
|
27
38
|
|
28
39
|
## Usage
|
29
40
|
`git-pivotal-tracker-integration` is intended to be a very lightweight tool, meaning that it won't affect your day to day workflow very much. To be more specific, it is intended to automate branch creation and destruction as well as story state changes, but will not affect when you commit, when development branches are pushed to origin, etc. The typical workflow looks something like the following:
|
@@ -97,8 +97,11 @@ class GitPivotalTrackerIntegration::Command::Base
|
|
97
97
|
$LOG.info("v2gpti verison #{gem_installed_version} is up to date.")
|
98
98
|
else
|
99
99
|
$LOG.fatal("Out of date")
|
100
|
-
|
101
|
-
|
100
|
+
if OS.windows?
|
101
|
+
abort "\n\nYou are using v2gpti version #{gem_installed_version}, but the current version is #{gem_latest_version}.\nPlease update your gem with the following command.\n\n gem update v2gpti\n\n"
|
102
|
+
else
|
103
|
+
abort "\n\nYou are using v2gpti version #{gem_installed_version}, but the current version is #{gem_latest_version}.\nPlease update your gem with the following command.\n\n sudo gem update v2gpti\n\n"
|
104
|
+
end
|
102
105
|
end
|
103
106
|
rescue StandardError => se
|
104
107
|
puts ""
|
@@ -138,6 +138,10 @@ class GitPivotalTrackerIntegration::Command::Deliver < GitPivotalTrackerIntegrat
|
|
138
138
|
|
139
139
|
def included_stories(project, build_story)
|
140
140
|
|
141
|
+
notes_file = ENV['HOME']+"/#{project.name}-#{build_story.name}"
|
142
|
+
output = File.open( notes_file, "w")
|
143
|
+
output << "Included stories:\n"
|
144
|
+
|
141
145
|
criteria = {
|
142
146
|
:current_state => CANDIDATE_STATES,
|
143
147
|
:limit => 1000,
|
@@ -165,10 +169,12 @@ class GitPivotalTrackerIntegration::Command::Deliver < GitPivotalTrackerIntegrat
|
|
165
169
|
if val_is_valid
|
166
170
|
# puts "val_is_valid:#{val_is_valid}"
|
167
171
|
estimated_candidates << val
|
172
|
+
output << "#{val.id}\n"
|
168
173
|
puts "#{val.id}"
|
169
174
|
|
170
175
|
end
|
171
176
|
end
|
177
|
+
output.close
|
172
178
|
candidates = estimated_candidates
|
173
179
|
end
|
174
180
|
|
@@ -81,10 +81,25 @@ class GitPivotalTrackerIntegration::Command::Release < GitPivotalTrackerIntegrat
|
|
81
81
|
# cd back to the working_directory
|
82
82
|
Dir.chdir(working_directory)
|
83
83
|
end
|
84
|
+
|
85
|
+
# Change spec version
|
86
|
+
change_spec_version(version_number) if has_spec_path?
|
84
87
|
|
85
|
-
# Create a new build commit, push to QA
|
88
|
+
# Create a new build commit, push to QA
|
86
89
|
puts GitPivotalTrackerIntegration::Util::Git.create_commit( "Update version number to #{version_number} for delivery to QA", story)
|
87
90
|
puts GitPivotalTrackerIntegration::Util::Shell.exec "git push"
|
91
|
+
|
92
|
+
# Create release tag
|
93
|
+
create_release_tag(version_number) if has_spec_path?
|
94
|
+
|
95
|
+
#Created tag should be pushed to private Podspec repo
|
96
|
+
if has_spec_path? && @platform == "ios"
|
97
|
+
puts GitPivotalTrackerIntegration::Util::Shell.exec "git checkout #{version_number}"
|
98
|
+
puts GitPivotalTrackerIntegration::Util::Shell.exec "pod repo push V2PodSpecs #{@configuration.pconfig["spec"]["spec-path"]}"
|
99
|
+
puts GitPivotalTrackerIntegration::Util::Shell.exec "git checkout develop"
|
100
|
+
end
|
101
|
+
|
102
|
+
#checkout develop branch
|
88
103
|
puts GitPivotalTrackerIntegration::Util::Shell.exec "git checkout #{current_branch}"
|
89
104
|
|
90
105
|
s_labels_string = story.labels
|
@@ -100,9 +115,71 @@ class GitPivotalTrackerIntegration::Command::Release < GitPivotalTrackerIntegrat
|
|
100
115
|
puts "labels:#{s_labels_string}"
|
101
116
|
story.update(:labels => s_labels_string)
|
102
117
|
|
118
|
+
i_stories = included_stories @project, story
|
119
|
+
add_version_tag_to_stories i_stories, story
|
120
|
+
|
103
121
|
end
|
104
122
|
|
105
123
|
private
|
124
|
+
|
125
|
+
CANDIDATE_STATES = %w(delivered unstarted).freeze
|
126
|
+
CANDIDATE_TYPES = %w(bug chore feature release)
|
127
|
+
|
128
|
+
def add_version_tag_to_stories(stories, release_story)
|
129
|
+
all_stories = stories.dup
|
130
|
+
all_stories << release_story
|
131
|
+
puts "Included stories:\n"
|
132
|
+
all_stories.each {|story|
|
133
|
+
s_labels_string = story.labels
|
134
|
+
s_labels = ""
|
135
|
+
if (s_labels_string)
|
136
|
+
s_labels = s_labels_string.split(",")
|
137
|
+
s_labels << release_story.name
|
138
|
+
s_labels_string = s_labels.uniq.join(",")
|
139
|
+
else
|
140
|
+
s_labels_string = release_story.name
|
141
|
+
end
|
142
|
+
|
143
|
+
unless story.labels.nil?
|
144
|
+
if story.labels.scan(/b\d{1}/).size > story.labels.scan(/v\d{1}/).size
|
145
|
+
story.update(:labels => s_labels_string)
|
146
|
+
puts story.id
|
147
|
+
end
|
148
|
+
end
|
149
|
+
}
|
150
|
+
end
|
151
|
+
|
152
|
+
def included_stories(project, release_story)
|
153
|
+
|
154
|
+
criteria = {
|
155
|
+
:current_state => CANDIDATE_STATES,
|
156
|
+
:limit => 1000,
|
157
|
+
:story_type => CANDIDATE_TYPES
|
158
|
+
}
|
159
|
+
|
160
|
+
|
161
|
+
candidates = project.stories.all criteria
|
162
|
+
|
163
|
+
estimated_candidates = Array.new
|
164
|
+
val_is_valid = true
|
165
|
+
|
166
|
+
candidates.each do |val|
|
167
|
+
val_is_valid = true
|
168
|
+
if (val.id == release_story.id)
|
169
|
+
next
|
170
|
+
end
|
171
|
+
if (val.current_state != "delivered")
|
172
|
+
val_is_valid = false
|
173
|
+
end
|
174
|
+
if (val.story_type == "release")
|
175
|
+
val_is_valid = false
|
176
|
+
end
|
177
|
+
if val_is_valid
|
178
|
+
estimated_candidates << val
|
179
|
+
end
|
180
|
+
end
|
181
|
+
candidates = estimated_candidates
|
182
|
+
end
|
106
183
|
|
107
184
|
def place_version_release(release_story)
|
108
185
|
not_accepted_releases = nil
|
@@ -130,5 +207,32 @@ class GitPivotalTrackerIntegration::Command::Release < GitPivotalTrackerIntegrat
|
|
130
207
|
rejected_story.move(:after, release_story)
|
131
208
|
}
|
132
209
|
end
|
210
|
+
|
211
|
+
def has_spec_path?
|
212
|
+
config_file_path = "#{GitPivotalTrackerIntegration::Util::Git.repository_root}/.v2gpti/config"
|
213
|
+
config_file_text = File.read(config_file_path)
|
214
|
+
spec_pattern_check = /spec-path(.*)=/.match("#{config_file_text}")
|
215
|
+
if spec_pattern_check.nil?
|
216
|
+
return false
|
217
|
+
else
|
218
|
+
spec_file_path = @configuration.pconfig["spec"]["spec-path"]
|
219
|
+
if spec_file_path.nil?
|
220
|
+
return false
|
221
|
+
else
|
222
|
+
return true
|
223
|
+
end
|
224
|
+
end
|
225
|
+
end
|
226
|
+
|
227
|
+
def change_spec_version(version_number)
|
228
|
+
spec_file_path = "#{GitPivotalTrackerIntegration::Util::Git.repository_root}/#{@configuration.pconfig["spec"]["spec-path"]}"
|
229
|
+
spec_file_text = File.read(spec_file_path)
|
230
|
+
File.open(spec_file_path, "w") {|file| file.puts spec_file_text.gsub(/version(.*)=(.*)['|"]/, "version = '#{version_number}'")}
|
231
|
+
end
|
232
|
+
|
233
|
+
def create_release_tag(version_number)
|
234
|
+
GitPivotalTrackerIntegration::Util::Shell.exec "git tag -a #{version_number} -m \"release #{version_number}\""
|
235
|
+
puts GitPivotalTrackerIntegration::Util::Shell.exec "git push origin #{version_number}"
|
236
|
+
end
|
133
237
|
|
134
238
|
end
|
@@ -41,7 +41,7 @@ class Toggl
|
|
41
41
|
t_file
|
42
42
|
end
|
43
43
|
def connection(username, password)
|
44
|
-
Faraday.new(url: 'https://www.toggl.com/api/v8') do |faraday|
|
44
|
+
Faraday.new(url: 'https://www.toggl.com/api/v8', :ssl => {:verify => false}) do |faraday|
|
45
45
|
faraday.request :url_encoded
|
46
46
|
faraday.response :logger, Logger.new('faraday.log')
|
47
47
|
faraday.adapter Faraday.default_adapter
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: v2gpti
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff Wolski
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2014-
|
13
|
+
date: 2014-10-01 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: highline
|
@@ -289,9 +289,9 @@ require_paths:
|
|
289
289
|
- lib
|
290
290
|
required_ruby_version: !ruby/object:Gem::Requirement
|
291
291
|
requirements:
|
292
|
-
- - '
|
292
|
+
- - '='
|
293
293
|
- !ruby/object:Gem::Version
|
294
|
-
version:
|
294
|
+
version: 1.1.8
|
295
295
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
296
296
|
requirements:
|
297
297
|
- - '>='
|