Skip to content

Installation

Gavin Morrice edited this page Aug 15, 2018 · 43 revisions

Requirements

Roadmap is a Ruby on Rails application that requires the following:

  • Ruby >= 2.4.4
  • Rails >= 4.2.10 (5.0.0+ to be tested soon)
  • PostgreSQL >= 9.2 or MySQL >= 5.5
  • Node.js for management of assets (DMPRoadmap is no longer using the Rails assets pipeline)
  • ImageMagick used by the Dragonfly gem to manage logos

Further details on how to install Ruby on Rails applications are available from the Ruby on Rails site: http://rubyonrails.org

Further details on how to install the database server and create your first user and database. Be sure to follow the instructions for your particular environment.

You may also find the following resources useful:

Installation

  • Create your database

    • For MySQL: Select UTF-8 Unicode (utf8mb4) encoding.
  • Fork the repository and then clone it onto your server

    git clone https://github.com/[your organization]/roadmap.git
    
    cd roadmap
  • Make copies of the yaml configuration files and update the values for your installation

    cp config/database_example.yml config/database.yml
    
    cp config/secrets_example.yml config/secrets.yml
    
    cp config/branding_example.yml config/branding.yml
  • Make copies of the example gem initializer files and update the values for your installation

    cp config/initializers/devise.rb.example config/initializers/devise.rb
    
    cp config/initializers/recaptcha.rb.example config/initializers/recaptcha.rb
    
    cp config/initializers/wicked_pdf.rb.example config/initializers/wicked_pdf.rb
  • Create an environment variable for your instance's secret (as defined in config/secrets.yml). You should use the following command to generate secrets for each of your environments, storing the production one in the environment variable:

    rake secret
  • Run bundler and perform the DB migrations

    gem install bundler  # (if bundler is not yet installed)
    
    bundle install
    
    rake db:schema:load
    
    rake db:seed  # (Unless you are migrating data from an old DMPonline system)

    If you are migrating from a legacy DMPonline system follow this guide instead.

  • Install npm (node package manager) and Webpack and then bundle the assets (requires the installation of node.js). The following commands will start up Webpack which will compile and then begin watching your JS and SCSS files for changes (similar to the functionality of Rails server). If you are deploying to a production or staging server we recommend adding '-p' arg to the npm run bundle -- -p command. This will compile your assets and add a unique fingerprint id to the files (Webpack will not continue to run and watch your files).

    cd lib/assets
    npm install
    npm run bundle
  • Once webpack is running, open a second window/tab and start the application

    rails server
  • Verify that the site is running properly by going to http://localhost:3000 .

  • Login as the default administrator: 'super_admin@example.com' - 'password123'.

Post Installation

You should perform the following tasks prior to deploying the system on a server that is accessible to the web:

  • Delete the users included in the seeds.rb file (e.g. super_admin@example.com) or at least change their passwords.

  • Make sure you have created unique secrets for your config/secrets.yml file (see instructions above).

  • Update the site's Branding.

  • Update the mailer url in config/environments/production.rb (line 68).

  • Designate/create an organization that will become the generic catch-all Org for the application. Users who do not specify and Org from the dropdown list when they create their account will become associated with this generic Org. To designate the Org as the 'other' organization you must set its orgs.is_other value to true

  • Designate/create a default template. If a user creates a plan and specifies no research organization and no funder (or a combination that results in no published templates) then their plan is created using a default template. You must define your default template in the DB by setting templates.is_default equal to true.

Clone this wiki locally