Skip to content

ecs-org/ecs

Repository files navigation

ECS

The ethic commission system (ECS) is an open-source webservice supporting clinical trials approval, monitoring and the electronic management of the related data. See the ECS Homepage for more information about ECS.

See the Administrator Manual for installing and configuring an ECS-Appliance.

Development

The devserver requires at least 10GB Harddisk Space and 1,5GB RAM.

using Vagrant

If you use vagrant, clone this repository to your local machine, add vagrant-password-growroot.iso as seed.iso inside the root directory of the repository and execute vagrant up.

Installing the devserver to an empty xenial vm

curl https://raw.githubusercontent.com/ecs-org/ecs/master/scripts/bootstrap-devserver.sh > /tmp/bootstrap.sh
chmod +x /tmp/bootstrap.sh; /tmp/bootstrap.sh --yes

Using the devserver

  • login into devserver and forward port 8000 (django http) to your local machine:

  • start devserver sudo systemctl start devserver

  • stop devserver: sudo systemctl stop devserver

  • look into logfile of devserver:

    • show devserver logfile with paging: sudo journalctl -u devserver
    • follow the log to see errors or emails: sudo journalctl -u devserver -f
    • search for user emails retrospective:
      • sudo journalctl -u devserver | grep href
      • sudo journalctl -u devserver | grep ': Subject' -A 25
    • grep something in the log: sudo journalctl -u devserver | grep -i migration
  • django management:

. ~/env/bin/activate
cd ~/ecs
./manage.py

using devupdate.sh

Features:

  • updates/restarts everything needed for the requested change without intervention
  • allows only one running devupdate at a time, second will abort
  • automatically restores from dump if needed

Usage:

  • get help: execute devupdate.sh

  • install all app and server dependencies, do not touch sourcecode

    • devupdate.sh init
  • fetch changes, checkout last used branch, update server

    • devupdate.sh pull
  • fetch changes, force checkout last used branch, restore from dump, update server

    • devupdate.sh --restore-dump pull --force
  • fetch changes, checkout to another branch, update server

    • devupdate.sh pull foobranch
  • use a empty database with testusers for screencasts

    • change to a different branch if needed: devupdate.sh pull branchname
    • clear database, add testuser: ECS_USERSWITCHER_PARAMETER=-it devupdate.sh freshdb
  • dump current database, will be saved to /app/ecs.pgdump and will be preferred on restore over default iso dump

    • devupdate.sh dumpdb
  • dump current database to a custom filename:

    • devupdate.sh dumpdb mydump.pgdump
  • restore from custom dump (use absolute filenames for dumpfilename):

    • ECS_DUMP_FILENAME=~/mydump.pgdump devupdate.sh --restore-dump init
  • clone an existing database dump available via ssh into the devserver database

  • make a new database dump on a remote machine and transfer this dump via ssh into the devserver database

    • devupdate.sh transferdb [email protected] "gosu app /bin/bash -c 'set -o pipefail && pg_dump --encoding=utf-8 --format=custom -Z0 -d ecs | /bin/gzip --rsyncable'"
  • disable updates, branch switches & database restores

    • touch /app/devupdate.disabled
    • to remove this lock: rm /app/devupdate.disabled