trackrepos 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE +22 -0
- data/README.md +116 -0
- data/Rakefile +2 -0
- data/bin/trackrepos +35 -0
- data/lib/trackrepos/repos.rb +303 -0
- data/lib/trackrepos/version.rb +3 -0
- data/lib/trackrepos.rb +2 -0
- data/trackrepos.gemspec +61 -0
- metadata +75 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2012 Concord Consortium
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,116 @@
|
|
1
|
+
# trackrepos
|
2
|
+
|
3
|
+
Command line tool that parses a yaml file in a directory to update and report on a collection of repositories.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Install the Ruby Gem `track-repos`:
|
8
|
+
|
9
|
+
gem install track-repos
|
10
|
+
|
11
|
+
## Setup
|
12
|
+
|
13
|
+
Create a `.tracked-repos.yaml` file to update and keep track of either existing git repositores or new ones you intend to add.
|
14
|
+
|
15
|
+
There are currently three types of git repositores that can be tracked andupdated:
|
16
|
+
|
17
|
+
1. Regular git repositories.
|
18
|
+
2. Git clones of Subversion repositories
|
19
|
+
3. Git clones of git mirrors of subversion repositories (need to explicity request new tags).
|
20
|
+
|
21
|
+
Here's an example yaml configuration file that tracks the Ruby Gems `aasm`, and `builder`.
|
22
|
+
Normally the master branch is fetched hower the specifiction for thr `builder` gem indicates that
|
23
|
+
the `trunk` branch should be checked out and tracked.In addition the `arduino` project which
|
24
|
+
is located in a Subersion repository is checked out as a git clone of a subversion repository.
|
25
|
+
|
26
|
+
---
|
27
|
+
:git:
|
28
|
+
- :path: aasm
|
29
|
+
:remote: http://github.com/rubyist/aasm.git
|
30
|
+
- :path: buildr
|
31
|
+
:branch: trunk
|
32
|
+
:remote: git://github.com/apache/buildr.git
|
33
|
+
:git_svn:
|
34
|
+
- :path: arduino
|
35
|
+
:remote: http://arduino.googlecode.com/svn
|
36
|
+
:git_clones_of_git_clones_of_svn_repos:
|
37
|
+
- :path: ruby
|
38
|
+
:branch: trunk
|
39
|
+
:remote: git://github.com/ruby/ruby.git
|
40
|
+
|
41
|
+
The last item in the list specifies that the source code for Ruby should be checked out. In
|
42
|
+
this case it is being cloned from a git repository on github which is a miirror of the main
|
43
|
+
Ruby Subversion repository. This tpe if differentiated from a normal git repository because an
|
44
|
+
additional action is taken to manually fetch any updated tags.
|
45
|
+
|
46
|
+
The `.tracked-repos.yaml` file is a YAML serialization of the kind of data expressed in this Ruby Hash.
|
47
|
+
Each type of external repositor consists of an array of repository specificationns with keys for
|
48
|
+
`:path` and `:remote` git url, as well as an optional key for the `:branch` that should be tracked
|
49
|
+
The defatult is the master branch and does not need to be specified.
|
50
|
+
|
51
|
+
{ :git =>
|
52
|
+
[
|
53
|
+
{ :path=>"aasm-git",
|
54
|
+
:remote=>"http://github.com/rubyist/aasm.git" },
|
55
|
+
{ :path=>"buildr-git",
|
56
|
+
:branch=>"trunk",
|
57
|
+
:remote=>"git://github.com/apache/buildr.git" }
|
58
|
+
],
|
59
|
+
:git_svn =>
|
60
|
+
[
|
61
|
+
{ :path => "arduino-svn-git",
|
62
|
+
:remote => "http://arduino.googlecode.com/svn" }
|
63
|
+
],
|
64
|
+
:git_clones_of_git_svn_mirrors_of_svn_repos =>
|
65
|
+
[
|
66
|
+
{ :path => "ruby-git",
|
67
|
+
:branch => "trunk",
|
68
|
+
:remote => "git://github.com/ruby/ruby.git" }
|
69
|
+
]
|
70
|
+
}
|
71
|
+
|
72
|
+
## Usage
|
73
|
+
|
74
|
+
Change to the directory with the `.tracked-repos.yaml` file and run the command-line tool:
|
75
|
+
|
76
|
+
track-repos
|
77
|
+
|
78
|
+
### help
|
79
|
+
|
80
|
+
$ bin/trackrepos --help
|
81
|
+
Usage: trackrepos
|
82
|
+
-s YAMLFILE, Use specification file YAMLFILE instead of '.tracked-repos.yaml'
|
83
|
+
--specification-file
|
84
|
+
-d YAMLDIRECTORYFILE, Use specification file YAMLDIRECTORYFILE instead of '.tracked-directories.yaml'
|
85
|
+
--directory-file
|
86
|
+
-v, --verbose Display yaml specification file
|
87
|
+
-g, --generate Generate and display yaml specification suitable for a '.tracked-repos.yaml'
|
88
|
+
file from existing repositories
|
89
|
+
|
90
|
+
### Tracking directories
|
91
|
+
|
92
|
+
You can also use a yaml specification file that just has lists of paths with yaml repository specifications.
|
93
|
+
|
94
|
+
The defautt name for a directory tracking file: `.tracked-directories.yaml`
|
95
|
+
|
96
|
+
This directory tracking file would cause `trackrepos` to process yaml repository specifications
|
97
|
+
in both `dir1/` and `dir2/`
|
98
|
+
|
99
|
+
---
|
100
|
+
- dir1
|
101
|
+
- dir2
|
102
|
+
|
103
|
+
### Specifying different names for yaml specification files
|
104
|
+
|
105
|
+
This example looks in the file `tracked-directories.yaml` in the current directory
|
106
|
+
and looks for the file `tracked-repos.yaml` in each of the directroies it references.
|
107
|
+
|
108
|
+
$ trackrepos -d tracked-directories.yaml -s tracked-repos.yaml
|
109
|
+
|
110
|
+
## Contributing
|
111
|
+
|
112
|
+
1. Fork it
|
113
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
114
|
+
3. Commit your changes (`git commit -am 'Added some feature'`)
|
115
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
116
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
data/bin/trackrepos
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
$:.unshift(File.dirname(__FILE__) + '/../lib/')
|
3
|
+
|
4
|
+
require 'optparse'
|
5
|
+
require 'trackrepos'
|
6
|
+
|
7
|
+
if %w(--version -v).include? ARGV.first
|
8
|
+
puts "trackrepos #{TrackRepos::VERSION}"
|
9
|
+
exit(0)
|
10
|
+
end
|
11
|
+
|
12
|
+
options = {}
|
13
|
+
OptionParser.new do |opts|
|
14
|
+
opts.banner = "Usage: trackrepos"
|
15
|
+
opts.on("-s", "--specification-file YAMLFILE",
|
16
|
+
"Use specification file YAMLFILE instead of '#{TrackRepos::Repos::TRACKED_YAML}'") do |s|
|
17
|
+
options[:tracked_filename] = s
|
18
|
+
end
|
19
|
+
opts.on("-d", "--directory-file YAMLDIRECTORYFILE",
|
20
|
+
"Use specification file YAMLDIRECTORYFILE instead of '#{TrackRepos::Repos::TRACKED_DIRECTORIES_YAML}'") do |d|
|
21
|
+
options[:tracked_directories] = d
|
22
|
+
end
|
23
|
+
opts.on("-v", "--verbose",
|
24
|
+
"Display yaml specification file") do |v|
|
25
|
+
options[:verbose] = v
|
26
|
+
end
|
27
|
+
|
28
|
+
opts.on("-g", "--generate",
|
29
|
+
"Generate and display yaml specification suitable for a '#{TrackRepos::Repos::TRACKED_YAML}' file from existing repositories") do |g|
|
30
|
+
options[:generate] = g
|
31
|
+
end
|
32
|
+
end.parse!
|
33
|
+
|
34
|
+
repos = TrackRepos::Repos.new options
|
35
|
+
repos.track
|
@@ -0,0 +1,303 @@
|
|
1
|
+
require 'yaml'
|
2
|
+
require 'time'
|
3
|
+
|
4
|
+
module TrackRepos
|
5
|
+
class Repos
|
6
|
+
|
7
|
+
PATH_FORMAT_STR = " %-56s%-30s%-24s"
|
8
|
+
COMMIT_FORMAT_STR = " %-24s%s"
|
9
|
+
|
10
|
+
TRACKED_YAML = '.tracked-repos.yaml'
|
11
|
+
TRACKED_DIRECTORIES_YAML = '.tracked-directories.yaml'
|
12
|
+
|
13
|
+
GIT_COMMANDS = {
|
14
|
+
:git => [
|
15
|
+
['git pull'],
|
16
|
+
'Updating local git clones of external git repositories'
|
17
|
+
],
|
18
|
+
|
19
|
+
:git_svn_hybrid => [
|
20
|
+
['git svn rebase'],
|
21
|
+
'Updating local git svn hybrid clones of external subversion repositories'
|
22
|
+
],
|
23
|
+
:git_svn => [
|
24
|
+
['git svn rebase'],
|
25
|
+
'Updating local git clones of external subversion repositories'
|
26
|
+
],
|
27
|
+
:git_clones_of_git_clones_of_svn_repos => [
|
28
|
+
['git pull', 'git fetch -t'],
|
29
|
+
'Updating local git clones of external git repositories which themselves are created from git-svn clones of svn repos'
|
30
|
+
]
|
31
|
+
}
|
32
|
+
|
33
|
+
def initialize(options)
|
34
|
+
@options = options || {}
|
35
|
+
@tracked_filename = @options[:tracked_filename] || TRACKED_YAML
|
36
|
+
@tracked_directories = @options[:tracked_directories] || TRACKED_DIRECTORIES_YAML
|
37
|
+
if File.exists?(@tracked_directories)
|
38
|
+
@tracked_directories = YAML.load_file(@tracked_directories)
|
39
|
+
else
|
40
|
+
@tracked_directories = [ Dir.pwd ]
|
41
|
+
end
|
42
|
+
@tracked_collections = []
|
43
|
+
@tracked_directories.each do |dir|
|
44
|
+
dir_path = File.expand_path(dir)
|
45
|
+
unless File.exists?(dir_path)
|
46
|
+
raise <<-HEREDOC
|
47
|
+
|
48
|
+
|
49
|
+
*** ERROR : Directory: '#{dir}' doesn't exist.
|
50
|
+
|
51
|
+
HEREDOC
|
52
|
+
end
|
53
|
+
tracking_spec_path = File.join(dir_path, @tracked_filename)
|
54
|
+
unless File.exists?(tracking_spec_path)
|
55
|
+
raise <<-HEREDOC
|
56
|
+
|
57
|
+
|
58
|
+
*** ERROR: YAML specification file does not exist: '#{tracking_spec_path}'
|
59
|
+
|
60
|
+
HEREDOC
|
61
|
+
end
|
62
|
+
tracking_spec = YAML.load_file(tracking_spec_path)
|
63
|
+
@tracked_collections << {
|
64
|
+
:dir => dir,
|
65
|
+
:tracking_spec => tracking_spec,
|
66
|
+
:repos => [],
|
67
|
+
:repos_with_update_errors => { "git error" => [], "dir doesn't exist" => [] }
|
68
|
+
}
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
def track
|
73
|
+
@tracked_collections.each do |collection|
|
74
|
+
track_collection(collection)
|
75
|
+
# FIXME: why are there duplicates ???
|
76
|
+
collection[:repos].uniq!
|
77
|
+
collection[:repos].sort! { |r1, r2| r2[1][:updated_date] <=> r1[1][:updated_date] }
|
78
|
+
end
|
79
|
+
@tracked_collections.each do |collection|
|
80
|
+
report_results(collection)
|
81
|
+
end
|
82
|
+
|
83
|
+
end
|
84
|
+
|
85
|
+
def track_collection(collection)
|
86
|
+
dir = collection[:dir]
|
87
|
+
tracking_spec = collection[:tracking_spec]
|
88
|
+
Dir.chdir File.expand_path(dir) do
|
89
|
+
puts <<-HEREDOC
|
90
|
+
|
91
|
+
=======================================================================================
|
92
|
+
|
93
|
+
Tracking git repositories in directory: #{dir}
|
94
|
+
HEREDOC
|
95
|
+
first_time = true
|
96
|
+
tracking_spec.each do |type, tracked_repos|
|
97
|
+
unless first_time
|
98
|
+
puts <<-HEREDOC
|
99
|
+
|
100
|
+
-----------------------------------------------------------------------------------
|
101
|
+
HEREDOC
|
102
|
+
end
|
103
|
+
commands = GIT_COMMANDS[type][0]
|
104
|
+
desc = GIT_COMMANDS[type][1]
|
105
|
+
update_local_gits(collection, type, tracked_repos, commands, desc)
|
106
|
+
first_time = false
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
111
|
+
def update_local_gits(collection, type, tracked_repos, commands, message)
|
112
|
+
dir = collection[:dir]
|
113
|
+
if tracked_repos
|
114
|
+
puts <<-HEREDOC
|
115
|
+
|
116
|
+
#{message}
|
117
|
+
commands: #{commands.join('; ')}
|
118
|
+
|
119
|
+
HEREDOC
|
120
|
+
tracked_repos.each do |tracked_repo|
|
121
|
+
path = tracked_repo[:path]
|
122
|
+
branch = tracked_repo[:branch] || 'master'
|
123
|
+
remote = tracked_repo[:remote]
|
124
|
+
if !File.exists?(path) && remote
|
125
|
+
case type
|
126
|
+
when :git
|
127
|
+
cmd = "mkdir -p #{path}; git clone #{remote} #{path}"
|
128
|
+
when :git_svn
|
129
|
+
cmd = "mkdir -p #{path}; git svn clone #{remote} #{path}"
|
130
|
+
end
|
131
|
+
puts <<-HEREDOC
|
132
|
+
|
133
|
+
Checking out new project #{remote}
|
134
|
+
Into directory: #{File.expand_path(dir, path)}
|
135
|
+
|
136
|
+
command: #{cmd}
|
137
|
+
|
138
|
+
HEREDOC
|
139
|
+
`#{cmd}`
|
140
|
+
puts
|
141
|
+
end
|
142
|
+
if File.exists?(path)
|
143
|
+
git_remote = `git config --file #{path}/.git/config --get remote.origin.url`.strip
|
144
|
+
git_svn_remote = `git config --file #{path}/.git/config --get svn-remote.svn.url`.strip
|
145
|
+
if git_remote.empty?
|
146
|
+
tracked_repo[:remote] = git_svn_remote
|
147
|
+
else
|
148
|
+
tracked_repo[:remote] = git_remote
|
149
|
+
end
|
150
|
+
git_command(dir, path, commands, collection, branch)
|
151
|
+
if File.exists?(File.join(path, '.gitmodules'))
|
152
|
+
git_command(dir, path, ['git submodule update --init --recursive'], collection, branch, { :quiet => true })
|
153
|
+
end
|
154
|
+
else
|
155
|
+
puts <<-HEREDOC
|
156
|
+
|
157
|
+
ERROR : Path: '#{path}' doesn't exist and failed to create new repository.
|
158
|
+
|
159
|
+
HEREDOC
|
160
|
+
collection[:repos_with_update_errors]["dir doesn't exist"] << path
|
161
|
+
end
|
162
|
+
end
|
163
|
+
end
|
164
|
+
end
|
165
|
+
|
166
|
+
|
167
|
+
def report_results(collection)
|
168
|
+
dir = collection[:dir]
|
169
|
+
if collection[:repos].length > 20
|
170
|
+
puts <<-HEREDOC
|
171
|
+
|
172
|
+
=======================================================================================
|
173
|
+
|
174
|
+
Git repositories in directory: #{dir}
|
175
|
+
updated in the last week:
|
176
|
+
|
177
|
+
HEREDOC
|
178
|
+
collection[:repos].find_all {|r| r[1][:updated_in_last_week] }.uniq.each do |repo|
|
179
|
+
puts sprintf(PATH_FORMAT_STR, repo[0].gsub(dir+ '/', ""), repo[1][:updated_relative], repo[1][:desc])
|
180
|
+
end
|
181
|
+
puts <<-HEREDOC
|
182
|
+
|
183
|
+
Least recently updated:
|
184
|
+
|
185
|
+
HEREDOC
|
186
|
+
collection[:repos][-15..-1].each do |repo|
|
187
|
+
puts sprintf(PATH_FORMAT_STR, repo[0].gsub(dir+ '/', ""), repo[1][:updated_relative], repo[1][:desc])
|
188
|
+
end
|
189
|
+
else
|
190
|
+
puts <<-HEREDOC
|
191
|
+
|
192
|
+
=======================================================================================
|
193
|
+
|
194
|
+
Git repositories sorted by when last updated : #{dir}
|
195
|
+
|
196
|
+
HEREDOC
|
197
|
+
collection[:repos].each do |repo|
|
198
|
+
puts sprintf(PATH_FORMAT_STR, repo[0].gsub(dir+ '/', ""), repo[1][:updated_relative], repo[1][:desc])
|
199
|
+
end
|
200
|
+
end
|
201
|
+
|
202
|
+
if @options[:verbose]
|
203
|
+
puts <<-HEREDOC
|
204
|
+
|
205
|
+
---------------------------------------------------------------------------------------
|
206
|
+
|
207
|
+
YAML form of '#{collection[:dir]}/#{@tracked_filename}':
|
208
|
+
|
209
|
+
HEREDOC
|
210
|
+
puts collection[:tracking_spec].to_yaml
|
211
|
+
end
|
212
|
+
unless collection[:repos_with_update_errors].values.flatten.empty?
|
213
|
+
puts <<-HEREDOC
|
214
|
+
|
215
|
+
=======================================================================================
|
216
|
+
|
217
|
+
Error summary:
|
218
|
+
|
219
|
+
The following git repositories were not updated because of errors:
|
220
|
+
HEREDOC
|
221
|
+
collection[:repos_with_update_errors].each do |error, paths|
|
222
|
+
unless paths.empty?
|
223
|
+
puts <<-HEREDOC
|
224
|
+
|
225
|
+
#{error}:
|
226
|
+
- #{paths.join("\n - ")}
|
227
|
+
HEREDOC
|
228
|
+
end
|
229
|
+
end
|
230
|
+
end
|
231
|
+
puts
|
232
|
+
end
|
233
|
+
|
234
|
+
def gem_desc_in_rakefile
|
235
|
+
if File.exists?('Rakefile')
|
236
|
+
desc = File.read('Rakefile')[/summary\s*=\s*\"(.*)\"/i, 1]
|
237
|
+
else
|
238
|
+
nil
|
239
|
+
end
|
240
|
+
end
|
241
|
+
|
242
|
+
def gem_desc_in_config_hoe
|
243
|
+
if File.exists?('config/hoe.rb')
|
244
|
+
File.read('config/hoe.rb')[/summary\s*=\s*\"(.*)\"/i, 1]
|
245
|
+
else
|
246
|
+
nil
|
247
|
+
end
|
248
|
+
end
|
249
|
+
|
250
|
+
def look_for_description
|
251
|
+
desc = nil
|
252
|
+
gemspec = Dir["*.gemspec"]
|
253
|
+
unless gemspec.empty?
|
254
|
+
desc = File.read(gemspec[0])[/summary\s*=\s*\"(.*)\"/i, 1]
|
255
|
+
return desc
|
256
|
+
end
|
257
|
+
readme = Dir["*"].find_all {|p| p[/.*readme.*/i]}
|
258
|
+
unless readme.empty?
|
259
|
+
desc = File.readlines(readme[0])[0].strip
|
260
|
+
return desc
|
261
|
+
end
|
262
|
+
desc
|
263
|
+
end
|
264
|
+
|
265
|
+
def git_command(dir, path, commands, collection, branch='master', options={})
|
266
|
+
Dir.chdir File.expand_path(path) do
|
267
|
+
response = `git checkout #{branch} 2>&1`
|
268
|
+
commands.each do |command|
|
269
|
+
response += `#{command} 2>&1`
|
270
|
+
end
|
271
|
+
desc = look_for_description
|
272
|
+
unless options[:quiet]
|
273
|
+
if response =~ /Already up-to-date|Current branch master is up to date/
|
274
|
+
puts sprintf(PATH_FORMAT_STR, path, `git log -1 --pretty=format:"%cr"`, desc)
|
275
|
+
else
|
276
|
+
puts sprintf(PATH_FORMAT_STR, path, `git log -1 --pretty=format:"%cr"`, desc)
|
277
|
+
puts "\n#{response}\n"
|
278
|
+
end
|
279
|
+
end
|
280
|
+
if response =~/^(error:|fatal:)/
|
281
|
+
puts <<-HEREDOC
|
282
|
+
Error updating: #{path}
|
283
|
+
|
284
|
+
HEREDOC
|
285
|
+
collection[:repos_with_update_errors]["git error"] << path
|
286
|
+
else
|
287
|
+
collection[:repos] << [
|
288
|
+
path,
|
289
|
+
{ :desc => desc,
|
290
|
+
:updated_date => Time.rfc2822(`git log -1 --pretty=format:"%cD"`),
|
291
|
+
:updated_relative => `git log -1 --pretty=format:"%cr"`,
|
292
|
+
:updated_in_last_day => !`git log HEAD --no-merges --reverse --since='1 day'`.empty?,
|
293
|
+
:updated_in_last_week => !`git log HEAD --no-merges --reverse --since='1 weeks'`.empty?,
|
294
|
+
:updated_in_last_two_weeks => !`git log HEAD --no-merges --reverse --since='2 weeks'`.empty?,
|
295
|
+
:commit_subject => `git log -1 --pretty=format:"%s %cn"`,
|
296
|
+
:commit_author => `git log -1 --pretty=format:"%cn"` }
|
297
|
+
]
|
298
|
+
end
|
299
|
+
end
|
300
|
+
end
|
301
|
+
|
302
|
+
end
|
303
|
+
end
|
data/lib/trackrepos.rb
ADDED
data/trackrepos.gemspec
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
lib = File.expand_path('../lib/', __FILE__)
|
3
|
+
$:.unshift lib unless $:.include?(lib)
|
4
|
+
|
5
|
+
require 'trackrepos/version'
|
6
|
+
|
7
|
+
Gem::Specification.new do |gem|
|
8
|
+
gem.authors = ["Stephen Bannasch"]
|
9
|
+
gem.email = ["sbannasch@concord.org"]
|
10
|
+
gem.description = %q{Uses yaml configuration files to track and update collections of external git repositories}
|
11
|
+
gem.summary = %q{Useful for tracking large numbers of external git repositories}
|
12
|
+
gem.homepage = "https://github.com/concord-consortium/trackrepos"
|
13
|
+
gem.files = `git ls-files`.split($\)
|
14
|
+
gem.executable = "trackrepos"
|
15
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
16
|
+
gem.name = "trackrepos"
|
17
|
+
gem.require_paths = ["lib"]
|
18
|
+
gem.version = TrackRepos::VERSION
|
19
|
+
|
20
|
+
gem.post_install_message = <<-HEREDOC
|
21
|
+
|
22
|
+
trackrepos
|
23
|
+
|
24
|
+
Create a '.tracked-repos.yaml' file to update and keep track of either existing git
|
25
|
+
repositores or new ones you intend to add.
|
26
|
+
|
27
|
+
There are currently three types of git repositores that can be tracked andupdated:
|
28
|
+
|
29
|
+
1. Regular git repositories.
|
30
|
+
2. Git clones of Subversion repositories
|
31
|
+
3. Git clones of git mirrors of subversion repositories (need to explicity request new tags).
|
32
|
+
|
33
|
+
Here's an example yaml configuration file that tracks the Ruby Gems `aasm`, and `builder`.
|
34
|
+
Normally the master branch is fetched hower the specifiction for thr `builder` gem indicates that
|
35
|
+
the `trunk` branch should be checked out and tracked.In addition the `arduino` project which
|
36
|
+
is located in a Subersion repository is checked out as a git clone of a subversion repository.
|
37
|
+
|
38
|
+
file: .tracked-repos.yaml
|
39
|
+
|
40
|
+
---
|
41
|
+
:git:
|
42
|
+
- :path: aasm
|
43
|
+
:remote: http://github.com/rubyist/aasm.git
|
44
|
+
- :path: buildr
|
45
|
+
:branch: trunk
|
46
|
+
:remote: git://github.com/apache/buildr.git
|
47
|
+
:git_svn:
|
48
|
+
- :path: arduino
|
49
|
+
:remote: http://arduino.googlecode.com/svn
|
50
|
+
:git_clones_of_git_clones_of_svn_repos:
|
51
|
+
- :path: ruby
|
52
|
+
:branch: trunk
|
53
|
+
:remote: git://github.com/ruby/ruby.git
|
54
|
+
|
55
|
+
The last item in the list specifies that the source code for Ruby should be checked out. In
|
56
|
+
this case it is being cloned from a git repository on github which is a miirror of the main
|
57
|
+
Ruby Subversion repository. This tpe if differentiated from a normal git repository because an
|
58
|
+
additional action is taken to manually fetch any updated tags.
|
59
|
+
|
60
|
+
HEREDOC
|
61
|
+
end
|
metadata
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: trackrepos
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Stephen Bannasch
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-06-10 00:00:00.000000000 Z
|
13
|
+
dependencies: []
|
14
|
+
description: Uses yaml configuration files to track and update collections of external
|
15
|
+
git repositories
|
16
|
+
email:
|
17
|
+
- sbannasch@concord.org
|
18
|
+
executables:
|
19
|
+
- trackrepos
|
20
|
+
extensions: []
|
21
|
+
extra_rdoc_files: []
|
22
|
+
files:
|
23
|
+
- .gitignore
|
24
|
+
- Gemfile
|
25
|
+
- LICENSE
|
26
|
+
- README.md
|
27
|
+
- Rakefile
|
28
|
+
- bin/trackrepos
|
29
|
+
- lib/trackrepos.rb
|
30
|
+
- lib/trackrepos/repos.rb
|
31
|
+
- lib/trackrepos/version.rb
|
32
|
+
- trackrepos.gemspec
|
33
|
+
homepage: https://github.com/concord-consortium/trackrepos
|
34
|
+
licenses: []
|
35
|
+
post_install_message: ! "\ntrackrepos\n\nCreate a '.tracked-repos.yaml' file to update
|
36
|
+
and keep track of either existing git\nrepositores or new ones you intend to add.\n\nThere
|
37
|
+
are currently three types of git repositores that can be tracked andupdated:\n\n1.
|
38
|
+
Regular git repositories.\n2. Git clones of Subversion repositories\n3. Git clones
|
39
|
+
of git mirrors of subversion repositories (need to explicity request new tags).\n\nHere's
|
40
|
+
an example yaml configuration file that tracks the Ruby Gems `aasm`, and `builder`.\nNormally
|
41
|
+
the master branch is fetched hower the specifiction for thr `builder` gem indicates
|
42
|
+
that\nthe `trunk` branch should be checked out and tracked.In addition the `arduino`
|
43
|
+
project which\nis located in a Subersion repository is checked out as a git clone
|
44
|
+
of a subversion repository.\n\nfile: .tracked-repos.yaml\n\n ---\n :git:\n
|
45
|
+
\ - :path: aasm\n :remote: http://github.com/rubyist/aasm.git\n - :path:
|
46
|
+
buildr\n :branch: trunk\n :remote: git://github.com/apache/buildr.git\n
|
47
|
+
\ :git_svn:\n - :path: arduino\n :remote: http://arduino.googlecode.com/svn\n
|
48
|
+
\ :git_clones_of_git_clones_of_svn_repos:\n - :path: ruby\n :branch: trunk\n
|
49
|
+
\ :remote: git://github.com/ruby/ruby.git\n\nThe last item in the list specifies
|
50
|
+
that the source code for Ruby should be checked out. In\nthis case it is being cloned
|
51
|
+
from a git repository on github which is a miirror of the main\nRuby Subversion
|
52
|
+
repository. This tpe if differentiated from a normal git repository because an\nadditional
|
53
|
+
action is taken to manually fetch any updated tags.\n\n"
|
54
|
+
rdoc_options: []
|
55
|
+
require_paths:
|
56
|
+
- lib
|
57
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
59
|
+
requirements:
|
60
|
+
- - ! '>='
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
63
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
64
|
+
none: false
|
65
|
+
requirements:
|
66
|
+
- - ! '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
requirements: []
|
70
|
+
rubyforge_project:
|
71
|
+
rubygems_version: 1.8.24
|
72
|
+
signing_key:
|
73
|
+
specification_version: 3
|
74
|
+
summary: Useful for tracking large numbers of external git repositories
|
75
|
+
test_files: []
|