[pro-merge] Add config entries from travis pro
This commit is contained in:
parent
e904067679
commit
f8c17775ed
|
@ -2,6 +2,13 @@ Travis.Pusher = (config) ->
|
||||||
@init(config)
|
@init(config)
|
||||||
this
|
this
|
||||||
|
|
||||||
|
if Travis.config.pro
|
||||||
|
$.extend Travis.Pusher,
|
||||||
|
CHANNELS: []
|
||||||
|
CHANNEL_PREFIX: 'private-'
|
||||||
|
ENCRYPTED: true
|
||||||
|
KEY: ''
|
||||||
|
else
|
||||||
$.extend Travis.Pusher,
|
$.extend Travis.Pusher,
|
||||||
CHANNELS: ['common']
|
CHANNELS: ['common']
|
||||||
CHANNEL_PREFIX: ''
|
CHANNEL_PREFIX: ''
|
||||||
|
|
|
@ -71,6 +71,11 @@ window.Travis = TravisApplication.create(
|
||||||
|
|
||||||
Travis.deferReadiness()
|
Travis.deferReadiness()
|
||||||
|
|
||||||
|
pages_endpoint = $('meta[rel="travis.pages_endpoint"]').attr('href')
|
||||||
|
billing_endpoint = $('meta[rel="travis.billing_endpoint"]').attr('href')
|
||||||
|
customer_io_site_id = $('meta[name="travis.customer_io_site_id"]').attr('value')
|
||||||
|
setupCustomerio(customer_io_site_id) if customer_io_site_id
|
||||||
|
|
||||||
$.extend Travis,
|
$.extend Travis,
|
||||||
run: ->
|
run: ->
|
||||||
Travis.advanceReadiness() # bc, remove once merged to master
|
Travis.advanceReadiness() # bc, remove once merged to master
|
||||||
|
@ -89,6 +94,16 @@ $.extend Travis,
|
||||||
show_repos_hint: 'private'
|
show_repos_hint: 'private'
|
||||||
avatar_default_url: 'https://travis-ci.org/images/ui/default-avatar.png'
|
avatar_default_url: 'https://travis-ci.org/images/ui/default-avatar.png'
|
||||||
pusher_log_fallback: $('meta[name="travis.pusher_log_fallback"]').attr('value') == 'true'
|
pusher_log_fallback: $('meta[name="travis.pusher_log_fallback"]').attr('value') == 'true'
|
||||||
|
pro: $('meta[name="travis.pro"]').attr('value') == 'true'
|
||||||
|
|
||||||
|
pages_endpoint: pages_endpoint || billing_endpoint
|
||||||
|
billing_endpoint: billing_endpoint
|
||||||
|
|
||||||
|
url_legal: "#{billing_endpoint}/pages/legal"
|
||||||
|
url_imprint: "#{billing_endpoint}/pages/imprint"
|
||||||
|
url_security: "#{billing_endpoint}/pages/security"
|
||||||
|
url_terms: "#{billing_endpoint}/pages/terms"
|
||||||
|
customer_io_site_id: customer_io_site_id
|
||||||
|
|
||||||
CONFIG_KEYS_MAP: {
|
CONFIG_KEYS_MAP: {
|
||||||
go: 'Go'
|
go: 'Go'
|
||||||
|
|
14
assets/scripts/vendor/customerio.js
vendored
Normal file
14
assets/scripts/vendor/customerio.js
vendored
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
var _cio = _cio || [];
|
||||||
|
|
||||||
|
function setupCustomerio(siteId) {
|
||||||
|
var a,b,c;a=function(f){return function(){_cio.push([f].
|
||||||
|
concat(Array.prototype.slice.call(arguments,0)))}};b=["load","identify",
|
||||||
|
"sidentify","track","page"];for(c=0;c<b.length;c++){_cio[b[c]]=a(b[c])};
|
||||||
|
var t = document.createElement('script'),
|
||||||
|
s = document.getElementsByTagName('script')[0];
|
||||||
|
t.async = true;
|
||||||
|
t.id = 'cio-tracker';
|
||||||
|
t.setAttribute('data-site-id', siteId);
|
||||||
|
t.src = 'https://assets.customer.io/assets/track.js';
|
||||||
|
s.parentNode.insertBefore(t, s);
|
||||||
|
}
|
16
config.ru
16
config.ru
|
@ -5,6 +5,10 @@ ENV['RAILS_ENV'] = ENV['RACK_ENV']
|
||||||
$: << 'lib'
|
$: << 'lib'
|
||||||
require 'travis/web'
|
require 'travis/web'
|
||||||
|
|
||||||
|
if ENV['TRAVIS_PRO']
|
||||||
|
require 'travis/pro/web/redirect'
|
||||||
|
end
|
||||||
|
|
||||||
class RedirectSubdomain < Struct.new(:app, :from)
|
class RedirectSubdomain < Struct.new(:app, :from)
|
||||||
def call(env)
|
def call(env)
|
||||||
request = Rack::Request.new(env)
|
request = Rack::Request.new(env)
|
||||||
|
@ -16,11 +20,15 @@ class RedirectSubdomain < Struct.new(:app, :from)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
unless ENV['TRAVIS_PRO']
|
||||||
use RedirectSubdomain, 'secure.travis-ci.org'
|
use RedirectSubdomain, 'secure.travis-ci.org'
|
||||||
|
end
|
||||||
|
|
||||||
use Rack::MobileDetect, :redirect_to => ENV['MOBILE_ENDPOINT'] if ENV['MOBILE_ENDPOINT']
|
use Rack::MobileDetect, :redirect_to => ENV['MOBILE_ENDPOINT'] if ENV['MOBILE_ENDPOINT']
|
||||||
|
|
||||||
use Travis::Web::SetToken
|
use Travis::Web::SetToken
|
||||||
use Travis::Web::Allow
|
use Travis::Web::Allow
|
||||||
|
|
||||||
use Travis::Web::ApiRedirect do |app|
|
use Travis::Web::ApiRedirect do |app|
|
||||||
app.settings.api_endpoint = ENV['API_ENDPOINT'] if ENV['API_ENDPOINT']
|
app.settings.api_endpoint = ENV['API_ENDPOINT'] if ENV['API_ENDPOINT']
|
||||||
end
|
end
|
||||||
|
@ -28,13 +36,19 @@ 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'],
|
||||||
|
pages_endpoint: ENV['PAGES_ENDPOINT'],
|
||||||
|
billing_endpoint: ENV['BILLING_ENDPOINT'] || 'https://billing.travis-ci.com',
|
||||||
source_endpoint: ENV['SOURCE_ENDPOINT'] || 'https://github.com',
|
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',
|
pusher_host: ENV['PUSHER_HOST'] || 'ws.pusherapp.com',
|
||||||
|
pusher_path: ENV['PUSHER_PATH'],
|
||||||
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,
|
||||||
caches_enabled: ENV['CACHES_ENABLED'],
|
caches_enabled: ENV['CACHES_ENABLED'],
|
||||||
ssh_key_enabled: ENV['SSH_KEY_ENABLED'],
|
ssh_key_enabled: ENV['SSH_KEY_ENABLED'],
|
||||||
pusher_log_fallback: ENV['PUSHER_LOG_FALLBACK']
|
pusher_log_fallback: ENV['PUSHER_LOG_FALLBACK'],
|
||||||
|
charm_key: ENV['CHARM_KEY'],
|
||||||
|
customer_io_site_id: ENV['CUSTOMER_IO_SITE_ID'],
|
||||||
|
pro: ENV['TRAVIS_PRO']
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user