Merge pull request #306 from travis-ci/sf-te2
Port changes for enterprise
This commit is contained in:
commit
bc3a6e41df
|
@ -49,7 +49,9 @@ input assets.scripts do
|
||||||
|
|
||||||
match %r(^(?!vendor|spec).*\.js$) do
|
match %r(^(?!vendor|spec).*\.js$) do
|
||||||
modules = proc { |input| input.path.gsub(%r((^app/|lib/|\.js$)), '') }
|
modules = proc { |input| input.path.gsub(%r((^app/|lib/|\.js$)), '') }
|
||||||
minispade(string: assets.development?, rewrite_requires: true, module_id_generator: modules)
|
# why did we use the string strategy for development? makes it impossible to set breakpoints
|
||||||
|
# minispade(string: assets.development?, rewrite_requires: true, module_id_generator: modules)
|
||||||
|
minispade(string: false, rewrite_requires: true, module_id_generator: modules)
|
||||||
end
|
end
|
||||||
|
|
||||||
match %r(^(?!spec).*\.js$) do
|
match %r(^(?!spec).*\.js$) do
|
||||||
|
|
1
Gemfile
1
Gemfile
|
@ -6,6 +6,7 @@ gem 'rack-ssl', '~> 1.3'
|
||||||
gem 'rack-protection', '~> 1.3'
|
gem 'rack-protection', '~> 1.3'
|
||||||
gem 'rack-mobile-detect'
|
gem 'rack-mobile-detect'
|
||||||
gem 'sinatra'
|
gem 'sinatra'
|
||||||
|
gem 'hashr'
|
||||||
|
|
||||||
gem 'rake-pipeline', github: 'livingsocial/rake-pipeline'
|
gem 'rake-pipeline', github: 'livingsocial/rake-pipeline'
|
||||||
gem 'rake-pipeline-web-filters', github: 'wycats/rake-pipeline-web-filters'
|
gem 'rake-pipeline-web-filters', github: 'wycats/rake-pipeline-web-filters'
|
||||||
|
|
143
Gemfile.lock
143
Gemfile.lock
|
@ -1,15 +1,15 @@
|
||||||
GIT
|
GIT
|
||||||
remote: git://github.com/livingsocial/rake-pipeline.git
|
remote: git://github.com/livingsocial/rake-pipeline.git
|
||||||
revision: 65b1e744defa208e313703d89f3453447cc103b2
|
revision: a75d96fbadcc659a35a0ae59212e0bc60b58cc54
|
||||||
specs:
|
specs:
|
||||||
rake-pipeline (0.8.0)
|
rake-pipeline (0.8.0)
|
||||||
json
|
json
|
||||||
rake (~> 10.0.0)
|
rake (~> 10.1.0)
|
||||||
thor
|
thor
|
||||||
|
|
||||||
GIT
|
GIT
|
||||||
remote: git://github.com/wycats/rake-pipeline-web-filters.git
|
remote: git://github.com/wycats/rake-pipeline-web-filters.git
|
||||||
revision: fd8d838491bd6b8de0bab72d90115b9a4f2da8a1
|
revision: 7bd283aac83d7c46a8908f089033a6087d7cd68f
|
||||||
specs:
|
specs:
|
||||||
rake-pipeline-web-filters (0.6.0)
|
rake-pipeline-web-filters (0.6.0)
|
||||||
rack
|
rack
|
||||||
|
@ -18,98 +18,104 @@ GIT
|
||||||
GEM
|
GEM
|
||||||
remote: http://rubygems.org/
|
remote: http://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
POpen4 (0.1.4)
|
backports (3.6.3)
|
||||||
Platform (>= 0.4.0)
|
celluloid (0.16.0)
|
||||||
open4
|
timers (~> 4.0.0)
|
||||||
Platform (0.4.0)
|
chunky_png (1.3.1)
|
||||||
backports (3.0.3)
|
coderay (1.1.0)
|
||||||
celluloid (0.15.2)
|
coffee-script (2.3.0)
|
||||||
timers (~> 1.1.0)
|
|
||||||
chunky_png (1.2.7)
|
|
||||||
coderay (1.0.9)
|
|
||||||
coffee-script (2.2.0)
|
|
||||||
coffee-script-source
|
coffee-script-source
|
||||||
execjs
|
execjs
|
||||||
coffee-script-source (1.5.0)
|
coffee-script-source (1.8.0)
|
||||||
compass (0.12.2)
|
compass (1.0.1)
|
||||||
chunky_png (~> 1.2)
|
chunky_png (~> 1.2)
|
||||||
fssm (>= 0.2.7)
|
compass-core (~> 1.0.1)
|
||||||
sass (~> 3.1)
|
compass-import-once (~> 1.0.5)
|
||||||
diff-lcs (1.2.1)
|
rb-fsevent (>= 0.9.3)
|
||||||
eventmachine (1.0.0)
|
rb-inotify (>= 0.9)
|
||||||
execjs (1.4.0)
|
sass (>= 3.3.13, < 3.5)
|
||||||
|
compass-core (1.0.1)
|
||||||
multi_json (~> 1.0)
|
multi_json (~> 1.0)
|
||||||
ffi (1.9.3)
|
sass (>= 3.3.0, < 3.5)
|
||||||
foreman (0.61.0)
|
compass-import-once (1.0.5)
|
||||||
thor (>= 0.13.6)
|
sass (>= 3.2, < 3.5)
|
||||||
fssm (0.2.10)
|
diff-lcs (1.2.5)
|
||||||
guard (1.6.2)
|
dotenv (0.11.1)
|
||||||
listen (>= 0.6.0)
|
dotenv-deployment (~> 0.0.2)
|
||||||
lumberjack (>= 1.0.2)
|
dotenv-deployment (0.0.2)
|
||||||
pry (>= 0.9.10)
|
execjs (2.2.1)
|
||||||
terminal-table (>= 1.4.3)
|
ffi (1.9.6)
|
||||||
thor (>= 0.14.6)
|
foreman (0.75.0)
|
||||||
json (1.7.7)
|
dotenv (~> 0.11.1)
|
||||||
libv8 (3.16.14.3)
|
thor (~> 0.19.1)
|
||||||
listen (2.7.9)
|
formatador (0.2.5)
|
||||||
|
guard (2.6.1)
|
||||||
|
formatador (>= 0.2.4)
|
||||||
|
listen (~> 2.7)
|
||||||
|
lumberjack (~> 1.0)
|
||||||
|
pry (>= 0.9.12)
|
||||||
|
thor (>= 0.18.1)
|
||||||
|
hashr (0.0.22)
|
||||||
|
hitimes (1.2.2)
|
||||||
|
json (1.8.1)
|
||||||
|
libv8 (3.16.14.7)
|
||||||
|
listen (2.7.11)
|
||||||
celluloid (>= 0.15.2)
|
celluloid (>= 0.15.2)
|
||||||
rb-fsevent (>= 0.9.3)
|
rb-fsevent (>= 0.9.3)
|
||||||
rb-inotify (>= 0.9)
|
rb-inotify (>= 0.9)
|
||||||
lumberjack (1.0.2)
|
lumberjack (1.0.9)
|
||||||
method_source (0.8.1)
|
method_source (0.8.2)
|
||||||
multi_json (1.6.1)
|
multi_json (1.10.1)
|
||||||
open4 (1.3.0)
|
pry (0.10.1)
|
||||||
pry (0.9.12)
|
coderay (~> 1.1.0)
|
||||||
coderay (~> 1.0.5)
|
method_source (~> 0.8.1)
|
||||||
method_source (~> 0.8)
|
|
||||||
slop (~> 3.4)
|
slop (~> 3.4)
|
||||||
puma (2.6.0)
|
puma (2.9.1)
|
||||||
rack (>= 1.1, < 2.0)
|
rack (>= 1.1, < 2.0)
|
||||||
rack (1.5.2)
|
rack (1.5.2)
|
||||||
rack-mobile-detect (0.4.0)
|
rack-mobile-detect (0.4.0)
|
||||||
rack
|
rack
|
||||||
rack-protection (1.3.2)
|
rack-protection (1.5.3)
|
||||||
rack
|
rack
|
||||||
rack-ssl (1.3.3)
|
rack-ssl (1.4.1)
|
||||||
rack
|
rack
|
||||||
rack-test (0.6.2)
|
rack-test (0.6.2)
|
||||||
rack (>= 1.0)
|
rack (>= 1.0)
|
||||||
rake (10.0.3)
|
rake (10.1.1)
|
||||||
rb-fsevent (0.9.3)
|
rb-fsevent (0.9.4)
|
||||||
rb-inotify (0.9.5)
|
rb-inotify (0.9.5)
|
||||||
ffi (>= 0.5.0)
|
ffi (>= 0.5.0)
|
||||||
rerun (0.10.0)
|
rerun (0.10.0)
|
||||||
listen (~> 2.7, >= 2.7.3)
|
listen (~> 2.7, >= 2.7.3)
|
||||||
rspec (2.13.0)
|
rspec (2.99.0)
|
||||||
rspec-core (~> 2.13.0)
|
rspec-core (~> 2.99.0)
|
||||||
rspec-expectations (~> 2.13.0)
|
rspec-expectations (~> 2.99.0)
|
||||||
rspec-mocks (~> 2.13.0)
|
rspec-mocks (~> 2.99.0)
|
||||||
rspec-core (2.13.0)
|
rspec-core (2.99.2)
|
||||||
rspec-expectations (2.13.0)
|
rspec-expectations (2.99.2)
|
||||||
diff-lcs (>= 1.1.3, < 2.0)
|
diff-lcs (>= 1.1.3, < 2.0)
|
||||||
rspec-mocks (2.13.0)
|
rspec-mocks (2.99.2)
|
||||||
sass (3.2.6)
|
sass (3.4.5)
|
||||||
sinatra (1.3.5)
|
sinatra (1.4.5)
|
||||||
rack (~> 1.4)
|
rack (~> 1.4)
|
||||||
rack-protection (~> 1.3)
|
rack-protection (~> 1.4)
|
||||||
tilt (~> 1.3, >= 1.3.3)
|
tilt (~> 1.3, >= 1.3.4)
|
||||||
sinatra-contrib (1.3.2)
|
sinatra-contrib (1.4.2)
|
||||||
backports (>= 2.0)
|
backports (>= 2.0)
|
||||||
eventmachine
|
multi_json
|
||||||
rack-protection
|
rack-protection
|
||||||
rack-test
|
rack-test
|
||||||
sinatra (~> 1.3.0)
|
sinatra (~> 1.4.0)
|
||||||
tilt (~> 1.3)
|
tilt (~> 1.3)
|
||||||
slop (3.4.3)
|
slop (3.6.0)
|
||||||
terminal-table (1.4.5)
|
thor (0.19.1)
|
||||||
thor (0.17.0)
|
tilt (1.4.1)
|
||||||
tilt (1.3.3)
|
timers (4.0.1)
|
||||||
timers (1.1.0)
|
hitimes
|
||||||
uglifier (1.3.0)
|
uglifier (2.5.3)
|
||||||
execjs (>= 0.3.0)
|
execjs (>= 0.3.0)
|
||||||
multi_json (~> 1.0, >= 1.0.2)
|
json (>= 1.8.0)
|
||||||
yui-compressor (0.9.6)
|
yui-compressor (0.12.0)
|
||||||
POpen4 (>= 0.1.4)
|
|
||||||
|
|
||||||
PLATFORMS
|
PLATFORMS
|
||||||
ruby
|
ruby
|
||||||
|
@ -119,6 +125,7 @@ DEPENDENCIES
|
||||||
compass
|
compass
|
||||||
foreman
|
foreman
|
||||||
guard
|
guard
|
||||||
|
hashr
|
||||||
libv8 (~> 3.16.0)
|
libv8 (~> 3.16.0)
|
||||||
puma
|
puma
|
||||||
rack-mobile-detect
|
rack-mobile-detect
|
||||||
|
|
|
@ -43,7 +43,7 @@ unless window.TravisApplication
|
||||||
Travis.SshKey.adapter = Travis.SshKeyAdapter.create()
|
Travis.SshKey.adapter = Travis.SshKeyAdapter.create()
|
||||||
|
|
||||||
@slider = new Travis.Slider()
|
@slider = new Travis.Slider()
|
||||||
@pusher = new Travis.Pusher(Travis.config.pusher_key) if Travis.config.pusher_key
|
@pusher = new Travis.Pusher(key: Travis.config.pusher_key, host: Travis.config.pusher_host) if Travis.config.pusher_key
|
||||||
@tailing = new Travis.Tailing($(window), '#tail', '#log')
|
@tailing = new Travis.Tailing($(window), '#tail', '#log')
|
||||||
@toTop = new Travis.ToTop($(window), '.to-top', '#log-container')
|
@toTop = new Travis.ToTop($(window), '.to-top', '#log-container')
|
||||||
|
|
||||||
|
|
|
@ -109,7 +109,7 @@ window.Auth = Ember.Object.extend
|
||||||
|
|
||||||
expectedOrigin: ->
|
expectedOrigin: ->
|
||||||
endpoint = @get('endpoint')
|
endpoint = @get('endpoint')
|
||||||
if endpoint[0] == '/' then @receivingEnd else endpoint
|
if endpoint[0] == '/' then @receivingEnd else endpoint.match(/^https?:\/\/[^\/]*/)[0]
|
||||||
|
|
||||||
sendToApp: (name) ->
|
sendToApp: (name) ->
|
||||||
# TODO: this is an ugly solution, we need to do one of 2 things:
|
# TODO: this is an ugly solution, we need to do one of 2 things:
|
||||||
|
|
|
@ -86,12 +86,12 @@ require 'config/emoij'
|
||||||
_githubReferenceLink: (reference, current, matched) ->
|
_githubReferenceLink: (reference, current, matched) ->
|
||||||
owner = matched.owner || current.owner
|
owner = matched.owner || current.owner
|
||||||
repo = matched.repo || current.repo
|
repo = matched.repo || current.repo
|
||||||
"<a href=\"https://github.com/#{owner}/#{repo}/issues/#{matched.number}\">#{reference}</a>"
|
"<a href=\"#{Travis.config.source_endpoint}/#{owner}/#{repo}/issues/#{matched.number}\">#{reference}</a>"
|
||||||
|
|
||||||
_githubUserRegexp: new RegExp("\\B@([\\w-]+)", 'g')
|
_githubUserRegexp: new RegExp("\\B@([\\w-]+)", 'g')
|
||||||
|
|
||||||
_githubUserLink: (reference, username) ->
|
_githubUserLink: (reference, username) ->
|
||||||
"<a href=\"https://github.com/#{username}\">#{reference}</a>"
|
"<a href=\"#{Travis.config.source_endpoint}/#{username}\">#{reference}</a>"
|
||||||
|
|
||||||
_githubCommitReferenceRegexp: new RegExp("([\\w-]+)?\\/([\\w-]+)?@([0-9A-Fa-f]+)", 'g')
|
_githubCommitReferenceRegexp: new RegExp("([\\w-]+)?\\/([\\w-]+)?@([0-9A-Fa-f]+)", 'g')
|
||||||
|
|
||||||
|
|
|
@ -3,22 +3,22 @@
|
||||||
"#{Travis.config.api_endpoint}/jobs/#{id}/log.txt?deansi=true"
|
"#{Travis.config.api_endpoint}/jobs/#{id}/log.txt?deansi=true"
|
||||||
|
|
||||||
githubPullRequest: (slug, pullRequestNumber) ->
|
githubPullRequest: (slug, pullRequestNumber) ->
|
||||||
"https://github.com/#{slug}/pull/#{pullRequestNumber}"
|
"#{Travis.config.source_endpoint}/#{slug}/pull/#{pullRequestNumber}"
|
||||||
|
|
||||||
githubCommit: (slug, sha) ->
|
githubCommit: (slug, sha) ->
|
||||||
"https://github.com/#{slug}/commit/#{sha}"
|
"#{Travis.config.source_endpoint}/#{slug}/commit/#{sha}"
|
||||||
|
|
||||||
githubRepo: (slug) ->
|
githubRepo: (slug) ->
|
||||||
"https://github.com/#{slug}"
|
"#{Travis.config.source_endpoint}/#{slug}"
|
||||||
|
|
||||||
githubWatchers: (slug) ->
|
githubWatchers: (slug) ->
|
||||||
"https://github.com/#{slug}/watchers"
|
"#{Travis.config.source_endpoint}/#{slug}/watchers"
|
||||||
|
|
||||||
githubNetwork: (slug) ->
|
githubNetwork: (slug) ->
|
||||||
"https://github.com/#{slug}/network"
|
"#{Travis.config.source_endpoint}/#{slug}/network"
|
||||||
|
|
||||||
githubAdmin: (slug) ->
|
githubAdmin: (slug) ->
|
||||||
"https://github.com/#{slug}/settings/hooks#travis_minibucket"
|
"#{Travis.config.source_endpoint}/#{slug}/settings/hooks#travis_minibucket"
|
||||||
|
|
||||||
statusImage: (slug, branch) ->
|
statusImage: (slug, branch) ->
|
||||||
"#{location.protocol}//#{location.host}/#{slug}.svg" + if branch then "?branch=#{encodeURIComponent(branch)}" else ''
|
"#{location.protocol}//#{location.host}/#{slug}.svg" + if branch then "?branch=#{encodeURIComponent(branch)}" else ''
|
||||||
|
|
|
@ -7,7 +7,7 @@ require 'travis/model'
|
||||||
_reposCount: Ember.attr(Number, key: 'repos_count')
|
_reposCount: Ember.attr(Number, key: 'repos_count')
|
||||||
|
|
||||||
urlGithub: (->
|
urlGithub: (->
|
||||||
"https://github.com/#{@get('login')}"
|
"#{Travis.config.source_endpoint}/#{@get('login')}"
|
||||||
).property()
|
).property()
|
||||||
|
|
||||||
# TODO: maybe it would be good to add a "default" value for Ember.attr
|
# TODO: maybe it would be good to add a "default" value for Ember.attr
|
||||||
|
|
|
@ -16,11 +16,11 @@ require 'travis/model'
|
||||||
).property('ownerName', 'name')
|
).property('ownerName', 'name')
|
||||||
|
|
||||||
urlGithub: (->
|
urlGithub: (->
|
||||||
"https://github.com/#{@get('slug')}"
|
"#{Travis.config.source_endpoint}/#{@get('slug')}"
|
||||||
).property()
|
).property()
|
||||||
|
|
||||||
urlGithubAdmin: (->
|
urlGithubAdmin: (->
|
||||||
"https://github.com/#{@get('slug')}/settings/hooks#travis_minibucket"
|
"#{Travis.config.source_endpoint}/#{@get('slug')}/settings/hooks#travis_minibucket"
|
||||||
).property()
|
).property()
|
||||||
|
|
||||||
toggle: ->
|
toggle: ->
|
||||||
|
|
|
@ -102,8 +102,7 @@ require 'travis/model'
|
||||||
Travis.pusher.unsubscribe "job-#{@get('id')}"
|
Travis.pusher.unsubscribe "job-#{@get('id')}"
|
||||||
|
|
||||||
onStateChange: (->
|
onStateChange: (->
|
||||||
if @get('state') == 'finished' && Travis.pusher
|
@unsubscribe() if @get('state') == 'finished' && Travis.pusher
|
||||||
Travis.pusher.unsubscribe "job-#{@get('id')}"
|
|
||||||
).observes('state')
|
).observes('state')
|
||||||
|
|
||||||
isPropertyLoaded: (key) ->
|
isPropertyLoaded: (key) ->
|
||||||
|
|
|
@ -5,6 +5,7 @@ require 'travis/model'
|
||||||
id: Ember.attr('string')
|
id: Ember.attr('string')
|
||||||
slug: Ember.attr('string')
|
slug: Ember.attr('string')
|
||||||
description: Ember.attr('string')
|
description: Ember.attr('string')
|
||||||
|
private: Ember.attr('boolean')
|
||||||
lastBuildId: Ember.attr('string')
|
lastBuildId: Ember.attr('string')
|
||||||
lastBuildNumber: Ember.attr(Number)
|
lastBuildNumber: Ember.attr(Number)
|
||||||
lastBuildState: Ember.attr('string')
|
lastBuildState: Ember.attr('string')
|
||||||
|
|
|
@ -26,7 +26,7 @@ require 'travis/model'
|
||||||
).observes('isSyncing')
|
).observes('isSyncing')
|
||||||
|
|
||||||
urlGithub: (->
|
urlGithub: (->
|
||||||
"https://github.com/#{@get('login')}"
|
"#{Travis.config.source_endpoint}/#{@get('login')}"
|
||||||
).property()
|
).property()
|
||||||
|
|
||||||
_rawPermissions: (->
|
_rawPermissions: (->
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
Travis.Pusher = (key) ->
|
Travis.Pusher = (config) ->
|
||||||
@init(key) # if key
|
@init(config)
|
||||||
this
|
this
|
||||||
|
|
||||||
$.extend Travis.Pusher,
|
$.extend Travis.Pusher,
|
||||||
|
@ -10,37 +10,40 @@ $.extend Travis.Pusher,
|
||||||
$.extend Travis.Pusher.prototype,
|
$.extend Travis.Pusher.prototype,
|
||||||
active_channels: []
|
active_channels: []
|
||||||
|
|
||||||
init: (key) ->
|
init: (config) ->
|
||||||
Pusher.warn = @warn.bind(this)
|
Pusher.warn = @warn.bind(this)
|
||||||
@pusher = new Pusher(key, encrypted: Travis.Pusher.ENCRYPTED)
|
Pusher.host = config.host if config.host
|
||||||
|
@pusher = new Pusher(config.key, encrypted: Travis.Pusher.ENCRYPTED, disableStats: true)
|
||||||
@subscribeAll(Travis.Pusher.CHANNELS) if Travis.Pusher.CHANNELS
|
@subscribeAll(Travis.Pusher.CHANNELS) if Travis.Pusher.CHANNELS
|
||||||
|
|
||||||
@callbacksToProcess = []
|
@callbacksToProcess = []
|
||||||
|
|
||||||
Visibility.change (e, state) =>
|
Visibility.change (e, state) =>
|
||||||
if state == 'visible'
|
@processSavedCallbacks() if state == 'visible'
|
||||||
@processSavedCallbacks()
|
|
||||||
|
|
||||||
setInterval @processSavedCallbacks.bind(this), @processingIntervalWhenHidden
|
setInterval @processSavedCallbacks.bind(this), @processingIntervalWhenHidden
|
||||||
|
|
||||||
subscribeAll: (channels) ->
|
subscribeAll: (channels) ->
|
||||||
for channel in channels
|
@subscribe(channel) for channel in channels
|
||||||
name = @prefix(channel)
|
|
||||||
channel = @pusher.subscribe(channel)
|
|
||||||
channel.bind_all((event, data) => @receive(event, data))
|
|
||||||
|
|
||||||
subscribe: (channel) ->
|
subscribe: (channel) ->
|
||||||
console.log("subscribing to #{channel}")
|
return unless channel
|
||||||
channel = @prefix(channel)
|
channel = @prefix(channel)
|
||||||
@pusher.subscribe(channel).bind_all((event, data) => @receive(event, data)) unless @pusher?.channel(channel)
|
console.log("subscribing to #{channel}")
|
||||||
|
unless @pusher?.channel(channel)
|
||||||
|
@pusher.subscribe(channel).bind_all((event, data) => @receive(event, data))
|
||||||
|
|
||||||
unsubscribe: (channel) ->
|
unsubscribe: (channel) ->
|
||||||
console.log("unsubscribing from #{channel}")
|
return unless channel
|
||||||
channel = @prefix(channel)
|
channel = @prefix(channel)
|
||||||
|
console.log("unsubscribing from #{channel}")
|
||||||
@pusher.unsubscribe(channel) if @pusher?.channel(channel)
|
@pusher.unsubscribe(channel) if @pusher?.channel(channel)
|
||||||
|
|
||||||
prefix: (channel) ->
|
prefix: (channel) ->
|
||||||
|
if channel.indexOf(Travis.Pusher.CHANNEL_PREFIX) != 0
|
||||||
"#{Travis.Pusher.CHANNEL_PREFIX}#{channel}"
|
"#{Travis.Pusher.CHANNEL_PREFIX}#{channel}"
|
||||||
|
else
|
||||||
|
channel
|
||||||
|
|
||||||
# process pusher messages in batches every 5 minutes when the page is hidden
|
# process pusher messages in batches every 5 minutes when the page is hidden
|
||||||
processingIntervalWhenHidden: 1000 * 60 * 5
|
processingIntervalWhenHidden: 1000 * 60 * 5
|
||||||
|
@ -84,5 +87,17 @@ $.extend Travis.Pusher.prototype,
|
||||||
when 'annotation:created', 'annotation:updated'
|
when 'annotation:created', 'annotation:updated'
|
||||||
{ annotation: data }
|
{ annotation: data }
|
||||||
|
|
||||||
warn: (type, warning) ->
|
warn: (type, object) ->
|
||||||
console.warn(warning)
|
console.warn(type, object.error) unless @ignoreWarning(type, object.error)
|
||||||
|
|
||||||
|
ignoreWarning: (type, error) ->
|
||||||
|
code = error?.data?.code || 0
|
||||||
|
message = error?.data?.message || ''
|
||||||
|
@ignoreCode(code) || @ignoreMessage(message)
|
||||||
|
|
||||||
|
ignoreCode: (code) ->
|
||||||
|
code == 1006
|
||||||
|
|
||||||
|
ignoreMessage: (message) ->
|
||||||
|
message.indexOf('Existing subscription') == 0 or message.indexOf('No current subscription') == 0
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/with}}
|
{{/with}}
|
||||||
|
|
||||||
|
{{#if lastBuildHash.number }}
|
||||||
<p class="summary">
|
<p class="summary">
|
||||||
<span class="duration_label">Duration:</span>
|
<span class="duration_label">Duration:</span>
|
||||||
<abbr class="duration" {{bind-attr title="lastBuildStartedAt"}}>{{formatDuration lastBuildDuration}}</abbr>
|
<abbr class="duration" {{bind-attr title="lastBuildStartedAt"}}>{{formatDuration lastBuildDuration}}</abbr>
|
||||||
|
@ -28,6 +29,7 @@
|
||||||
<span class="finished-icon"></span><span class="finished_at_label">Finished:</span>
|
<span class="finished-icon"></span><span class="finished_at_label">Finished:</span>
|
||||||
<abbr class="finished_at timeago" {{bind-attr title="lastBuildFinishedAt"}}>{{formatTime lastBuildFinishedAt}}</abbr>
|
<abbr class="finished_at timeago" {{bind-attr title="lastBuildFinishedAt"}}>{{formatTime lastBuildFinishedAt}}</abbr>
|
||||||
</p>
|
</p>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
<div class="indicator"><span></span></div>
|
<div class="indicator"><span></span></div>
|
||||||
{{/with}}
|
{{/with}}
|
||||||
|
|
|
@ -78,7 +78,9 @@ $.extend Travis,
|
||||||
config:
|
config:
|
||||||
syncingPageRedirectionTime: 5000
|
syncingPageRedirectionTime: 5000
|
||||||
api_endpoint: $('meta[rel="travis.api_endpoint"]').attr('href')
|
api_endpoint: $('meta[rel="travis.api_endpoint"]').attr('href')
|
||||||
|
source_endpoint: $('meta[rel="travis.source_endpoint"]').attr('href')
|
||||||
pusher_key: $('meta[name="travis.pusher_key"]').attr('value')
|
pusher_key: $('meta[name="travis.pusher_key"]').attr('value')
|
||||||
|
pusher_host: $('meta[name="travis.pusher_host"]').attr('value')
|
||||||
ga_code: $('meta[name="travis.ga_code"]').attr('value')
|
ga_code: $('meta[name="travis.ga_code"]').attr('value')
|
||||||
code_climate: $('meta[name="travis.code_climate"]').attr('value')
|
code_climate: $('meta[name="travis.code_climate"]').attr('value')
|
||||||
ssh_key_enabled: $('meta[name="travis.ssh_key_enabled"]').attr('value') == 'true'
|
ssh_key_enabled: $('meta[name="travis.ssh_key_enabled"]').attr('value') == 'true'
|
||||||
|
|
2
assets/scripts/vendor/pusher.js
vendored
2
assets/scripts/vendor/pusher.js
vendored
|
@ -83,7 +83,7 @@ f={isSupported:function(){return!1},connect:function(a,b){var c=Pusher.Util.defe
|
||||||
b))&&(!a.disabledTransports||-1===Pusher.Util.arrayIndexOf(a.disabledTransports,b))&&("flash"!==b||!0!==a.disableFlash)?new Pusher.TransportStrategy(b,d,n?n.getAssistant(q):q,Pusher.Util.extend({key:a.key,encrypted:a.encrypted,timeline:a.timeline,ignoreNullOrigin:a.ignoreNullOrigin},e)):f;d=a.def(a,b,c)[1];d.transports=a.transports||{};d.transports[b]=c;return[void 0,d]},transport_manager:b(function(a,b){return new Pusher.TransportManager(b)}),sequential:b(function(a,b){var c=Array.prototype.slice.call(arguments,
|
b))&&(!a.disabledTransports||-1===Pusher.Util.arrayIndexOf(a.disabledTransports,b))&&("flash"!==b||!0!==a.disableFlash)?new Pusher.TransportStrategy(b,d,n?n.getAssistant(q):q,Pusher.Util.extend({key:a.key,encrypted:a.encrypted,timeline:a.timeline,ignoreNullOrigin:a.ignoreNullOrigin},e)):f;d=a.def(a,b,c)[1];d.transports=a.transports||{};d.transports[b]=c;return[void 0,d]},transport_manager:b(function(a,b){return new Pusher.TransportManager(b)}),sequential:b(function(a,b){var c=Array.prototype.slice.call(arguments,
|
||||||
2);return new Pusher.SequentialStrategy(c,b)}),cached:b(function(a,b,c){return new Pusher.CachedStrategy(c,a.transports,{ttl:b,timeline:a.timeline,encrypted:a.encrypted})}),first_connected:b(function(a,b){return new Pusher.FirstConnectedStrategy(b)}),best_connected_ever:b(function(){var a=Array.prototype.slice.call(arguments,1);return new Pusher.BestConnectedEverStrategy(a)}),delayed:b(function(a,b,c){return new Pusher.DelayedStrategy(c,{delay:b})}),"if":b(function(a,b,c,d){return new Pusher.IfStrategy(b,
|
2);return new Pusher.SequentialStrategy(c,b)}),cached:b(function(a,b,c){return new Pusher.CachedStrategy(c,a.transports,{ttl:b,timeline:a.timeline,encrypted:a.encrypted})}),first_connected:b(function(a,b){return new Pusher.FirstConnectedStrategy(b)}),best_connected_ever:b(function(){var a=Array.prototype.slice.call(arguments,1);return new Pusher.BestConnectedEverStrategy(a)}),delayed:b(function(a,b,c){return new Pusher.DelayedStrategy(c,{delay:b})}),"if":b(function(a,b,c,d){return new Pusher.IfStrategy(b,
|
||||||
c,d)}),is_supported:b(function(a,b){return function(){return b.isSupported()}})};Pusher.StrategyBuilder={build:function(a,b){var c=Pusher.Util.extend({},e,b);return d(a,c)[1].strategy}}}).call(this);
|
c,d)}),is_supported:b(function(a,b){return function(){return b.isSupported()}})};Pusher.StrategyBuilder={build:function(a,b){var c=Pusher.Util.extend({},e,b);return d(a,c)[1].strategy}}}).call(this);
|
||||||
(function(){Pusher.Protocol={decodeMessage:function(b){try{var c=JSON.parse(b.data);if("string"===typeof c.data)try{c.data=JSON.parse(c.data)}catch(a){if(!(a instanceof SyntaxError))throw a;}return c}catch(d){throw{type:"MessageParseError",error:d,data:b.data};}},encodeMessage:function(b){return JSON.stringify(b)},processHandshake:function(b){b=this.decodeMessage(b);if("pusher:connection_established"===b.event){if(!b.data.activity_timeout)throw"No activity timeout specified in handshake";return{action:"connected",
|
(function(){Pusher.Protocol={decodeMessage:function(b){try{var c=JSON.parse(b.data);if("string"===typeof c.data)try{c.data=JSON.parse(c.data)}catch(a){if(!(a instanceof SyntaxError))throw a;}return c}catch(d){throw{type:"MessageParseError",error:d,data:b.data};}},encodeMessage:function(b){return JSON.stringify(b)},processHandshake:function(b){b=this.decodeMessage(b);if("pusher:connection_established"===b.event){if(!b.data.activity_timeout)b.data.activity_timeout=120;return{action:"connected",
|
||||||
id:b.data.socket_id,activityTimeout:1E3*b.data.activity_timeout}}if("pusher:error"===b.event)return{action:this.getCloseAction(b.data),error:this.getCloseError(b.data)};throw"Invalid handshake";},getCloseAction:function(b){return 4E3>b.code?1002<=b.code&&1004>=b.code?"backoff":null:4E3===b.code?"ssl_only":4100>b.code?"refused":4200>b.code?"backoff":4300>b.code?"retry":"refused"},getCloseError:function(b){return 1E3!==b.code&&1001!==b.code?{type:"PusherError",data:{code:b.code,message:b.reason||b.message}}:
|
id:b.data.socket_id,activityTimeout:1E3*b.data.activity_timeout}}if("pusher:error"===b.event)return{action:this.getCloseAction(b.data),error:this.getCloseError(b.data)};throw"Invalid handshake";},getCloseAction:function(b){return 4E3>b.code?1002<=b.code&&1004>=b.code?"backoff":null:4E3===b.code?"ssl_only":4100>b.code?"refused":4200>b.code?"backoff":4300>b.code?"retry":"refused"},getCloseError:function(b){return 1E3!==b.code&&1001!==b.code?{type:"PusherError",data:{code:b.code,message:b.reason||b.message}}:
|
||||||
null}}}).call(this);
|
null}}}).call(this);
|
||||||
(function(){function b(a,b){Pusher.EventsDispatcher.call(this);this.id=a;this.transport=b;this.activityTimeout=b.activityTimeout;this.bindListeners()}var c=b.prototype;Pusher.Util.extend(c,Pusher.EventsDispatcher.prototype);c.handlesActivityChecks=function(){return this.transport.handlesActivityChecks()};c.send=function(a){return this.transport.send(a)};c.send_event=function(a,b,c){a={event:a,data:b};c&&(a.channel=c);Pusher.debug("Event sent",a);return this.send(Pusher.Protocol.encodeMessage(a))};c.ping=
|
(function(){function b(a,b){Pusher.EventsDispatcher.call(this);this.id=a;this.transport=b;this.activityTimeout=b.activityTimeout;this.bindListeners()}var c=b.prototype;Pusher.Util.extend(c,Pusher.EventsDispatcher.prototype);c.handlesActivityChecks=function(){return this.transport.handlesActivityChecks()};c.send=function(a){return this.transport.send(a)};c.send_event=function(a,b,c){a={event:a,data:b};c&&(a.channel=c);Pusher.debug("Event sent",a);return this.send(Pusher.Protocol.encodeMessage(a))};c.ping=
|
||||||
|
|
|
@ -83,7 +83,7 @@
|
||||||
span
|
span
|
||||||
position: relative
|
position: relative
|
||||||
display: block
|
display: block
|
||||||
top: 45px
|
top: calc(50% - 10px)
|
||||||
left: -15px
|
left: -15px
|
||||||
width: 20px
|
width: 20px
|
||||||
height: 20px
|
height: 20px
|
||||||
|
|
|
@ -28,7 +28,9 @@ end
|
||||||
run Travis::Web::App.build(
|
run Travis::Web::App.build(
|
||||||
environment: ENV['RACK_ENV'] || 'development',
|
environment: ENV['RACK_ENV'] || 'development',
|
||||||
api_endpoint: ENV['API_ENDPOINT'],
|
api_endpoint: ENV['API_ENDPOINT'],
|
||||||
|
source_endpoint: ENV['SOURCE_ENDPOINT'] || 'https://github.com',
|
||||||
pusher_key: ENV['PUSHER_KEY'],
|
pusher_key: ENV['PUSHER_KEY'],
|
||||||
|
pusher_host: ENV['PUSHER_HOST'] || 'ws.pusherapp.com',
|
||||||
ga_code: ENV['GA_CODE'],
|
ga_code: ENV['GA_CODE'],
|
||||||
root: File.expand_path('../public', __FILE__),
|
root: File.expand_path('../public', __FILE__),
|
||||||
server_start: Time.now,
|
server_start: Time.now,
|
||||||
|
|
|
@ -47,7 +47,7 @@ module Travis
|
||||||
end
|
end
|
||||||
|
|
||||||
def update_version
|
def update_version
|
||||||
Travis::Assets::Version.new.update
|
Travis::Assets::Version.new(roots).update
|
||||||
end
|
end
|
||||||
|
|
||||||
TYPES.each { |type| define_method(type) { paths[type] } }
|
TYPES.each { |type| define_method(type) { paths[type] } }
|
||||||
|
|
|
@ -11,10 +11,10 @@ module Travis
|
||||||
new.update
|
new.update
|
||||||
end
|
end
|
||||||
|
|
||||||
attr_reader :root
|
attr_reader :roots
|
||||||
|
|
||||||
def initialize(root = nil)
|
def initialize(roots = nil)
|
||||||
@root = Pathname.new(root || File.expand_path('.'))
|
@roots = roots
|
||||||
end
|
end
|
||||||
|
|
||||||
def read
|
def read
|
||||||
|
@ -29,8 +29,12 @@ module Travis
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
||||||
|
def cwd
|
||||||
|
Pathname.new(File.expand_path('.'))
|
||||||
|
end
|
||||||
|
|
||||||
def file
|
def file
|
||||||
root.join(FILE_NAME)
|
cwd.join(FILE_NAME)
|
||||||
end
|
end
|
||||||
|
|
||||||
def write(version)
|
def write(version)
|
||||||
|
@ -42,14 +46,16 @@ module Travis
|
||||||
end
|
end
|
||||||
|
|
||||||
def digest
|
def digest
|
||||||
Digest::MD5.new << `ls -lAR #{sources.join(' ')} | awk '{print $5, $6, $7, $9}'`
|
Digest::MD5.new << `ls -lAR #{sources.join(' ')} | awk '{ print $5, $6, $7, $8, $9, $10 }'`
|
||||||
end
|
end
|
||||||
|
|
||||||
def sources
|
def sources
|
||||||
|
roots.map do |root|
|
||||||
SOURCES.map do |source|
|
SOURCES.map do |source|
|
||||||
source = root.join(source)
|
source = Pathname.new(root).join(source)
|
||||||
source.to_s if source.exist?
|
source.to_s if source.exist?
|
||||||
end.compact
|
end
|
||||||
|
end.flatten.compact
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,6 +3,11 @@ module Travis
|
||||||
autoload :Allow, 'travis/web/allow'
|
autoload :Allow, 'travis/web/allow'
|
||||||
autoload :ApiRedirect, 'travis/web/api_redirect'
|
autoload :ApiRedirect, 'travis/web/api_redirect'
|
||||||
autoload :App, 'travis/web/app'
|
autoload :App, 'travis/web/app'
|
||||||
|
autoload :Config, 'travis/web/config'
|
||||||
autoload :SetToken, 'travis/web/set_token'
|
autoload :SetToken, 'travis/web/set_token'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.config
|
||||||
|
@config ||= Travis::Web::Config.new
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -33,7 +33,7 @@ class Travis::Web::App
|
||||||
def build(options = {})
|
def build(options = {})
|
||||||
builder = Rack::Builder.new
|
builder = Rack::Builder.new
|
||||||
if options[:environment] == 'production'
|
if options[:environment] == 'production'
|
||||||
builder.use Rack::SSL
|
builder.use Rack::SSL, hsts: Travis.config.ssl.hsts
|
||||||
end
|
end
|
||||||
builder.use Rack::Deflater
|
builder.use Rack::Deflater
|
||||||
builder.use Rack::Head
|
builder.use Rack::Head
|
||||||
|
|
50
lib/travis/web/config.rb
Normal file
50
lib/travis/web/config.rb
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
require 'hashr'
|
||||||
|
require 'yaml'
|
||||||
|
|
||||||
|
# Encapsulates the configuration necessary for travis-listener.
|
||||||
|
#
|
||||||
|
# Configuration values will be read from
|
||||||
|
#
|
||||||
|
# * either ENV['travis_config'] (this variable is set on Heroku by `travis config [env]`,
|
||||||
|
# see travis-cli) or
|
||||||
|
# * a local file config/travis.yml which contains the current env key (e.g. development,
|
||||||
|
# production, test)
|
||||||
|
#
|
||||||
|
# The env key can be set through various ENV variables, see Travis::Config.env.
|
||||||
|
#
|
||||||
|
module Travis
|
||||||
|
module Web
|
||||||
|
class Config < Hashr
|
||||||
|
class << self
|
||||||
|
def env
|
||||||
|
ENV['ENV'] || ENV['RAILS_ENV'] || ENV['RACK_ENV'] || 'development'
|
||||||
|
end
|
||||||
|
|
||||||
|
def load_env
|
||||||
|
@load_env ||= YAML.load(ENV['travis_config']) if ENV['travis_config']
|
||||||
|
end
|
||||||
|
|
||||||
|
def load_file
|
||||||
|
@load_file ||= YAML.load_file(filename)[env] if File.exists?(filename) rescue {}
|
||||||
|
end
|
||||||
|
|
||||||
|
def filename
|
||||||
|
@filename ||= File.expand_path('config/travis.yml')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
define ssl: { hsts: true }
|
||||||
|
|
||||||
|
default _access: [:key]
|
||||||
|
|
||||||
|
def initialize(data = nil, *args)
|
||||||
|
data ||= self.class.load_env || self.class.load_file || {}
|
||||||
|
super
|
||||||
|
end
|
||||||
|
|
||||||
|
def env
|
||||||
|
self.class.env
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -4,8 +4,10 @@
|
||||||
<link href='https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,800' rel='stylesheet' type='text/css'>
|
<link href='https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,800' rel='stylesheet' type='text/css'>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta rel="travis.api_endpoint" href="https://api.travis-ci.org">
|
<meta rel="travis.api_endpoint" href="https://api.travis-ci.org">
|
||||||
|
<meta rel="travis.source_endpoint" href="https://github.com">
|
||||||
<meta name="travis.ssh_key_enabled" value="false">
|
<meta name="travis.ssh_key_enabled" value="false">
|
||||||
<meta name="travis.pusher_key" value="5df8ac576dcccf4fd076">
|
<meta name="travis.pusher_key" value="5df8ac576dcccf4fd076">
|
||||||
|
<meta name="travis.pusher_host" value="ws.pusherapp.com">
|
||||||
<meta name="travis.ga_code" value="UA-24868285-1">
|
<meta name="travis.ga_code" value="UA-24868285-1">
|
||||||
<meta name="travis.caches_enabled" value="false">
|
<meta name="travis.caches_enabled" value="false">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
|
Loading…
Reference in New Issue
Block a user