Skip to content
Snippets Groups Projects
Select Git revision
  • b247a2c7e72b6858f714680e267f75a6d8c27557
  • master default protected
  • develop
  • release-2019.0
  • devel
  • factorybot
  • 2018
  • feature/rails5
  • fedora27-base
  • centos-base
  • 2017
  • permissions
  • 2016
  • fix223andtests
  • refactor_erb
  • production
  • staging
  • refactor
  • demo1
  • temp
20 results

dtu-quiz

  • Clone with SSH
  • Clone with HTTPS
  • Iain Bryson's avatar
    iaibrys authored
    * develop:
      Use new depoyment scripts.
      Merge branch 'develop' into feature/remove-coffeescript
      Update dtu-core dependency
      Move coffeescript to es6; add webpack
    b247a2c7
    History

    Running the App Locally

    Dependencies: MongoDB at http://quiz-db and redis at http://redis.

    #!/bin/bash
    
    set -e
    
    export DTU_DATA_ROOT=${DTU_ENOTE_VOL}
    export DTU_FILEMANAGER="${DTU_ENOTE_VOL}/filemanager"
    export QUIZ_DOMAIN=quiz.docker.local
    export DTU_REDIS_URL=docker.local
    
    echo checking for redis...
    (printf "PING\r\n";) | nc $DTU_REDIS_URL 6379
    
    echo checking for mongodb...
    export $(sed -e 's/:[^:\/\/]/=/g;s/ *=/=/g' ${DTU_DATA_ROOT}/config/quiz-db.yaml | xargs)
    bundle exec ruby probe_db.rb
    
    export LOG_LEVEL=debug
    export RAILS_ENV=development
    bundle exec rails s

    Testing the App

    You must have DB running to run tests. The script will try to get to ${DTU_DAT_ROOT}/config/quiz-db.yaml for the username and password. If DTU_DATA_ROOT is not set, it'll use null username/password.

    ./scripts/run-tests.sh
    docker exec -ti quiz bash -ac 'DTU_DATA_ROOT=/data ./scripts/run-tests.sh'

    Run the Load Test

    DEPRECATED

    This will need to be updated; last touched in 2016.

    docker-compose -f docker-compose.prodtest.yml build
    docker-compose -f docker-compose.prodtest.yml up -d

    And also monitor

    docker stats quizrenderer_quiz_1 quizrenderer_mongodb_1 quizrenderer_nginx_1

    View the results:

    docker logs quizrenderer_loadtest_1

    To get the profile:

    docker cp quizrenderer_quiz_1:/quiz-renderer/app/tmp/profile tmp/profile

    Reference