Giter VIP home page Giter VIP logo

front_end_builds's Introduction

Deprecation Notice

TED has shifted to React and will no longer maintain this application/library. If you wish to continue using this application/library, please create a pull request and repo ownership can be transferred. This repository will be archived at the end of 2022.

You can read documentation on how we curently use FrontEndBuilds in Confluence.

SSH Key Warning

Only RSA keys are supported for authentication. This means you cannot and should not use your regular TED SSH public key for front end builds deployments. Make sure you're checking your FEB_DEPLOY_KEY value in the environment and that it is pointing to an RSA key. You can't generate the keys using ssh-add you'll need the use something like this.

FrontEndBuilds

Front-End Builds (FEB) lets you easily serve remotely-hosted static (JS) applications from your Rails apps. For example, you can host a Rails backend on Heroku, an Ember.js frontend on S3, and use FEB to connect the two.

Benefits:

Features:

  • Admin interface lets you easily view, rollback and activate different app versions

The motivation for this gem came from Luke Melia's RailsConf2014 talk.

Installation

Add this line to your application's Gemfile:

gem 'front_end_builds'

And then execute:

$ bundle

Front-End Builds brings some migrations along with it. To run, execute

rake front_end_builds:install:migrations
rake db:migrate

Usage

First, mount the admin interface in routes.rb:

Rails.application.routes.draw do

  mount FrontEndBuilds::Engine, at: '/frontends'

end

You should mount this under an authenticated route using your application's auth strategy, as anyone with access to the admin will be able to affect the production builds of your front end apps.a

If you don't want to set up an HTML auth strategy, you can do something like this:

# routes.rb
protected_app = Rack::Auth::Basic.new(FrontEndBuilds::Engine) do |username, password|
  username == 'admin' && password == (Rails.env.production? ? ENV['FEB_ADMIN_PASSWORD'] : '')
end
mount protected_app, at: '/frontends'

This will use basic HTTP auth to secure access to your admin ui. Just set the ENV variable in production, and use it to gain access. If you're deploying to Heroku, use Config Vars.

Now, to create a new app, first add a front_end route pointing to your app in routes.rb:

Rails.application.routes.draw do

  front_end 'app-name', '/app-route'

end

Visit the admin (at whatever URL you mounted the engine above), create a new app named app-name, and you'll receive instructions on how to start pushing builds.

Note: If you're using this engine to serve an ember app at the Root, be sure to put all other Rails routes above the front_end route - as this takes priority over all routes below it!

Rails.application.routes.draw do
  # All other Rails routes here

  front_end 'app-name', '/'
end

At this point you should be able to test the setup in dev by running

bin/rails server

Visit /frontends to access the Admin interface, and visit the front_end route, which will initially return 404 Not found since you haven't configured and deployed any front-end builds yet.

Example Next Steps with Heroku and Ember.js

A common configuration is to deploy your FEB-enabled Rails app to Heroku, and deploy your Ember.js frontend to S3:

  1. Deploy your Rails app to Heroku
  2. Configure your frontend app with ember-cli-deploy-front-end-builds-pack
  3. Access your Rails app's FEB Admin interface, add an app, and configure a public SSH key that corresponds to the private key you plan on using to sign your Ember.js builds
  4. Deploy your frontend app. If all goes well, it should build the Ember app, push the static assets to S3, then POST to your Rails app. You'll see the build in the Admin interface, and should be able to access your frontend at the front_end route you specified.

Development

Admin

The Admin interface is an Ember CLI app within feb. A distribution is kept within the gem, and must be updated whenever admin code is updated.

After changing the admin app, run

rake admin:build

to store a fresh distribution.

Running tests

# Rails tests
rspec

# Admin tests, from /admin dir
ember test
  • Auto live setting
  • make posts idempotent (i think they are), but dont insert a new row if it already exists.

front_end_builds's People

Contributors

caomania avatar cpuid avatar hhff avatar jhirbour avatar jurre avatar lukemelia avatar mzagaja avatar nickcoyne avatar nselikoff avatar oldpathfinder avatar ryanto avatar samselikoff avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

front_end_builds's Issues

alter index html response

Just jotting an idea down, Luke mentioned in his talk they sometimes alter the HTML response after it was fetched from Redis. For example, they inject current_user into a meta tag, so the Ember app doesn't have to make an XHR request. You could also add

  • CSRF tokens
  • analytics params
  • config/feature flags
  • embedded JSON payload required for initial page render

We may want to eventually have an API for this type of thing.

Road to Beta

Admin

  • Fix FontAwesome and other missing assets (#26)
  • Single live build - no more "active/inactive" builds
  • Make API in admin key copyable (#16)
  • Fix namespace (#13)
  • Fix baseurl (#12)
  • Admin lets you make a build live (#10)

Backend

  • SSH keys (#41)
  • No more deploy.js? (#47)
  • PUT builds (#45)
  • PUT apps (PR)

View helper to render frontend

It'd be great to have a view helper that could render an ember app, so (for example) you could render an ember app under the rails site-wide header. How would this work?

Dynamic route setup

Logging a ticket, but will work on something more formal later on.

Right now the user has to add a route to the app to get Rails serving their front end. We should cut out this step and have the ability for Rails do to this at runtime based on the FrontEndBuilds::Apps table.

/cc @samselikoff

Allow mass assignment

Some rails apps are using attr_accessible to control what attributes are updatable. This is mainly for rails 3.x, but could be present in rails 4.x.

We need to detect attr_accessible and let it through.

Add hostApp model

Add a host_app model which represents the host application. It's a place to store metadata about the host app. For now, just the name of the rails app.

A host_app has many apps, so on boot the admin will make a GET request to /host_app and the response will look something like

host_app: {
  name: 'EMS',
  app_ids: [1, 2, 3]
},
apps: [
  ...
],
builds: [
  ...
]
``

Add basic http auth for admin

When user first sets up feb with a backend, if there's no app they need some way to authenticate to access the admin

front_end_admin http_auth: true

Store configuration on server

Right now there is a lot of configuration. Setting up the router, adding apps the UI, adding front ends to the router, configuring cli for deploy, etc.

In order to simplify some of this we will use the UI as the main place for adding and editing configuration. This should eliminate(?) the needs for deploy.js on the cli side as well as provide a central place for configs, making it easy to know where changes get made.

The CLI client will still be responsible for knowing its S3 access keys as well as the location of the FEB server it's deploying to. For FEB server location we can store that in config/environment.js. For S3 keys we can just default to looking at ENV vars, but provide an override hook if the cli tool wants to pull them from elsewhere.

Most of the work for this will be done on the cli side of things, but it starts with the engine holding config.

I think it makes sense to move to ssh key based auth before building this out.

ActiveRecord::StatementInvalid: PG::ConnectionBad: PQconsumeInput() SSL error: block type is not 01

I am getting this error when using front_end_builds on production.

env:
server: phusion passenger
database: postgres 9.4.1
pg gem: 0.18.2
OpenSSL 1.0.1f 6 Jan 2014

front_end_builds work fine for 1 machine, when I add 2nd machine and deploy from second machine then I get this error.

After debugging I came across https://bitbucket.org/ged/ruby-pg/issue/142/async_exec-over-ssl-connection-can-fail-on issue which might be cause of this bug.

Error trace :

[2015-06-26T18:10:07.614972 #20404] ERROR -- : PG::ConnectionBad: PQconsumeInput() SSL error: block type is not 01
: BEGIN
I, [2015-06-26T18:10:07.615427 #20404] INFO -- : Completed 500 Internal Server Error in 50ms
F, [2015-06-26T18:10:07.617529 #20404] FATAL -- :
ActiveRecord::StatementInvalid (PG::ConnectionBad: PQconsumeInput() SSL error: block type is not 01
: BEGIN):
vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.7/lib/active_record/connection_adapters/postgresql/database_statements.rb:128:in async_exec' vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.7/lib/active_record/connection_adapters/postgresql/database_statements.rb:128:inblock in execute'
vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.7/lib/active_record/connection_adapters/abstract_adapter.rb:373:in block in log' vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.7/lib/active_support/notifications/instrumenter.rb:20:ininstrument'
vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.7/lib/active_record/connection_adapters/abstract_adapter.rb:367:in log' vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.7/lib/active_record/connection_adapters/postgresql/database_statements.rb:127:inexecute'
vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.7/lib/active_record/connection_adapters/postgresql/database_statements.rb:197:in begin_db_transaction' vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.7/lib/active_record/connection_adapters/abstract/transaction.rb:170:ininitialize'
vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.7/lib/active_record/connection_adapters/abstract/transaction.rb:52:in new' vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.7/lib/active_record/connection_adapters/abstract/transaction.rb:52:inbegin'
vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.7/lib/active_record/connection_adapters/abstract/database_statements.rb:231:in begin_transaction' vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.7/lib/active_record/connection_adapters/abstract/database_statements.rb:208:inwithin_new_transaction'
vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.7/lib/active_record/connection_adapters/abstract/database_statements.rb:201:in transaction' vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.7/lib/active_record/transactions.rb:208:intransaction'
vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.7/lib/active_record/transactions.rb:326:in with_transaction_returning_status' vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.7/lib/active_record/transactions.rb:268:inblock in save'
vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.7/lib/active_record/transactions.rb:283:in rollback_active_record_state!' vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.7/lib/active_record/transactions.rb:267:insave'
/home/ubuntu/followme/shared/bundle/ruby/2.1.0/bundler/gems/front_end_builds-17750b46e3e0/app/controllers/front_end_builds/builds_controller.rb:17:in create' vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.7/lib/action_controller/metal/implicit_render.rb:4:insend_action'
vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.7/lib/abstract_controller/base.rb:189:in process_action' vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.7/lib/action_controller/metal/rendering.rb:10:inprocess_action'
vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.7/lib/abstract_controller/callbacks.rb:20:in block in process_action' vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.7/lib/active_support/callbacks.rb:113:incall'
vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.7/lib/active_support/callbacks.rb:113:in call' vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.7/lib/active_support/callbacks.rb:149:inblock in halting_and_conditional'
vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.7/lib/active_support/callbacks.rb:229:in call' vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.7/lib/active_support/callbacks.rb:229:inblock in halting'
vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.7/lib/active_support/callbacks.rb:166:in call' vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.7/lib/active_support/callbacks.rb:166:inblock in halting'
vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.7/lib/active_support/callbacks.rb:166:in call' vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.7/lib/active_support/callbacks.rb:166:inblock in halting'
vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.7/lib/active_support/callbacks.rb:86:in call' vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.7/lib/active_support/callbacks.rb:86:inrun_callbacks'
vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.7/lib/abstract_controller/callbacks.rb:19:in process_action' vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.7/lib/action_controller/metal/rescue.rb:29:inprocess_action'
vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.7/lib/action_controller/metal/instrumentation.rb:31:in block in process_action' vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.7/lib/active_support/notifications.rb:159:inblock in instrument'
vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.7/lib/active_support/notifications/instrumenter.rb:20:in instrument' vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.7/lib/active_support/notifications.rb:159:ininstrument'
vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.7/lib/action_controller/metal/instrumentation.rb:30:in process_action' vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.7/lib/action_controller/metal/params_wrapper.rb:250:inprocess_action'
vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.7/lib/active_record/railties/controller_runtime.rb:18:in process_action' vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.7/lib/abstract_controller/base.rb:136:inprocess'
vendor/bundle/ruby/2.1.0/gems/actionview-4.1.7/lib/action_view/rendering.rb:30:in process' vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.7/lib/action_controller/metal.rb:196:indispatch'
vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.7/lib/action_controller/metal/rack_delegation.rb:13:in dispatch' vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.7/lib/action_controller/metal.rb:232:inblock in action'
vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.7/lib/action_dispatch/routing/route_set.rb:82:in call' vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.7/lib/action_dispatch/routing/route_set.rb:82:indispatch'
vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.7/lib/action_dispatch/routing/route_set.rb:50:in call' vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.7/lib/action_dispatch/journey/router.rb:73:inblock in call'
vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.7/lib/action_dispatch/journey/router.rb:59:in each' vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.7/lib/action_dispatch/journey/router.rb:59:incall'
vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.7/lib/action_dispatch/routing/route_set.rb:678:in call' vendor/bundle/ruby/2.1.0/bundler/gems/front_end_builds-17750b46e3e0/lib/front_end_builds/middleware/admin_assets.rb:25:incall'
vendor/bundle/ruby/2.1.0/gems/warden-1.2.3/lib/warden/manager.rb:35:in block in call' vendor/bundle/ruby/2.1.0/gems/warden-1.2.3/lib/warden/manager.rb:34:incatch'
vendor/bundle/ruby/2.1.0/gems/warden-1.2.3/lib/warden/manager.rb:34:in call' vendor/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/etag.rb:23:incall'
vendor/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/conditionalget.rb:35:in call' vendor/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/head.rb:11:incall'
vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.7/lib/action_dispatch/middleware/params_parser.rb:27:in call' vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.7/lib/active_record/query_cache.rb:36:incall'
vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:621:in call' vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.7/lib/action_dispatch/middleware/callbacks.rb:29:inblock in call'
vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.7/lib/active_support/callbacks.rb:82:in run_callbacks' vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.7/lib/action_dispatch/middleware/callbacks.rb:27:incall'
vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.7/lib/action_dispatch/middleware/remote_ip.rb:76:in call' vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.7/lib/action_dispatch/middleware/debug_exceptions.rb:17:incall'
vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.7/lib/action_dispatch/middleware/show_exceptions.rb:30:in call' vendor/bundle/ruby/2.1.0/gems/railties-4.1.7/lib/rails/rack/logger.rb:38:incall_app'
vendor/bundle/ruby/2.1.0/gems/railties-4.1.7/lib/rails/rack/logger.rb:20:in block in call' vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.7/lib/active_support/tagged_logging.rb:68:inblock in tagged'
vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.7/lib/active_support/tagged_logging.rb:26:in tagged' vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.7/lib/active_support/tagged_logging.rb:68:intagged'
vendor/bundle/ruby/2.1.0/gems/railties-4.1.7/lib/rails/rack/logger.rb:20:in call' vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.7/lib/action_dispatch/middleware/request_id.rb:21:incall'
vendor/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/runtime.rb:17:in call' vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.7/lib/active_support/cache/strategy/local_cache_middleware.rb:26:incall'
vendor/bundle/ruby/2.1.0/gems/rack-cors-0.2.9/lib/rack/cors.rb:54:in call' vendor/bundle/ruby/2.1.0/gems/railties-4.1.7/lib/rails/engine.rb:514:incall'
vendor/bundle/ruby/2.1.0/gems/railties-4.1.7/lib/rails/application.rb:144:in call' /home/ubuntu/.rvm/gems/ruby-2.1.5/gems/passenger-4.0.53/lib/phusion_passenger/rack/thread_handler_extension.rb:74:inprocess_request'
/home/ubuntu/.rvm/gems/ruby-2.1.5/gems/passenger-4.0.53/lib/phusion_passenger/request_handler/thread_handler.rb:141:in accept_and_process_next_request' /home/ubuntu/.rvm/gems/ruby-2.1.5/gems/passenger-4.0.53/lib/phusion_passenger/request_handler/thread_handler.rb:109:inmain_loop'
/home/ubuntu/.rvm/gems/ruby-2.1.5/gems/passenger-4.0.53/lib/phusion_passenger/request_handler.rb:455:in `block (3 levels) in start_threads'

Admin json changes

Hey I made some changes to the admin JSON. I think the front end will need to be updated.

GET /frontends-admin/apps'
app: {
  api_key: "key"
  best_build_id: 15
  build_ids: [15, 14, 13, 12, 11, 10, 9, 8, 7, 6]
  id: 1
  name: "app-name"
}
builds: [
0: {id: 15, app_id: 1, sha: "89729f73945bc748bbfb96af884738e8a1b3e8cc", branch: "master"}
1: {id: 14, app_id: 1, sha: "89729f73945bc748bbfb96af884738e8a1b3e8cc", branch: "master"}
2: {id: 13, app_id: 1, sha: "89729f73945bc748bbfb96af884738e8a1b3e8cc", branch: "master"}
...
]

The big changes here are.

  1. Builds don't know if they are the best are not. App payload just has a best_build_id which points to the best build.

  2. Builds array only has the 10 most recent builds. I figure most apps will very quickly get to hundreds of builds and replying with that much JSON is overkill. If the best build is not in a the builds array then Ember will have to request it from the backend (based on id).

2 cont) Since we only reply with 10 builds I guess we should do some sort of pagination or all so you can see more if you want to. This is pretty easy, but I haven't done it yet... which of these do you like best:

Pagination:

GET /builds?app_id=7&per_page=10&page=3

All

GET /builds?app_id=7&showAll=true

Set up travis

Need to set up travis to run against all supported versions of rails

public assets not getting merged

gem works with dummy in spec but not currently with an actual external app. Public folder isn't getting merged.

This is why it didn't work yesterday, I'm looking into it.

/cc @ryanto

Add an app's location to the json response

Reflect on the router and add each app's location to the json response

e.g. if user has

Rails.application.routes.draw do
  namespace :foo do
    front_end :dummy
  end
end

then the serialized app should be

{
  id: '1',
  build_ids: [1, 2, 3],
  name: "dummy",
  location: "/foo/dummy"
}

Send hash of index file when notifying backend

Send a hash of the index file when notifying the backend.

When the backend pulls from S3 it can hash the index and verify that hash matches the submitted hash.

This prevents odd errors like S3 not updating quickly or two developers deploying at the same time.

Make S3 path configurable

Right now it's using a convention, dist-[job]-[sha]. Should probably just accept the location as a param in the cURL request.

Notify user if frontend isn't mounted

If location comes through as null, inform user:

“This frontend doesn’t seem to be currently mounted. Make sure you’ve added front_end ‘app_name’ to your routes.rb, and the names match.”

create-app-test failing, Attempted to handle event `didSetProperty`while in state root.deleted.saved

I'm trying to wire up some acceptance tests for the ember admin app. This particular feature seems to work when I'm clicking around the app, but it throws an error during tests. (Interestingly, it works the first time you fire up ember server, but if you try to rerun the test it fails).

The code that fires is this.get('app').deleteRecord(), in the new-app-card component. I get

Uncaught Error: Attempted to handle event `didSetProperty` on <admin@model:app::ember578:null> while in state root.deleted.saved. Called with {name: name, oldValue: undefined, originalValue: undefined, value: }.

NameError: uninitialized constant FrontEndBuilds

Just updated from 0.2.3 -> 0.2.4, and I'm getting this for any command I attempt to run:

rake aborted!
NameError: uninitialized constant FrontEndBuilds
/Users/hhff/.rvm/gems/ruby-2.0.0-p576/bundler/gems/front_end_builds-63a9c3362c7f/lib/front_end_builds/middleware/admin_assets.rb:5:in `<top (required)>'
/Users/hhff/.rvm/gems/ruby-2.0.0-p576/bundler/gems/front_end_builds-63a9c3362c7f/lib/front_end_builds/engine.rb:1:in `require'
/Users/hhff/.rvm/gems/ruby-2.0.0-p576/bundler/gems/front_end_builds-63a9c3362c7f/lib/front_end_builds/engine.rb:1:in `<top (required)>'
/Users/hhff/.rvm/gems/ruby-2.0.0-p576/bundler/gems/front_end_builds-63a9c3362c7f/lib/front_end_builds.rb:1:in `require'
/Users/hhff/.rvm/gems/ruby-2.0.0-p576/bundler/gems/front_end_builds-63a9c3362c7f/lib/front_end_builds.rb:1:in `<top (required)>'
/Users/hhff/.rvm/gems/ruby-2.0.0-p576@global/gems/bundler-1.7.3/lib/bundler/runtime.rb:76:in `require'
/Users/hhff/.rvm/gems/ruby-2.0.0-p576@global/gems/bundler-1.7.3/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
/Users/hhff/.rvm/gems/ruby-2.0.0-p576@global/gems/bundler-1.7.3/lib/bundler/runtime.rb:72:in `each'
/Users/hhff/.rvm/gems/ruby-2.0.0-p576@global/gems/bundler-1.7.3/lib/bundler/runtime.rb:72:in `block in require'
/Users/hhff/.rvm/gems/ruby-2.0.0-p576@global/gems/bundler-1.7.3/lib/bundler/runtime.rb:61:in `each'
/Users/hhff/.rvm/gems/ruby-2.0.0-p576@global/gems/bundler-1.7.3/lib/bundler/runtime.rb:61:in `require'
/Users/hhff/.rvm/gems/ruby-2.0.0-p576@global/gems/bundler-1.7.3/lib/bundler.rb:133:in `require'
/Users/hhff/dev/SC/face_files/backend/config/application.rb:7:in `<top (required)>'
/Users/hhff/dev/SC/face_files/backend/Rakefile:4:in `require'
/Users/hhff/dev/SC/face_files/backend/Rakefile:4:in `<top (required)>'
/Users/hhff/.rvm/gems/ruby-2.0.0-p576/bin/ruby_executable_hooks:15:in `eval'
/Users/hhff/.rvm/gems/ruby-2.0.0-p576/bin/ruby_executable_hooks:15:in `<main>'
(See full trace by running task with --trace)

Don't have time to troubleshoot - rolling back to 0.2.3 for now, thought I'd let you guys know

hx

Do we need app to send best_build_id?

When the user activates a build from the UI, the best_build may change. Do we really need to ask Rails to update the best_build_id? Why don't we just have the logic for what the best_build is in the frontend?

The logic for find_best is complex in the backend, because it takes lots of params. The only one we need for the frontend is the best at the default url, which (correct me if I'm wrong) is just the latest active master. Correct?

In this case, we can drop best_build_id and that will make keeping the UI in sync with the best_build as the user is clicking around much easier.

Thoughts?

Admin area missing fonts

Causes controller to throw:

ActionController::RoutingError (No route matches [GET] "/assets/fonts/fontawesome-webfont.woff"):

Can't activate / deactive builds on Rails 4.2

Hi Guys!

Having trouble getting the activate / deactivate stuff working. When I hit my builds page, every build is marked as Active, and attempting to deactivate them doesn't work (failed PUT request).

Currently testing on Heroku with the github version of this Gem. (Rails 4.2)

Screencap here:
https://drive.google.com/file/d/0B_A4sox6VN4Mbm4yUVhEMkVyMEk/view?usp=sharing

routes.rb

  # Backend
  devise_for :admin_users, ActiveAdmin::Devise.config
  ActiveAdmin.routes(self)

  authenticate :admin_user do
    mount FrontEndBuilds::Engine, at: '/builds'
  end

  # API
  namespace :api do
    resources :posts
  end

  # Frontend
  front_end 'my-ember-frontend', '/'

Any ideas? If not - I'm happy to dive into this - just wont have time today.

Named path helper for each frontend

It'd be great to get a named path helper for each frontend so you can use it from rails, to e.g. send from an email + other things. Needed this a few times now.

Add `repository` field to app

string, e.g. https://github.com/tedconf/front_end_builds. This way we can turn the shas in the builds table to links directly to the commit on e.g. github.

  • frontend
  • backend

Rails 4.2.0 doesn't use responders

In Rails 4.2.0 there is no responders, so respond_to :json won't work. We should remove these and use standard rails controller format.

  • Add Rails 4.2.0 to travis
  • Remove respond_to references

tags

I want to be able to tag a build. This could be a git tag, but probably not because that could interfere with v0.1.0.

What I really want is, to just tag a build as something, for easy reference later. For example, I'm working with a PM and I'm showing him two different versions of the product. They're both master branch, because it just so happens that one of the earlier versions had a different UI. So now I'm just sharing my.app.com and my.app.com?build_id=26. But I have to find those in the admin, and remember htem in my head, which one's which.

What I really want is, in the admin UI, to tag 26 as "horizontal_layout" and tag 33 as "veritical_layout". Then in the admin, I want to be able to sort the builds table by only custom tags, and then have simple links to those two builds.

The links could still be &build_id=26, but it would be easy to find them in the admin, and easy to copy the link and share.

How to allow cross domain iframe embedding?

Hi Tedconf,

70% of the traffic to our Ember app comes through an iframe. Since we started using Ember Front End Builds (which we love!) we are hitting a this error:

Refused to display 'https://www.hotdoc.com.au/book-appointment/harbourtown-medical-centre' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.

Can we set the X-Frame-Options of the headers to allow cross domain iframe embedding?

What we used to do with our old Ember app, which was embedded in Rails was adding the following to the relevant controller:

# Allow access within an iframe
response.headers.delete 'X-Frame-Options'

Or:

# Allow access within an iframe
response.headers['X-Frame-Options'] = 'ALLOW'

Is that also possible with Ember Front End Builds?


PS: Keep up the great work! Ember Front End Builds is the single best process improvement we introduced to our Ember app.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.