Skip to content

Commit

Permalink
Merge branch 'console-jenkins-link'
Browse files Browse the repository at this point in the history
  • Loading branch information
jspahrsummers committed Aug 24, 2012
2 parents 78560f9 + 036b73d commit 150542a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lib/janky/build.rb
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,9 @@ def room_name
class << self
# The full URL of the web app as a String, including the protocol.
attr_accessor :base_url

# The full URL to the Jenkins build page, as a String.
attr_reader :url
end

# URL of this build's web page, served by Janky::App.
Expand Down
3 changes: 2 additions & 1 deletion lib/janky/templates/console.mustache
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<p>
<a href="{{ repo_path }}">{{ repo_name }}</a>/<a href="{{ branch_path }}">{{ branch_name }}</a>/<a href="{{ commit_url }}">{{ commit_short_sha }}</a>
<a href="{{ repo_path }}">{{ repo_name }}</a>/<a href="{{ branch_path }}">{{ branch_name }}</a>/<a href="{{ commit_url }}">{{ commit_short_sha }}</a><br />
<a href="{{ jenkins_url }}">{{ jenkins_url }}</a>
</p>
<pre>{{ output }}</pre>
4 changes: 4 additions & 0 deletions lib/janky/views/console.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ def commit_short_sha
def output
@build.output
end

def jenkins_url
@build.url
end
end
end
end
3 changes: 3 additions & 0 deletions test/janky_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -341,5 +341,8 @@ def setup
Janky::Builder.complete!

assert_equal "http://localhost:9393/1/output", Janky::Build.last.web_url

build_page = Janky::Build.last.repo_job_name + "/" + Janky::Build.last.number + "/"
assert_equal "http://localhost:8080/job/" + build_page, Janky::Build.last.url
end
end

0 comments on commit 150542a

Please sign in to comment.