thor-scmversion 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +64 -9
- data/lib/thor-scmversion.rb +1 -0
- metadata +20 -20
data/README.md
CHANGED
@@ -1,9 +1,26 @@
|
|
1
|
-
# Thor
|
1
|
+
# Thor::SCMVersion
|
2
2
|
|
3
|
-
Thor tasks to manage a VERSION file based on SCM tags, for use in
|
4
|
-
pipelines.
|
3
|
+
Thor tasks to manage a VERSION file based on SCM tags, for use in
|
4
|
+
continuous delivery pipelines.
|
5
5
|
|
6
|
-
|
6
|
+
One of the key points of continuous delivery is that every build has a
|
7
|
+
version number, and that version number is unique and only points to
|
8
|
+
one build. Thor::SCMVersion adds some tasks to a Thorfile to use SCM
|
9
|
+
tags as the authoritative source of version status, so your continuous
|
10
|
+
integration server can create versions without having to worry about
|
11
|
+
file conflicts.
|
12
|
+
|
13
|
+
## Integrating into your project
|
14
|
+
|
15
|
+
Since Thor is written in Ruby, you'll need Ruby to make this work, on
|
16
|
+
your workstation and on your CI server. See http://whatisthor.com/ for
|
17
|
+
more in how to use Thor.
|
18
|
+
|
19
|
+
### Get the gem
|
20
|
+
|
21
|
+
If you don't already have a Gemfile, you should probably get one. See
|
22
|
+
http://gembundler.com/ for more details on Bundler and Gemfiles. Not
|
23
|
+
required, but will save you a lot of hassle.
|
7
24
|
|
8
25
|
Add this line to your application's Gemfile:
|
9
26
|
|
@@ -17,17 +34,55 @@ Or install it yourself as:
|
|
17
34
|
|
18
35
|
$ gem install thor-scmversion
|
19
36
|
|
20
|
-
|
37
|
+
### Add it to your Thorfile
|
21
38
|
|
22
|
-
|
39
|
+
All you need to do is require it at the top of your Thorfile:
|
23
40
|
|
24
|
-
|
41
|
+
require 'thor/scmversion'
|
25
42
|
|
43
|
+
Now when you list your thor tasks you'll see 2 new ones.
|
44
|
+
|
45
|
+
$ thor list
|
46
|
+
|
26
47
|
version
|
27
48
|
-------
|
28
|
-
thor version:bump TYPE # Bump version number
|
49
|
+
thor version:bump TYPE # Bump version number (type is major, minor or patch)
|
50
|
+
thor version:current # Show current SCM tagged version
|
51
|
+
|
52
|
+
### Remove your VERSION file from source control
|
53
|
+
|
54
|
+
Since your CI server will be managing your VERSION file, you don't
|
55
|
+
want it to be stored in your SCM anymore. Make a note of your current
|
56
|
+
version, then
|
57
|
+
|
58
|
+
$ git rm VERSION
|
59
|
+
$ echo VERSION >> .gitignore`
|
60
|
+
$ git add .gitignore
|
61
|
+
$ git commit -m "Drop VERSION as it is managed by thor-scmversion now"
|
62
|
+
|
63
|
+
### Create a tag for the current version
|
64
|
+
|
65
|
+
Now tag the current version manually. If it was 1.2.3:
|
66
|
+
|
67
|
+
$ git tag 1.2.3
|
68
|
+
$ git push --tags
|
69
|
+
|
70
|
+
You can make sure it worked by running `thor version:current` and
|
71
|
+
making sure it is what you expected.
|
72
|
+
|
73
|
+
### Integrate with CI
|
74
|
+
|
75
|
+
Now, as part of your CI job, before it builds your artifacts, have it
|
76
|
+
run `thor version:bump patch`. This will increment the patch, push the
|
77
|
+
new tag, and write the VERSION file. Now the artifact you build will
|
78
|
+
have the right version information, every time.
|
79
|
+
|
80
|
+
### You manage the major and minor
|
29
81
|
|
30
|
-
|
82
|
+
When you make significant changes, you can bump the major or minor
|
83
|
+
number yourself with `thor version:bump minor`. This will create a tag
|
84
|
+
with a .0 patch level, so the next build made by the server will be
|
85
|
+
.1 patch level.
|
31
86
|
|
32
87
|
## Contributing
|
33
88
|
|
data/lib/thor-scmversion.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thor-scmversion
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,11 +11,11 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2012-07-
|
14
|
+
date: 2012-07-24 00:00:00.000000000Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: thor
|
18
|
-
requirement: &
|
18
|
+
requirement: &70333866237580 !ruby/object:Gem::Requirement
|
19
19
|
none: false
|
20
20
|
requirements:
|
21
21
|
- - ! '>='
|
@@ -23,10 +23,10 @@ dependencies:
|
|
23
23
|
version: '0'
|
24
24
|
type: :runtime
|
25
25
|
prerelease: false
|
26
|
-
version_requirements: *
|
26
|
+
version_requirements: *70333866237580
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: webmock
|
29
|
-
requirement: &
|
29
|
+
requirement: &70333866236920 !ruby/object:Gem::Requirement
|
30
30
|
none: false
|
31
31
|
requirements:
|
32
32
|
- - ! '>='
|
@@ -34,10 +34,10 @@ dependencies:
|
|
34
34
|
version: '0'
|
35
35
|
type: :development
|
36
36
|
prerelease: false
|
37
|
-
version_requirements: *
|
37
|
+
version_requirements: *70333866236920
|
38
38
|
- !ruby/object:Gem::Dependency
|
39
39
|
name: geminabox
|
40
|
-
requirement: &
|
40
|
+
requirement: &70333866236120 !ruby/object:Gem::Requirement
|
41
41
|
none: false
|
42
42
|
requirements:
|
43
43
|
- - ! '>='
|
@@ -45,10 +45,10 @@ dependencies:
|
|
45
45
|
version: '0'
|
46
46
|
type: :development
|
47
47
|
prerelease: false
|
48
|
-
version_requirements: *
|
48
|
+
version_requirements: *70333866236120
|
49
49
|
- !ruby/object:Gem::Dependency
|
50
50
|
name: spork
|
51
|
-
requirement: &
|
51
|
+
requirement: &70333866235560 !ruby/object:Gem::Requirement
|
52
52
|
none: false
|
53
53
|
requirements:
|
54
54
|
- - ! '>='
|
@@ -56,10 +56,10 @@ dependencies:
|
|
56
56
|
version: '0'
|
57
57
|
type: :development
|
58
58
|
prerelease: false
|
59
|
-
version_requirements: *
|
59
|
+
version_requirements: *70333866235560
|
60
60
|
- !ruby/object:Gem::Dependency
|
61
61
|
name: simplecov
|
62
|
-
requirement: &
|
62
|
+
requirement: &70333866234740 !ruby/object:Gem::Requirement
|
63
63
|
none: false
|
64
64
|
requirements:
|
65
65
|
- - ! '>='
|
@@ -67,10 +67,10 @@ dependencies:
|
|
67
67
|
version: '0'
|
68
68
|
type: :development
|
69
69
|
prerelease: false
|
70
|
-
version_requirements: *
|
70
|
+
version_requirements: *70333866234740
|
71
71
|
- !ruby/object:Gem::Dependency
|
72
72
|
name: vcr
|
73
|
-
requirement: &
|
73
|
+
requirement: &70333866233060 !ruby/object:Gem::Requirement
|
74
74
|
none: false
|
75
75
|
requirements:
|
76
76
|
- - ! '>='
|
@@ -78,10 +78,10 @@ dependencies:
|
|
78
78
|
version: '0'
|
79
79
|
type: :development
|
80
80
|
prerelease: false
|
81
|
-
version_requirements: *
|
81
|
+
version_requirements: *70333866233060
|
82
82
|
- !ruby/object:Gem::Dependency
|
83
83
|
name: aruba
|
84
|
-
requirement: &
|
84
|
+
requirement: &70333866231340 !ruby/object:Gem::Requirement
|
85
85
|
none: false
|
86
86
|
requirements:
|
87
87
|
- - ! '>='
|
@@ -89,10 +89,10 @@ dependencies:
|
|
89
89
|
version: '0'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
|
-
version_requirements: *
|
92
|
+
version_requirements: *70333866231340
|
93
93
|
- !ruby/object:Gem::Dependency
|
94
94
|
name: rspec
|
95
|
-
requirement: &
|
95
|
+
requirement: &70333866229360 !ruby/object:Gem::Requirement
|
96
96
|
none: false
|
97
97
|
requirements:
|
98
98
|
- - ! '>='
|
@@ -100,7 +100,7 @@ dependencies:
|
|
100
100
|
version: '0'
|
101
101
|
type: :development
|
102
102
|
prerelease: false
|
103
|
-
version_requirements: *
|
103
|
+
version_requirements: *70333866229360
|
104
104
|
description: Thor tasks to manage a VERSION file based on SCM tags
|
105
105
|
email:
|
106
106
|
- ivey@gweezlebur.com
|
@@ -144,7 +144,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
144
144
|
version: '0'
|
145
145
|
segments:
|
146
146
|
- 0
|
147
|
-
hash:
|
147
|
+
hash: 3600855675066312833
|
148
148
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
149
149
|
none: false
|
150
150
|
requirements:
|
@@ -153,7 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
153
153
|
version: '0'
|
154
154
|
segments:
|
155
155
|
- 0
|
156
|
-
hash:
|
156
|
+
hash: 3600855675066312833
|
157
157
|
requirements: []
|
158
158
|
rubyforge_project:
|
159
159
|
rubygems_version: 1.8.10
|