integrity-integrity 0.1.9.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) hide show
  1. data/.gitignore +12 -0
  2. data/CHANGES +48 -0
  3. data/README.md +82 -0
  4. data/Rakefile +58 -0
  5. data/bin/integrity +4 -0
  6. data/config/config.sample.ru +21 -0
  7. data/config/config.sample.yml +45 -0
  8. data/config/heroku/.gems +1 -0
  9. data/config/heroku/Rakefile +6 -0
  10. data/config/heroku/config.ru +7 -0
  11. data/config/heroku/integrity-config.rb +15 -0
  12. data/config/thin.sample.yml +13 -0
  13. data/integrity.gemspec +136 -0
  14. data/lib/integrity.rb +77 -0
  15. data/lib/integrity/app.rb +138 -0
  16. data/lib/integrity/author.rb +39 -0
  17. data/lib/integrity/build.rb +52 -0
  18. data/lib/integrity/commit.rb +60 -0
  19. data/lib/integrity/core_ext/object.rb +6 -0
  20. data/lib/integrity/helpers.rb +15 -0
  21. data/lib/integrity/helpers/authorization.rb +33 -0
  22. data/lib/integrity/helpers/breadcrumbs.rb +20 -0
  23. data/lib/integrity/helpers/pretty_output.rb +45 -0
  24. data/lib/integrity/helpers/rendering.rb +49 -0
  25. data/lib/integrity/helpers/resources.rb +19 -0
  26. data/lib/integrity/helpers/urls.rb +59 -0
  27. data/lib/integrity/installer.rb +145 -0
  28. data/lib/integrity/migrations.rb +151 -0
  29. data/lib/integrity/notifier.rb +44 -0
  30. data/lib/integrity/notifier/base.rb +74 -0
  31. data/lib/integrity/notifier/test.rb +52 -0
  32. data/lib/integrity/notifier/test/fixtures.rb +108 -0
  33. data/lib/integrity/notifier/test/hpricot_matcher.rb +38 -0
  34. data/lib/integrity/project.rb +93 -0
  35. data/lib/integrity/project/notifiers.rb +31 -0
  36. data/lib/integrity/project/push.rb +43 -0
  37. data/lib/integrity/project_builder.rb +56 -0
  38. data/lib/integrity/scm.rb +19 -0
  39. data/lib/integrity/scm/git.rb +84 -0
  40. data/lib/integrity/scm/git/uri.rb +57 -0
  41. data/public/buttons.css +82 -0
  42. data/public/reset.css +7 -0
  43. data/public/spinner.gif +0 -0
  44. data/test/acceptance/api_test.rb +97 -0
  45. data/test/acceptance/browse_project_builds_test.rb +65 -0
  46. data/test/acceptance/browse_project_test.rb +99 -0
  47. data/test/acceptance/build_notifications_test.rb +114 -0
  48. data/test/acceptance/create_project_test.rb +97 -0
  49. data/test/acceptance/delete_project_test.rb +53 -0
  50. data/test/acceptance/edit_project_test.rb +117 -0
  51. data/test/acceptance/error_page_test.rb +21 -0
  52. data/test/acceptance/installer_test.rb +81 -0
  53. data/test/acceptance/manual_build_project_test.rb +82 -0
  54. data/test/acceptance/not_found_page_test.rb +29 -0
  55. data/test/acceptance/project_syndication_test.rb +30 -0
  56. data/test/acceptance/stylesheet_test.rb +26 -0
  57. data/test/acceptance/unauthorized_page_test.rb +20 -0
  58. data/test/helpers.rb +75 -0
  59. data/test/helpers/acceptance.rb +82 -0
  60. data/test/helpers/acceptance/email_notifier.rb +52 -0
  61. data/test/helpers/acceptance/git_helper.rb +99 -0
  62. data/test/helpers/acceptance/notifier_helper.rb +47 -0
  63. data/test/helpers/acceptance/textfile_notifier.rb +26 -0
  64. data/test/helpers/expectations.rb +4 -0
  65. data/test/helpers/expectations/be_a.rb +23 -0
  66. data/test/helpers/expectations/change.rb +90 -0
  67. data/test/helpers/expectations/have.rb +105 -0
  68. data/test/helpers/expectations/predicates.rb +37 -0
  69. data/test/helpers/initial_migration_fixture.sql +44 -0
  70. data/test/unit/build_test.rb +72 -0
  71. data/test/unit/commit_test.rb +66 -0
  72. data/test/unit/helpers_test.rb +103 -0
  73. data/test/unit/integrity_test.rb +35 -0
  74. data/test/unit/migrations_test.rb +57 -0
  75. data/test/unit/notifier/base_test.rb +43 -0
  76. data/test/unit/notifier_test.rb +96 -0
  77. data/test/unit/project_builder_test.rb +118 -0
  78. data/test/unit/project_test.rb +344 -0
  79. data/test/unit/scm_test.rb +54 -0
  80. data/views/_commit_info.haml +24 -0
  81. data/views/build.haml +2 -0
  82. data/views/error.haml +37 -0
  83. data/views/home.haml +21 -0
  84. data/views/integrity.sass +400 -0
  85. data/views/layout.haml +29 -0
  86. data/views/new.haml +50 -0
  87. data/views/not_found.haml +31 -0
  88. data/views/notifier.haml +7 -0
  89. data/views/project.builder +21 -0
  90. data/views/project.haml +30 -0
  91. data/views/unauthorized.haml +38 -0
  92. metadata +323 -0
data/.gitignore ADDED
@@ -0,0 +1,12 @@
1
+ log/*.log
2
+ config/thin.yml
3
+ config/deploy.rb
4
+ config/config.yml
5
+ dist
6
+ coverage
7
+ integrity.db
8
+ exports
9
+ *.gem
10
+ *.swp
11
+ .aggregated_coverage_report
12
+ tmp/
data/CHANGES ADDED
@@ -0,0 +1,48 @@
1
+ 0.1.9.4 / unreleased
2
+ ====================
3
+
4
+ * Fix that notifications are sent to every notifiers,
5
+ including disabled ones
6
+
7
+ 0.1.9.3 / 2009-04-06
8
+ ====================
9
+
10
+ * Fix one more URL issue
11
+ * Fix that notifiers are always enabled
12
+ * Fix for when the commit identifier can't be retrieved
13
+ * Fix the schema to accept NULL commit author and message
14
+ * Upgrade to DataMapper 0.9.11
15
+ * Remove all of deprecation code, except on Notifier::Base
16
+ * Notifiers were refactored and now require to be registered:
17
+ Integrity.register(Integrity::Notifier::IRC)
18
+ * The installer do not migrate the database automagically after
19
+ a successful install anymore
20
+
21
+ 0.1.9.2 / 2009-03-28
22
+ ====================
23
+
24
+ * Add development dependencies to gemspec
25
+ * Fix and improve deprecation (Josh Nichols)
26
+ * Fix a typo in post install message (Josh Nichols)
27
+ * Fix URLs issues (hopefully)
28
+ * Calculate URLs using base_uri option instead of the request.url
29
+ * Fix and use the URLs generation helpers in views. (Will Leinweber)
30
+ * Depend on sinatra-authorization (which has no dependency) instead
31
+ of sinatra-ditties.
32
+ * Use [mg](http://github.com/sr/mg) to manage release
33
+ * Various tweaks to the bootstraping Rake tasks. I am not happy
34
+ with them, though.
35
+ <http://integrity.lighthouseapp.com/projects/14308/tickets/126>
36
+
37
+ 0.1.9.1 / 2009-03-16
38
+ ====================
39
+
40
+ * Add the Integrity::Notifier::Test mixin, aimed at helping
41
+ writing test for notifiers.
42
+ NOTE: The API is not fixed yet. See the following ticket
43
+ <http://integrity.lighthouseapp.com/projects/14308-integrity/tickets/130>
44
+ * Add support for Heroku as a deployment option
45
+ * Fix the installer to work with the current Thor gem
46
+
47
+
48
+ (There is no changelog for previous release)
data/README.md ADDED
@@ -0,0 +1,82 @@
1
+ Integrity
2
+ =========
3
+
4
+ [Integrity][website] is your friendly automated Continuous Integration server.
5
+
6
+ * See our [website][] for documentation and a [live demo][demo]
7
+ * Report bugs and submit features request on our [Lighthouse account][lighthouse]
8
+ * Join us on [#integrity][irc-channel] for ideas, help, patches or something
9
+ * Get the code on [GitHub][repo]
10
+
11
+ Try it!
12
+ -------
13
+
14
+ $ git clone git://github.com/foca/integrity.git
15
+ $ rake launch
16
+ # Navigate to <http://0.0.0.0:4567>
17
+
18
+ Run the test suite
19
+ ------------------
20
+
21
+ 1. Ensure you have `gems.github.com` in your gem sources:
22
+ `gem sources -a http://gems.github.com`
23
+ 2. Install the runtime and development dependencies:
24
+ `gem build integrity.gemspec && gem install *.gem --development`.
25
+ 3. Run the test suite: `rake test`
26
+
27
+ Thanks
28
+ ------
29
+
30
+ Thanks to the following people for their feedbacks, ideas and patches :
31
+
32
+ * [James Adam][james]
33
+ * [Elliott Cable][ec]
34
+ * [Corey Donohoe][atmos]
35
+ * [Kyle Hargraves][kyle]
36
+ * [Pier-Hugues Pellerin][ph]
37
+ * [Simon Rozet][sr]
38
+ * [Scott Taylor][scott]
39
+
40
+ License
41
+ -------
42
+
43
+ (The MIT License)
44
+
45
+ Copyright (c) 2008 [Nicolás Sanguinetti][foca], [entp][]
46
+
47
+ Permission is hereby granted, free of charge, to any person obtaining
48
+ a copy of this software and associated documentation files (the
49
+ 'Software'), to deal in the Software without restriction, including
50
+ without limitation the rights to use, copy, modify, merge, publish,
51
+ distribute, sublicense, and/or sell copies of the Software, and to
52
+ permit persons to whom the Software is furnished to do so, subject to
53
+ the following conditions:
54
+
55
+ The above copyright notice and this permission notice shall be
56
+ included in all copies or substantial portions of the Software.
57
+
58
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
59
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
60
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
61
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
62
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
63
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
64
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
65
+
66
+ [website]: http://integrityapp.com
67
+ [demo]: http://builder.integrityapp.com
68
+ [repo]: http://github.com/foca/integrity
69
+ [lighthouse]: http://integrity.lighthouseapp.com/projects/14308-integrity
70
+ [irc-channel]: irc://irc.freenode.net/integrity
71
+
72
+ [foca]: http://nicolassanguinetti.info/
73
+ [entp]: http://entp.com
74
+
75
+ [james]: http://github.com/lazyatom
76
+ [ec]: http://github.com/elliotcabble
77
+ [atmos]: http://github.com/atmos
78
+ [kyle]: http://github.com/pd
79
+ [ph]: http://github.com/ph
80
+ [sr]: http://purl.org/net/sr/
81
+ [scott]: http://github.com/smtlaissezfaire
82
+
data/Rakefile ADDED
@@ -0,0 +1,58 @@
1
+ require "rake/testtask"
2
+
3
+ def spec
4
+ @spec ||= begin
5
+ require "rubygems/specification"
6
+ eval(File.read("integrity.gemspec"))
7
+ end
8
+ end
9
+
10
+ desc "Default: run all tests"
11
+ task :default => :test
12
+
13
+ desc "Launch Integrity real quick"
14
+ task :launch do
15
+ ruby "bin/integrity launch"
16
+ end
17
+
18
+ desc "Run tests"
19
+ task :test => %w(test:units test:acceptance)
20
+ namespace :test do
21
+ desc "Run unit tests"
22
+ Rake::TestTask.new(:units) do |t|
23
+ t.test_files = FileList["test/unit/*_test.rb"]
24
+ end
25
+
26
+ desc "Run acceptance tests"
27
+ Rake::TestTask.new(:acceptance) do |t|
28
+ t.test_files = FileList["test/acceptance/*_test.rb"]
29
+ end
30
+ end
31
+
32
+ desc "Special task for running tests on <http://builder.integrityapp.com>"
33
+ task :ci do
34
+ require "metric_fu"
35
+
36
+ Rake::Task["test"].invoke
37
+
38
+ metrics = %w(flay flog:all reek roodi saikuro)
39
+ metrics.each { |m| Rake::Task["metrics:#{m}"].invoke }
40
+
41
+ rm_rf "/var/www/integrity-metrics"
42
+ mv "tmp/metric_fu", "/var/www/integrity-metrics"
43
+
44
+ File.open("/var/www/integrity-metrics/index.html", "w") { |f|
45
+ f.puts "<ul>"
46
+ metrics.map { |m| m.split(":").first }.each { |m|
47
+ f.puts %Q(<li><a href="/#{m}">#{m}</a></li>)
48
+ }
49
+ f.puts "</ul>"
50
+ }
51
+ end
52
+
53
+ begin
54
+ require "mg"
55
+ MG.new("integrity.gemspec")
56
+ rescue LoadError
57
+ end
58
+
data/bin/integrity ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + "/../lib/integrity/installer"
3
+
4
+ Integrity::Installer.start
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env ruby
2
+ require "rubygems"
3
+ require "integrity"
4
+
5
+ # If you want to add any notifiers, install the gems and then require them here
6
+ # For example, to enable the Email notifier: install the gem (from github:
7
+ #
8
+ # sudo gem install -s http://gems.github.com foca-integrity-email
9
+ #
10
+ # And then uncomment the following line:
11
+ #
12
+ # require "notifier/email"
13
+
14
+ # Load configuration and initialize Integrity
15
+ Integrity.new(File.dirname(__FILE__) + "/config.yml")
16
+
17
+ # You probably don't want to edit anything below
18
+ Integrity::App.set :environment, ENV["RACK_ENV"] || :production
19
+ Integrity::App.set :port, 8910
20
+
21
+ run Integrity::App
@@ -0,0 +1,45 @@
1
+ # Domain where integrity will be running from. This is used to have
2
+ # nice URLs in your notifications.
3
+ # For example:
4
+ # http://builder.integrityapp.com
5
+ :base_uri: http://integrity.domain.tld
6
+
7
+ # This should be a complete connection string to your database.
8
+ #
9
+ # Examples:
10
+ # * `mysql://user:password@localhost/integrity`
11
+ # * `postgres://user:password@localhost/integrity`
12
+ # * `sqlite3:///home/integrity/db/integrity.sqlite`
13
+ #
14
+ # Note:
15
+ # * The appropriate data_objects adapter must be installed (`do_mysql`, etc)
16
+ # * You must create the `integrity` database on localhost, of course.
17
+ :database_uri: sqlite3:///var/integrity.db
18
+
19
+ # This is where your project's code will be checked out to. Make sure it's
20
+ # writable by the user that runs Integrity.
21
+ :export_directory: /path/to/scm/exports
22
+
23
+ # Path to the integrity log file
24
+ :log: /var/log/integrity.log
25
+
26
+ # If set to true integrity will do a build for each commit. Otherwise
27
+ # it will only do a build for each set of commits (i.e. each push)
28
+ :build_all_commits: true
29
+
30
+ # Enable or disable HTTP authentication for the app. BE AWARE that if you
31
+ # disable this anyone can delete and alter projects, so do it only if your
32
+ # app is running in a controlled environment (ie, behind your company's
33
+ # firewall.)
34
+ :use_basic_auth: false
35
+
36
+ # When `use_basic_auth` is true, the admin's username for HTTP authentication.
37
+ :admin_username: username
38
+
39
+ # When `use_basic_auth` is true, the admin's password. Usually saved as a
40
+ # SHA1 hash. See the next option.
41
+ :admin_password: a94a8fe5ccb19ba61c4c0873d391e987982fbbd3
42
+
43
+ # If this is true, then whenever we authenticate the admin user, will hash
44
+ # it using SHA1. If not, we'll assume the provided password is in plain text.
45
+ :hash_admin_password: true
@@ -0,0 +1 @@
1
+ integrity --version 0.1.9.3
@@ -0,0 +1,6 @@
1
+ desc "Create the Integrity database"
2
+ task "db:migrate" do
3
+ require File.dirname(__FILE__) + "/integrity-config"
4
+
5
+ DataMapper.auto_migrate!
6
+ end
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + "/integrity-config"
3
+
4
+ Integrity::App.set(:environment, ENV["RACK_ENV"] || :production)
5
+ Integrity::App.disable(:run, :reload)
6
+ run Integrity::App
7
+
@@ -0,0 +1,15 @@
1
+ require "rubygems"
2
+ gem "integrity"
3
+ require "integrity"
4
+
5
+ Integrity.config = {
6
+ :base_uri => nil, # Edit this! Like :base_uri => 'http://awesome-subdomain-13.heroku.com'
7
+ :database_uri => ENV["DATABASE_URL"],
8
+ :export_directory => File.dirname(__FILE__) + "/tmp",
9
+ :log => File.dirname(__FILE__) + "/log/integrity.log",
10
+ # Uncomment to setup a password
11
+ # :admin_usenrame => "admin",
12
+ # :admin_password => "foobar"
13
+ }
14
+
15
+ Integrity.new
@@ -0,0 +1,13 @@
1
+ ---
2
+ environment: production
3
+ chdir: /apps/integrity
4
+ address: 127.0.0.1
5
+ port: 8910
6
+ pid: /apps/integrity/thin.pid
7
+ rackup: /apps/integrity/config.ru
8
+ log: /apps/integrity/log/thin.log
9
+ max_conns: 1024
10
+ timeout: 30
11
+ max_persistent_conns: 512
12
+ daemonize: true
13
+ servers: 2
data/integrity.gemspec ADDED
@@ -0,0 +1,136 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = "integrity"
3
+ s.version = "0.1.9.3"
4
+ s.date = "2009-04-06"
5
+
6
+ s.description = "Your Friendly Continuous Integration server. Easy, fun and painless!"
7
+ s.summary = "The easy and fun Continuous Integration server"
8
+ s.homepage = "http://integrityapp.com"
9
+
10
+ s.authors = ["Nicolás Sanguinetti", "Simon Rozet"]
11
+ s.email = "info@integrityapp.com"
12
+
13
+ s.require_paths = ["lib"]
14
+ s.executables = ["integrity"]
15
+
16
+ s.post_install_message = "Run `integrity help` for information on how to setup Integrity."
17
+ s.rubyforge_project = "integrity"
18
+ s.has_rdoc = false
19
+ s.rubygems_version = "1.3.1"
20
+
21
+ s.add_dependency "sinatra", [">= 0.9.1.1"]
22
+ s.add_dependency "sinatra-authorization"
23
+ s.add_dependency "haml", [">= 2.0.0"]
24
+ s.add_dependency "data_mapper", ["= 0.9.11"]
25
+ s.add_dependency "uuidtools" # required by dm-types
26
+ s.add_dependency "bcrypt-ruby" # required by dm-types
27
+ s.add_dependency "json"
28
+ s.add_dependency "thor"
29
+
30
+ if s.respond_to?(:add_development_dependency)
31
+ s.add_development_dependency "rr"
32
+ s.add_development_dependency "mocha"
33
+ s.add_development_dependency "webrat"
34
+ s.add_development_dependency "do_sqlite3"
35
+ s.add_development_dependency "dm-sweatshop"
36
+ s.add_development_dependency "ParseTree" # required by dm-sweatshop
37
+ s.add_development_dependency "jeremymcanally-context"
38
+ s.add_development_dependency "jeremymcanally-matchy"
39
+ s.add_development_dependency "jeremymcanally-pending"
40
+ s.add_development_dependency "foca-storyteller"
41
+ end
42
+
43
+ s.files = %w[
44
+ .gitignore
45
+ CHANGES
46
+ README.md
47
+ Rakefile
48
+ bin/integrity
49
+ config/config.sample.ru
50
+ config/config.sample.yml
51
+ config/heroku/.gems
52
+ config/heroku/Rakefile
53
+ config/heroku/config.ru
54
+ config/heroku/integrity-config.rb
55
+ config/thin.sample.yml
56
+ integrity.gemspec
57
+ lib/integrity.rb
58
+ lib/integrity/app.rb
59
+ lib/integrity/author.rb
60
+ lib/integrity/build.rb
61
+ lib/integrity/commit.rb
62
+ lib/integrity/core_ext/object.rb
63
+ lib/integrity/helpers.rb
64
+ lib/integrity/helpers/authorization.rb
65
+ lib/integrity/helpers/breadcrumbs.rb
66
+ lib/integrity/helpers/pretty_output.rb
67
+ lib/integrity/helpers/rendering.rb
68
+ lib/integrity/helpers/resources.rb
69
+ lib/integrity/helpers/urls.rb
70
+ lib/integrity/installer.rb
71
+ lib/integrity/migrations.rb
72
+ lib/integrity/notifier.rb
73
+ lib/integrity/notifier/base.rb
74
+ lib/integrity/notifier/test.rb
75
+ lib/integrity/notifier/test/fixtures.rb
76
+ lib/integrity/notifier/test/hpricot_matcher.rb
77
+ lib/integrity/project.rb
78
+ lib/integrity/project/notifiers.rb
79
+ lib/integrity/project/push.rb
80
+ lib/integrity/project_builder.rb
81
+ lib/integrity/scm.rb
82
+ lib/integrity/scm/git.rb
83
+ lib/integrity/scm/git/uri.rb
84
+ public/buttons.css
85
+ public/reset.css
86
+ public/spinner.gif
87
+ test/acceptance/api_test.rb
88
+ test/acceptance/browse_project_builds_test.rb
89
+ test/acceptance/browse_project_test.rb
90
+ test/acceptance/build_notifications_test.rb
91
+ test/acceptance/create_project_test.rb
92
+ test/acceptance/delete_project_test.rb
93
+ test/acceptance/edit_project_test.rb
94
+ test/acceptance/error_page_test.rb
95
+ test/acceptance/installer_test.rb
96
+ test/acceptance/manual_build_project_test.rb
97
+ test/acceptance/not_found_page_test.rb
98
+ test/acceptance/project_syndication_test.rb
99
+ test/acceptance/stylesheet_test.rb
100
+ test/acceptance/unauthorized_page_test.rb
101
+ test/helpers.rb
102
+ test/helpers/acceptance.rb
103
+ test/helpers/acceptance/email_notifier.rb
104
+ test/helpers/acceptance/git_helper.rb
105
+ test/helpers/acceptance/notifier_helper.rb
106
+ test/helpers/acceptance/textfile_notifier.rb
107
+ test/helpers/expectations.rb
108
+ test/helpers/expectations/be_a.rb
109
+ test/helpers/expectations/change.rb
110
+ test/helpers/expectations/have.rb
111
+ test/helpers/expectations/predicates.rb
112
+ test/helpers/initial_migration_fixture.sql
113
+ test/unit/build_test.rb
114
+ test/unit/commit_test.rb
115
+ test/unit/helpers_test.rb
116
+ test/unit/integrity_test.rb
117
+ test/unit/migrations_test.rb
118
+ test/unit/notifier/base_test.rb
119
+ test/unit/notifier_test.rb
120
+ test/unit/project_builder_test.rb
121
+ test/unit/project_test.rb
122
+ test/unit/scm_test.rb
123
+ views/_commit_info.haml
124
+ views/build.haml
125
+ views/error.haml
126
+ views/home.haml
127
+ views/integrity.sass
128
+ views/layout.haml
129
+ views/new.haml
130
+ views/not_found.haml
131
+ views/notifier.haml
132
+ views/project.builder
133
+ views/project.haml
134
+ views/unauthorized.haml
135
+ ]
136
+ end