bantic-integrity 0.1.4.2 → 0.1.4.3

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/app.rb CHANGED
@@ -123,7 +123,7 @@ post "/:project/builds" do
123
123
  login_required
124
124
 
125
125
  current_project.build
126
- redirect project_url(@project)
126
+ redirect "/"
127
127
  end
128
128
 
129
129
  get '/:project/builds/:build' do
data/integrity.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = %q{integrity}
3
- s.version = "0.1.4.2"
3
+ s.version = "0.1.4.3"
4
4
 
5
5
 
6
6
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
@@ -10,11 +10,17 @@ module Integrity
10
10
  @branch = project.branch
11
11
  @scm = SCM.new(@uri, @branch, export_directory)
12
12
  @build = Build.new(:project => project)
13
+ @project = project
13
14
  end
14
15
 
15
16
  def build(commit)
16
17
  Integrity.log "Building #{commit} (#{@branch}) of #{@build.project.name} in #{export_directory} using #{scm_name}"
17
- @scm.with_revision(commit) { run_build_script }
18
+ @scm.with_revision(commit) {
19
+ @project.update_attributes(:shortened_current_commit_msg => @scm.commit_metadata(commit)[:message][0..40])
20
+ @project.update_attributes(:current_commit_identifier => @scm.commit_identifier(commit)[0..6])
21
+
22
+ run_build_script
23
+ }
18
24
  @build
19
25
  ensure
20
26
  @build.commit_identifier = @scm.commit_identifier(commit)
@@ -10,6 +10,8 @@ module Integrity
10
10
  property :command, String, :nullable => false, :length => 255, :default => "rake"
11
11
  property :public, Boolean, :default => true
12
12
  property :started_build_at, DateTime
13
+ property :shortened_current_commit_msg, String
14
+ property :current_commit_identifier, String
13
15
  property :created_at, DateTime
14
16
  property :updated_at, DateTime
15
17
 
@@ -24,6 +26,8 @@ module Integrity
24
26
  def build(commit_identifier="HEAD")
25
27
  return if building?
26
28
  update_attributes(:started_build_at => Time.now)
29
+ update_attributes(:current_commit_identifier => "unknown commit id")
30
+ update_attributes(:shortened_current_commit_msg => "unknown msg")
27
31
  Thread.new(self) do |project|
28
32
  begin
29
33
  Builder.new(project).build(commit_identifier)
data/views/home.haml CHANGED
@@ -11,16 +11,16 @@
11
11
  %li{ :class => cycle("even", "odd") + (project.building? ? ' building' : '') + (project.last_build ? (project.last_build.successful? ? ' success' : ' failed') : '') }
12
12
  %a{ :href => project_url(project) }&= project.name
13
13
  .meta
14
- - last_build = project.last_build
15
- - short_commit_identifier = last_build ? last_build.short_commit_identifier : "unknown commit"
16
- - commit_message = last_build ? last_build.commit_message : "unknown commit message"
17
- - shortened_commit_message = commit_message ? commit_message.slice(0,40) + "..." : "unknown commit message"
14
+
15
+ - short_commit_identifier = project.current_commit_identifier ? project.current_commit_identifier : "unknown commit id"
16
+ - shortened_commit_message = project.shortened_current_commit_msg + "..."
17
+
18
18
  - if project.building?
19
- = "Building #{short_commit_identifier} (#{shortened_commit_message}) for #{pretty_time_since(project.started_build_at)}"
19
+ = "Building <b>#{short_commit_identifier}</b> (#{shortened_commit_message}) for #{pretty_time_since(project.started_build_at)}"
20
20
  - elsif project.last_build.nil?
21
21
  Never built yet
22
22
  - else
23
- = "Built #{short_commit_identifier} (#{shortened_commit_message}) "
23
+ = "Built <b>#{short_commit_identifier}</b> (#{shortened_commit_message}) "
24
24
  = project.last_build.successful? ? "successfully" : "and failed"
25
25
  %p#new
26
26
  %a{ :href => "/new" } Add a new project
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bantic-integrity
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4.2
4
+ version: 0.1.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - "Nicol\xC3\xA1s Sanguinetti"