v2gpti 1.0.0.1 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 49175127d5a30c7330da908dcfbf8577d17402c5
4
- data.tar.gz: 19e6bb05f2f38a6cde8b926f8d006a106a611db1
3
+ metadata.gz: 1f431701152b119a2bb49c8bab7c635fbce512e6
4
+ data.tar.gz: a3e2227f7e14c032bec17f62912a8e6754b8e9a6
5
5
  SHA512:
6
- metadata.gz: e82162ebf3cffb096ca470e3f51a574b2fd52ddd906a1d3baef46b39a3787f3e71f13f6859733e3796810b9e82582d30117a34797fad7e66fb1252ae9769c9cd
7
- data.tar.gz: b4fb78d07494dc71aec5425c465519efc5b5628b78a698ed95f1e4015b958ad5c959c176866ae8a2ecfd39f060cd423dda69c2d368cecf835855b599afde707a
6
+ metadata.gz: 6ce5d2d9f19781478845ed4520afa6abb1a6c86d3b3ed24bf311fc5f6970d26eeb4e3e11c7052dbfc741bef08fb896df3de41942eac392d03b3926980d940498
7
+ data.tar.gz: bf7a10d09e4eb3e1c83626c72a728d4b825165422792171b1e9b72baad6df0d780b7b4d3076e821a26d4758faeed6cc4d158a3a0a94b0c27839dfd57a661d72c
data/bin/git-report ADDED
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env ruby -U
2
+ # Git Pivotal Tracker Integration
3
+ # Copyright (c) 2013 the original author or authors.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ require 'git-pivotal-tracker-integration/command/report'
18
+
19
+ GitPivotalTrackerIntegration::Command::Report.new().run ARGV
@@ -33,6 +33,13 @@ class GitPivotalTrackerIntegration::Command::Base
33
33
  def initialize
34
34
  self.start_logging
35
35
  self.check_version
36
+
37
+ git_global_push_default = (GitPivotalTrackerIntegration::Util::Shell.exec "git config --global push.default", false).chomp
38
+ if git_global_push_default != "simple"
39
+ puts "git config --global push.default simple"
40
+ puts GitPivotalTrackerIntegration::Util::Shell.exec "git config --global push.default simple"
41
+ end
42
+
36
43
  @repository_root = GitPivotalTrackerIntegration::Util::Git.repository_root
37
44
  @configuration = GitPivotalTrackerIntegration::Command::Configuration.new
38
45
  @toggl = Toggl.new
@@ -48,7 +55,11 @@ class GitPivotalTrackerIntegration::Command::Base
48
55
  @toggl.create_time_entry(parameters(configuration, time_spent))
49
56
  end
50
57
  def start_logging
51
- $LOG = Logger.new("#{Dir.home}/.v2gpti_local.log", 'weekly')
58
+ $LOG = Logger.new("#{logger_filename}", 'weekly')
59
+ end
60
+
61
+ def logger_filename
62
+ return "#{Dir.home}/.v2gpti_local.log"
52
63
  end
53
64
 
54
65
  def check_version
@@ -69,6 +80,7 @@ class GitPivotalTrackerIntegration::Command::Base
69
80
  raise NotImplementedError
70
81
  end
71
82
 
83
+ # Toggl keys
72
84
  # name : The name of the task (string, required, unique in project)
73
85
  # pid : project ID for the task (integer, required)
74
86
  # wid : workspace ID, where the task will be saved (integer, project's workspace id is used when not supplied)
@@ -36,6 +36,8 @@ class GitPivotalTrackerIntegration::Command::Finish < GitPivotalTrackerIntegrati
36
36
  $LOG.debug("configuration:#{@configuration}")
37
37
  $LOG.debug("project:#{@project}")
38
38
  $LOG.debug("story:#{@configuration.story(@project)}")
39
+ memm = PivotalTracker::Membership.all(@project)
40
+ self.commit_new_build
39
41
  time_spent = ""
40
42
  while 1
41
43
  time_spent = ask("How much time did you spend on this task? (example: 15m, 2.5h)")
@@ -49,5 +51,27 @@ class GitPivotalTrackerIntegration::Command::Finish < GitPivotalTrackerIntegrati
49
51
  end
50
52
 
51
53
 
54
+ def commit_new_build
55
+ # Update version and build numbers
56
+ build_number = Time.now.utc.strftime("%y%m%d-%H%M")
52
57
 
58
+ puts "build_number:#{build_number}"
59
+ project_directory = ((GitPivotalTrackerIntegration::Util::Shell.exec 'find . -name "*.xcodeproj" 2>/dev/null').split /\/(?=[^\/]*$)/)[0]
60
+ working_directory = (GitPivotalTrackerIntegration::Util::Shell.exec "pwd").chop
61
+ puts "working_directory:#{working_directory}*"
62
+
63
+ # cd to the project_directory
64
+ Dir.chdir(project_directory)
65
+
66
+ # set build number and project number in project file
67
+ GitPivotalTrackerIntegration::Util::Shell.exec "pwd"
68
+ puts GitPivotalTrackerIntegration::Util::Shell.exec "xcrun agvtool new-version -all #{build_number}", false
69
+ puts GitPivotalTrackerIntegration::Util::Shell.exec "xcrun agvtool new-marketing-version SNAPSHOT"
70
+
71
+ # cd back to the working_directory
72
+ Dir.chdir(working_directory)
73
+
74
+ # Create a new build commit, push to develop
75
+ GitPivotalTrackerIntegration::Util::Git.create_commit( "Update build number to #{build_number}", @configuration.story(@project))
76
+ end
53
77
  end
@@ -0,0 +1,64 @@
1
+ # Git Pivotal Tracker Integration
2
+ # Copyright (c) 2013 the original author or authors.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ require 'git-pivotal-tracker-integration/command/base'
17
+ require 'git-pivotal-tracker-integration/command/command'
18
+ require 'git-pivotal-tracker-integration/util/git'
19
+ require 'git-pivotal-tracker-integration/util/story'
20
+ require 'git-pivotal-tracker-integration/version-update/gradle'
21
+
22
+
23
+ class GitPivotalTrackerIntegration::Command::Report < GitPivotalTrackerIntegration::Command::Base
24
+
25
+
26
+ def run(args)
27
+
28
+ owned_by = "Jeff Wolski" # hard coded to Jeff Wolski for now
29
+
30
+
31
+ $LOG.debug("#{self.class} in project:#{@project.name} pwd:#{(GitPivotalTrackerIntegration::Util::Shell.exec 'pwd').chop} branch:#{GitPivotalTrackerIntegration::Util::Git.branch_name}")
32
+ bug_title = nil
33
+ if args.length == 1
34
+ bug_title = args[0]
35
+ end
36
+ # puts bug_title
37
+ if bug_title.nil? || bug_title.empty?
38
+ abort "\nUsage example:\n\n git report \"Issue running deliver command\" \n"
39
+ end
40
+
41
+ report_note = ""
42
+ while (report_note.nil? || report_note.empty?)
43
+ report_note = ask("Description of bug:")
44
+ end
45
+
46
+ current_user = (GitPivotalTrackerIntegration::Util::Shell.exec "git config user.name").chomp
47
+ bug_title = "User Reported - #{current_user} - #{bug_title}"
48
+ current_user_email = (GitPivotalTrackerIntegration::Util::Shell.exec "git config user.email").chomp
49
+ bug_description = "#{current_user_email}\n#{report_note}"
50
+
51
+ bug_story = PivotalTracker::Story.new
52
+ bug_story.project_id = @project.id
53
+ bug_story.owned_by = owned_by
54
+ bug_story.story_type = "bug"
55
+ bug_story.name = bug_title
56
+ bug_story.description = bug_description
57
+ bug_story.labels = "userreported"
58
+ uploaded_story = bug_story.create
59
+ uploaded_story.upload_attachment(self.logger_filename)
60
+ end
61
+
62
+
63
+
64
+ end
@@ -27,7 +27,7 @@ class GitPivotalTrackerIntegration::Util::Shell
27
27
  def self.exec(command, abort_on_failure = true)
28
28
  result = `#{command}`
29
29
  if $?.exitstatus != 0 && abort_on_failure
30
- abort 'FAIL'
30
+ abort "FAIL on command:#{command}"
31
31
  end
32
32
 
33
33
  result
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.0.0.1
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Hale
@@ -214,6 +214,7 @@ executables:
214
214
  - git-deliver
215
215
  - git-finish
216
216
  - git-release
217
+ - git-report
217
218
  - git-start
218
219
  extensions: []
219
220
  extra_rdoc_files: []
@@ -224,6 +225,7 @@ files:
224
225
  - bin/git-deliver
225
226
  - bin/git-finish
226
227
  - bin/git-release
228
+ - bin/git-report
227
229
  - bin/git-start
228
230
  - lib/git-pivotal-tracker-integration/command/base.rb
229
231
  - lib/git-pivotal-tracker-integration/command/command.rb
@@ -232,6 +234,7 @@ files:
232
234
  - lib/git-pivotal-tracker-integration/command/finish.rb
233
235
  - lib/git-pivotal-tracker-integration/command/prepare-commit-msg.sh
234
236
  - lib/git-pivotal-tracker-integration/command/release.rb
237
+ - lib/git-pivotal-tracker-integration/command/report.rb
235
238
  - lib/git-pivotal-tracker-integration/command/start.rb
236
239
  - lib/git-pivotal-tracker-integration/util/git.rb
237
240
  - lib/git-pivotal-tracker-integration/util/shell.rb