optimis-workflow-scripts 0.0.1
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/LICENSE +21 -0
- data/README.md +33 -0
- data/bin/finish-feature +28 -0
- data/bin/start-feature +35 -0
- data/bin/start-hotfix +12 -0
- metadata +69 -0
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
Copyright (c) 2010 OptimisDev
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
|
+
|
data/README.md
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
# Usage
|
2
|
+
|
3
|
+
## start-feature STORYID
|
4
|
+
When given a story id, a new local feature branch will be created from your
|
5
|
+
current branch. If you have a .tracker_settings.yml file in the root directory
|
6
|
+
of the project, then this will mark the story as "started" in Pivotal Tracker.
|
7
|
+
|
8
|
+
## finish-feature COMMITMSG
|
9
|
+
When you are done working on a feature and ready to merge it into master,
|
10
|
+
use finish-feature to do a squashed merge into master and push the changes
|
11
|
+
to origin/master. Additionally, <code>COMMITMSG</code> will be appended with
|
12
|
+
**[finishes #STORYID]** to mark the story as "finished" in Pivotal Tracker.
|
13
|
+
|
14
|
+
Currently, this is done with Pivotal Tracker's integration with Github. See [this
|
15
|
+
blog post](http://pivotallabs.com/users/dan/blog/articles/1135-pivotal-tracker-api-new-version-v3-to-be-released-on-jan-23) for further details on getting this set up.
|
16
|
+
|
17
|
+
## start-hotfix STORYID [STABLE_BRANCH]
|
18
|
+
Creates a new local hotfix branch from <code>STABLE\_BRANCH</code>, which defaults
|
19
|
+
to <code>stable</code>. Currently, this command does not support Pivotal Tracker
|
20
|
+
integration, though support is planned.
|
21
|
+
|
22
|
+
# .tracker_settings.yml
|
23
|
+
|
24
|
+
To integrate these scripts with [Pivotal Tracker](http://pivotaltracker.com),
|
25
|
+
create a .tracker_settings.yml file in the root directory for the project. It
|
26
|
+
should have the following info:
|
27
|
+
|
28
|
+
<pre>
|
29
|
+
token: YOUR_TRACKER_API_TOKEN
|
30
|
+
project_id: TRACKER_PROJECT_ID
|
31
|
+
</pre>
|
32
|
+
|
33
|
+
You should add this file to your .gitignore, as it contains user-specific settings.
|
data/bin/finish-feature
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# Syntax: finish-story msg
|
4
|
+
# * Determine current local feature branch
|
5
|
+
# * Extract story id from branch name (should be feature-STORYID)
|
6
|
+
# * git checkout master
|
7
|
+
# * git merge --squash feature-branch
|
8
|
+
# * git commit 'Finish feature STORY TITLE [Story #STORYID]
|
9
|
+
# * git push origin master
|
10
|
+
|
11
|
+
# system "git checkout master"
|
12
|
+
|
13
|
+
current_branch = `git branch | grep '\*' | awk '{print $2}'`
|
14
|
+
story_id = current_branch.split("-").last.chomp!
|
15
|
+
modified_files = `git ls-files --modified && git ls-files --deleted && git ls-files --unmerged`
|
16
|
+
|
17
|
+
fail "Error! You must specify a commit message." unless ARGV[0]
|
18
|
+
fail "Whoops! You have uncommitted changes! Please commit or stash everything and then run again." unless modified_files.empty?
|
19
|
+
|
20
|
+
if ARGV[0] == "-h" || ARGV[0] == "--help" || ARGV[0] == "help"
|
21
|
+
puts "Syntax: finish-feature commit-msg"
|
22
|
+
else
|
23
|
+
commit_message = ARGV[0].chomp
|
24
|
+
system 'git checkout master'
|
25
|
+
system "git merge --squash #{current_branch}"
|
26
|
+
system "git commit -m '#{commit_message} [finishes ##{story_id}\]'"
|
27
|
+
system "git push origin master"
|
28
|
+
end
|
data/bin/start-feature
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'yaml'
|
4
|
+
require 'uri'
|
5
|
+
require 'net/http'
|
6
|
+
|
7
|
+
fail "Please pass in a story id" if ARGV.empty?
|
8
|
+
|
9
|
+
if ARGV[0] == "-h" || ARGV[0] == "--help" || ARGV[0] == "help"
|
10
|
+
puts "Syntax: start-feature STORYID"
|
11
|
+
else
|
12
|
+
story_id = ARGV[0].chomp
|
13
|
+
current_dir = `pwd`.chomp
|
14
|
+
settings_file = current_dir + '/.tracker_settings.yml'
|
15
|
+
|
16
|
+
@tracker_settings = YAML.load_file(settings_file) if File.exists?(settings_file)
|
17
|
+
|
18
|
+
unless @tracker_settings.nil?
|
19
|
+
url = URI.parse("http://www.pivotaltracker.com/services/v3/projects/#{@tracker_settings['project_id']}/stories/#{story_id}")
|
20
|
+
|
21
|
+
net = Net::HTTP.new url.host, url.port
|
22
|
+
|
23
|
+
net.start do |http|
|
24
|
+
payload = '<story><current_state>started</current_state></story>'
|
25
|
+
req = Net::HTTP::Put.new(url.request_uri, {'Content-type' => 'application/xml', 'X-TrackerToken' => @tracker_settings['token']})
|
26
|
+
http.request(req, payload)
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
|
31
|
+
system "git checkout -b feature-#{story_id}"
|
32
|
+
end
|
33
|
+
|
34
|
+
|
35
|
+
|
data/bin/start-hotfix
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
fail "Please pass in a hotfix story id" if ARGV.empty?
|
4
|
+
|
5
|
+
if ARGV[0] == "-h" || ARGV[0] == "--help" || ARGV[0] == "help"
|
6
|
+
puts "Syntax: start-hotfix STORYID [stable]"
|
7
|
+
else
|
8
|
+
stable_branch = ARGV[1] || 'stable'
|
9
|
+
system "git checkout -b hotfix-#{ARGV[0]} #{stable_branch}"
|
10
|
+
end
|
11
|
+
|
12
|
+
|
metadata
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: optimis-workflow-scripts
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
version: 0.0.1
|
10
|
+
platform: ruby
|
11
|
+
authors:
|
12
|
+
- Alex Sharp
|
13
|
+
autorequire:
|
14
|
+
bindir: bin
|
15
|
+
cert_chain: []
|
16
|
+
|
17
|
+
date: 2010-04-08 00:00:00 -07:00
|
18
|
+
default_executable:
|
19
|
+
dependencies: []
|
20
|
+
|
21
|
+
description: Scripts include git workflow scripts that integrate with pivotal tracker.
|
22
|
+
email:
|
23
|
+
- asharp@optimiscorp.com
|
24
|
+
executables:
|
25
|
+
- finish-feature
|
26
|
+
- start-feature
|
27
|
+
- start-hotfix
|
28
|
+
extensions: []
|
29
|
+
|
30
|
+
extra_rdoc_files: []
|
31
|
+
|
32
|
+
files:
|
33
|
+
- bin/finish-feature
|
34
|
+
- bin/start-feature
|
35
|
+
- bin/start-hotfix
|
36
|
+
- LICENSE
|
37
|
+
- README.md
|
38
|
+
has_rdoc: true
|
39
|
+
homepage: http://github.com/optimis/optimis-workflow-scripts
|
40
|
+
licenses: []
|
41
|
+
|
42
|
+
post_install_message:
|
43
|
+
rdoc_options: []
|
44
|
+
|
45
|
+
require_paths:
|
46
|
+
- lib
|
47
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
48
|
+
requirements:
|
49
|
+
- - ">="
|
50
|
+
- !ruby/object:Gem::Version
|
51
|
+
segments:
|
52
|
+
- 0
|
53
|
+
version: "0"
|
54
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
55
|
+
requirements:
|
56
|
+
- - ">="
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
segments:
|
59
|
+
- 0
|
60
|
+
version: "0"
|
61
|
+
requirements: []
|
62
|
+
|
63
|
+
rubyforge_project:
|
64
|
+
rubygems_version: 1.3.6
|
65
|
+
signing_key:
|
66
|
+
specification_version: 3
|
67
|
+
summary: A collection of scripts we use to manage our workflow at OptimisDev.
|
68
|
+
test_files: []
|
69
|
+
|