- checkout the project from github
- install [node][] for your platform. Try [homebrew][] on osx, then 'brew install node'
- install smartgraphs-generator using 'npm install' from this directory.
- setup rvm in the usual way echo 'rvm use 1.9.2@smartgraphs --create' > .rvmrc; cd ..; cd -
- run bundle install --binstubs
- copy the database.sample.yml cp config/database.sample.yml config/database.yml
- migrate the database bin/rake db:migrate
- start up the server 'rails s'
You might need to update your npm version before step 6 works. You can try npm -g update npm but that might fail, so then you can also try curl http://npmjs.org/install.sh | sudo sh
To learn about Hobo, check out the pdf "Rapid Rails 3 with Hobo" at http://hobocentral.net/books/
Trouble installing Nokogiri? You can try this: source ./nokogiri_brew.sh
Or just read that file, and follow along.
-
checkout Smartgraphs repository
-
follow steps in Smartgraphs/readme
-
inside of the Smartgraphs folder
rm -r tmp/build/static
bundle exec sc-build smartgraphs -r --languages=en
cp -r tmp/build/static ../smartgraphs-authoring/public
-
You might want check the existing files in the public folder and decide if they should be replaced or kept. Currently after doing this you can run SmartGraphs going going to: /static/smartgraphs/en/82b404e9816653aae3437852c272301c88eb986a/index.html
-
Move the index.html file from the newly-built smartgraphs folder to the root of the smartgraphs-authoring applications public folder, and rename it smartgraphs-runtime.html
mv public/static/smartgraphs/en/{build-number}/index.html public/smartgraphs-runtime.html
-
Add the following lines to smartgraphs-runtime.html, just after the opening of the first script tag (currently line 16):
window.authoredActivityJSON = <%= authored_activity_json %>; window.showOutline = <%= show_outline %>; window.showEditButton = <%= show_edit_button %>;
- after substantial modification of a model, run
hobo g migration
to update the schema.
- get setup with git and rvm
- follow the most of the instructions for [provisioning a vm at cc][]
- configure the new node using the chef web interface (copy and paste
json below?)
- use the 'cc_rails_app::simple_rails_app' recipe, and the 'node::default' recipe.
- set apache::listen_ports to include 80 & 8080.
- set cc_rails_app::portal::source_url to be git://github.com/concord-consortium/smartgraphs-authoring.git
- set cc_rails_app::portal::source_branch to be master
- currently database settings (config/database.yml) and mailer settings (config/mailer.yml) will not be configured when using the simple_rails_app recipe. You will need to manually edit them.
- if you want to serve on any port other than 80, you will have to edit your /etc/httpd/sites-enabled/.conf file.
You should be able to paste this into your clean chef node. change <VM_NAME> and change
{ "apache" : {
"listen_ports" : [ "80", "8080"]
},
"cc_rails_app" : { "checkout" : true,
"portal" : { "capistrano_folders" : true,
"host_name" : "<VM_NAME>.concord.org",
"mysql" : { "database" : "sg_authoring_prod",
"host" : "seymour.concord.org",
"password" : "<SECRET>",
"username" : "sg_authoring"
},
"root" : "/web/portal",
"source_branch" : "master",
"source_url" : "git://github.com/concord-consortium/smartgraphs-authoring.git",
"theme" : "smartgraphs"
},
"user" : "deploy"
},
"rails" : { "environment" : "production" }
}
knife bootstrap some.server.com -N node-name-from-previous-step -x your_ssh_username --distro centos5-cc --sudo -r "recipe[cc_rails_app::simple_rails_app]","recipe[node::default]" --bootstrap-version 0.9.16
ruby-vm8.concord.org proxied through seymour as sg-authoring.staging.concord.org
[provisioning a vm at cc]:http://confluence.concord.org/display/TSC/Provisioning+a+new+virtual+server+via+VMWare+and+Chef?focusedCommentId=4128819#comment-4128819) [node]:http://nodejs.org/ [homebrew]:http://mxcl.github.com/homebrew/