bkoski-integrity-watcher 0.5.0
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 +18 -0
- data/README.rdoc +35 -0
- data/bin/integrity-watcher +60 -0
- metadata +56 -0
data/LICENSE
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
2
|
+
a copy of this software and associated documentation files (the
|
3
|
+
"Software"), to deal in the Software without restriction, including
|
4
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
5
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
6
|
+
permit persons to whom the Software is furnished to do so, subject to
|
7
|
+
the following conditions:
|
8
|
+
|
9
|
+
The above copyright notice and this permission notice shall be
|
10
|
+
included in all copies or substantial portions of the Software.
|
11
|
+
|
12
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
13
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
14
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
15
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
16
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
17
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
18
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
= integrity-watcher
|
2
|
+
|
3
|
+
integrity-watcher makes it easy to build your integrityapp projects from the command line
|
4
|
+
(or a cron).
|
5
|
+
|
6
|
+
This is just a gemified generalization of iamruinous' integrity-subversion-watcher[http://github.com/iamruinous/integrity-subversion-watcher/tree/master].
|
7
|
+
|
8
|
+
== INSTALLATION
|
9
|
+
|
10
|
+
sudo gem install bkoski-integrity-watcher
|
11
|
+
|
12
|
+
<tt>integrity-watcher</tt> should now be in your path.
|
13
|
+
|
14
|
+
== USAGE
|
15
|
+
|
16
|
+
integrity-watcher check PROJECTS --config=/path/to/integrity/config.yml OPTIONS
|
17
|
+
|
18
|
+
<tt>PROJECTS</tt> can be either:
|
19
|
+
|
20
|
+
* a comma-delimited list of project names (<tt>"Project1,Project2"</tt>)
|
21
|
+
* "<tt>all</tt>", which will check all projects in integrity
|
22
|
+
|
23
|
+
==== Options:
|
24
|
+
|
25
|
+
--temp_dir=/some/dir
|
26
|
+
|
27
|
+
A lockfile is written into the temp_dir to prevent multiple watchers from running simultaneously.
|
28
|
+
|
29
|
+
--dependency_loader=/path/to/dependency_loader.rb
|
30
|
+
|
31
|
+
The <tt>dependency_loader</tt> option should point to a file with the <tt>require</tt>s needed to
|
32
|
+
bootstrap integrity. For example, it might contain:
|
33
|
+
|
34
|
+
require "integrity/notifier/email"
|
35
|
+
Integrity::Notifier.register(Integrity::Notifier::Email)
|
@@ -0,0 +1,60 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require "rubygems"
|
3
|
+
require "thor"
|
4
|
+
|
5
|
+
class IntegrityWatcher < Thor
|
6
|
+
include FileUtils
|
7
|
+
|
8
|
+
map "--temp_dir" => :temp_dir
|
9
|
+
|
10
|
+
map "--config" => :config
|
11
|
+
|
12
|
+
map "--dependency_loader" => :dependency_loader
|
13
|
+
|
14
|
+
desc "check",
|
15
|
+
"Checks the latest revision of all integrity projects."
|
16
|
+
method_options(:config => :required,
|
17
|
+
:temp_dir => :optional,
|
18
|
+
:dependency_loader => :optional)
|
19
|
+
def check(projects)
|
20
|
+
temp_dir = options[:temp_dir] ? File.expand_path(options[:temp_dir]) : '/tmp'
|
21
|
+
touchfile = File.join(temp_dir, "integrity-subversion-watcher")
|
22
|
+
raise 'Watcher is already running' if File.exist?(touchfile)
|
23
|
+
|
24
|
+
FileUtils.touch(touchfile)
|
25
|
+
|
26
|
+
begin
|
27
|
+
require 'integrity'
|
28
|
+
Integrity.new(File.expand_path(options[:config]))
|
29
|
+
|
30
|
+
require File.expand_path(options[:dependency_loader]).chomp('.rb') if options[:dependency_loader]
|
31
|
+
|
32
|
+
conditions = {}
|
33
|
+
conditions[:name] = projects.split(',') unless projects == 'all'
|
34
|
+
|
35
|
+
Integrity::Project.all(conditions).each do |project|
|
36
|
+
begin
|
37
|
+
puts "About to build #{project.name}..."
|
38
|
+
project_builder = Integrity::ProjectBuilder.new(project)
|
39
|
+
|
40
|
+
current_revision = project_builder.scm.head
|
41
|
+
latest_build_revision = project.last_commit.identifier.strip
|
42
|
+
if latest_build_revision != current_revision
|
43
|
+
project.build(current_revision)
|
44
|
+
end
|
45
|
+
puts "Build complete."
|
46
|
+
rescue Exception => e
|
47
|
+
STDERR.puts "Exception while building #{project.name}: #{e.class.to_s} #{e.message} \n #{e.backtrace.join("\n")}"
|
48
|
+
end
|
49
|
+
end
|
50
|
+
ensure
|
51
|
+
File.delete(touchfile)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
def config(path)
|
56
|
+
@config = File.expand_path(path)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
IntegrityWatcher.start
|
metadata
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: bkoski-integrity-watcher
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.5.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Ben Koski
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-04-22 00:00:00 -07:00
|
13
|
+
default_executable: integrity-watcher
|
14
|
+
dependencies: []
|
15
|
+
|
16
|
+
description: Build your integrityapp projects from the command line (or cron)
|
17
|
+
email: gems@benkoski.com
|
18
|
+
executables:
|
19
|
+
- integrity-watcher
|
20
|
+
extensions: []
|
21
|
+
|
22
|
+
extra_rdoc_files: []
|
23
|
+
|
24
|
+
files:
|
25
|
+
- bin/integrity-watcher
|
26
|
+
- README.rdoc
|
27
|
+
- LICENSE
|
28
|
+
has_rdoc: true
|
29
|
+
homepage: http://github.com/bkoski/integrity-watcher
|
30
|
+
post_install_message:
|
31
|
+
rdoc_options:
|
32
|
+
- --inline-source
|
33
|
+
- --charset=UTF-8
|
34
|
+
require_paths:
|
35
|
+
- lib
|
36
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: "0"
|
41
|
+
version:
|
42
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: "0"
|
47
|
+
version:
|
48
|
+
requirements: []
|
49
|
+
|
50
|
+
rubyforge_project:
|
51
|
+
rubygems_version: 1.2.0
|
52
|
+
signing_key:
|
53
|
+
specification_version: 2
|
54
|
+
summary: Build your integrityapp projects from the command line (or cron)
|
55
|
+
test_files: []
|
56
|
+
|