Skip to content

yuxuibbs/worldcubeassociation.org

 
 

Repository files navigation

worldcubeassociation.org Build Status

This repository contains all of the code that runs on worldcubeassociation.org.

Setup

  • git clone https://github.com/thewca/worldcubeassociation.org - Clone this repo! (And navigate into it, cd worldcubeassociation.org)
  • (cd WcaOnRails; bundle install) && bundle pre-commit install && git config pre-commit.ruby "scripts/ruby_in_wca_on_rails.sh" - Set up git pre-commit hook. Optional, but very useful.

Run in Vagrant (easier and gets everything working)

Run locally ruby (lightweight, but only run the rails portions of the site)

  • Set up mysql with a user with username "root" with an empty password.
    1. cd WcaOnRails/
    2. bundle install && bin/yarn
    3. bin/rake db:load:development - Download and import the developer's database export.
    4. bin/foreman start - Run rails and webpack. The server will be accessible at localhost:3000
  • bin/rspec - Run tests. Make sure that RAILS_ENV=test bin/webpack-dev-server is already running.
  • Mailcatcher is a good tool for catching emails in development.

Provision New VM

  • Provisioning relies upon SSH agent forwarding, so make sure you've set up an SSH key for cubing@worldcubeassociation.org in order to rsync secrets.
  • time ssh -A user@example.com 'sudo wget https://raw.githubusercontent.com/thewca/worldcubeassociation.org/master/scripts/wca-bootstrap.sh -O /tmp/wca-bootstrap.sh && sudo -E bash /tmp/wca-bootstrap.sh <environment>' - Where environmentis one ofstagingorproduction``

Deploy

See this wiki.

Secrets

  • Production secrets are stored in an encrypted chef data bag at chef/data_bags/secrets/production.json.
    • Show secrets: knife data bag show secrets production -c /etc/chef/solo.rb --secret-file secrets/my_secret_key
    • Edit secrets: knife data bag edit secrets production -c /etc/chef/solo.rb --secret-file secrets/my_secret_key

About

[WCA Project] All of the code that runs on worldcubeassociation.org

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 52.6%
  • JavaScript 33.0%
  • HTML 7.4%
  • Ruby 6.1%
  • CSS 0.7%
  • Shell 0.1%
  • Other 0.1%