diff --git a/.travis.yml b/.travis.yml index c407e03b..e2ebc9d7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,7 @@ cache: bundler: true matrix: + fast_finish: true allow_failures: - rvm: 2.1.2 env: 'TEST_SUITE=phantomjs' diff --git a/assets/scripts/app/helpers/handlebars.coffee b/assets/scripts/app/helpers/handlebars.coffee index 98901e6a..5d120f99 100644 --- a/assets/scripts/app/helpers/handlebars.coffee +++ b/assets/scripts/app/helpers/handlebars.coffee @@ -48,7 +48,8 @@ Ember.Handlebars.registerHelper('label', (options) -> options.hash.for = id options.hashTypes.for = 'STRING' options.hashContexts.for = this - options.fn = Ember.Handlebars.compile("{{view.content}}") + if options.hash.content + options.fn = Ember.Handlebars.compile("{{view.content}}") Ember.Handlebars.helpers.view.call(this, view, options) ) diff --git a/assets/scripts/app/routes.coffee b/assets/scripts/app/routes.coffee index 66e0eb40..5acecf51 100644 --- a/assets/scripts/app/routes.coffee +++ b/assets/scripts/app/routes.coffee @@ -61,6 +61,7 @@ require 'routes/getting_started' require 'routes/insufficient_oauth_permissions' require 'routes/job' require 'routes/main/index' +require 'routes/main/error' require 'routes/main/my_repositories' require 'routes/main/recent' require 'routes/main/repositories' diff --git a/assets/scripts/app/routes/auth.coffee b/assets/scripts/app/routes/auth.coffee index 2cbaa689..c3193a6f 100644 --- a/assets/scripts/app/routes/auth.coffee +++ b/assets/scripts/app/routes/auth.coffee @@ -15,11 +15,11 @@ Route = TravisRoute.extend actions: afterSignIn: -> - @transitionTo('index') + @transitionTo('main') return true redirect: -> if @signedIn() - @transitionTo('index') + @transitionTo('main') Travis.AuthRoute = Route diff --git a/assets/scripts/app/templates/layouts/top.hbs b/assets/scripts/app/templates/layouts/top.hbs index 6f55da24..8bfbf6bb 100644 --- a/assets/scripts/app/templates/layouts/top.hbs +++ b/assets/scripts/app/templates/layouts/top.hbs @@ -8,12 +8,14 @@
diff --git a/assets/scripts/travis.coffee b/assets/scripts/travis.coffee index 9efd3be2..f412c9db 100644 --- a/assets/scripts/travis.coffee +++ b/assets/scripts/travis.coffee @@ -82,7 +82,10 @@ $.extend Travis, show_repos_hint: 'private' avatar_default_url: 'https://travis-ci.org/images/ui/default-avatar.png' pusher_log_fallback: $('meta[name="travis.pusher_log_fallback"]').attr('value') == 'true' - pro: $('meta[name="travis.pro"]').attr('value') == 'true' + # for now I set pro to true also for enterprise, but it should be changed + # to allow more granular config later + pro: $('meta[name="travis.pro"]').attr('value') == 'true' || $('meta[name="travis.enterprise"]').attr('value') == 'true' + enterprise: $('meta[name="travis.enterprise"]').attr('value') == 'true' pages_endpoint: pages_endpoint || billing_endpoint billing_endpoint: billing_endpoint diff --git a/config.ru b/config.ru index 24b0f492..fd155ce1 100644 --- a/config.ru +++ b/config.ru @@ -44,6 +44,11 @@ if ENV['TRAVIS_PRO'] ENV['CODE_CLIMATE'] = 'true' unless ENV.has_key?('CODE_CLIMATE') end +if ENV['TRAVIS_ENTERPRISE'] + ENV['SSH_KEY_ENABLED'] = 'true' unless ENV.has_key?('SSH_KEY_ENABLED') + ENV['CACHES_ENABLED'] = 'true' unless ENV.has_key?('CACHES_ENABLED') +end + run Travis::Web::App.build( environment: ENV['RACK_ENV'] || 'development', api_endpoint: ENV['API_ENDPOINT'], @@ -62,6 +67,8 @@ run Travis::Web::App.build( charm_key: ENV['CHARM_KEY'], customer_io_site_id: ENV['CUSTOMER_IO_SITE_ID'], pro: ENV['TRAVIS_PRO'], + enterprise: ENV['TRAVIS_ENTERPRISE'], code_climate: ENV['CODE_CLIMATE'], - code_climate_url: ENV['CODE_CLIMATE_URL'] + code_climate_url: ENV['CODE_CLIMATE_URL'], + assets_host: ENV['ASSETS_HOST'] ) diff --git a/lib/travis/web/app.rb b/lib/travis/web/app.rb index 3a5ea66e..037298b1 100644 --- a/lib/travis/web/app.rb +++ b/lib/travis/web/app.rb @@ -158,13 +158,24 @@ class Travis::Web::App content.gsub!(/\{\{title\}\}/, ENV['SITE_TITLE'] || default_title) end + def set_assets_host(content) + content.gsub!(/\{\{assets_host\}\}/, ENV['ASSETS_HOST'] || '') + end + def set_config(string, opts = {}) string.gsub! %r(]*>) do %() end string.gsub! %r{(src|href)="(?:\/?)((styles|scripts)\/[^"]*)"} do - %(#{$1}=#{opts[:alt] ? "#{S3_URL}/#{opts[:alt]}/#{$2}":"/#{$2}"}) + src = if options[:assets_host] + "#{options[:assets_host].chomp('/')}/#{$2}" + elsif opts[:alt] + "#{S3_URL}/#{opts[:alt]}/#{$2}" + else + "/#{$2}" + end + %(#{$1}="#{src}") end end end diff --git a/public/index.html b/public/index.html index 9b0035b2..26a9f71b 100644 --- a/public/index.html +++ b/public/index.html @@ -16,6 +16,7 @@ +