globalvoices / NewsFrames-Code

Code for the NewsFrames Platform available at newsframes.org
https://newsframes.globalvoices.org
Other
2 stars 1 forks source link

GlobalVoices

Current build status:

master: PENDING

develop: CircleCI

Requirements

Etherpad setup

BiasDetector setup:

If you face issue while installing libraries, you may have to run pip tool using sudo privileges.

To test bias detector, go to bias-detector/bsd/bsdetector and type python newsframe.py "hello world". If it works, your bias detector installation is working fine.

Rails setup

Running

Testing

Deployment

One-time server setup:

Deploy application (staging):

Once the application code is deployed, you can control the processes (see config/god.rb) with:

We have continuous integration enabled using Circle CI. Builds are created, tests are run for every checkin in every branch. Staging build is deployed when master or develop is updated.

Etherpad deployment:

Deploy application (production):

Server is configured using ansible playbook. See ansible/README.md

Once server is configured, change nginx cache permissions as following. You would need sudo access to do it.

chown -R www-data:www-data /var/cache/nginx

Running (production):

To control server from your local machine, type:

To control server after ssh, preferred approach is to use systemctl if configured, but you can also use:

To start etherpad, you have to ssh. Preferred approach is to use systemctl if configured, but you can also use:

nohup ./etherpad/bin/run.sh &

To stop etherpad, you have to ssh. Preferred approach is to use systemctl if configured, else, you have to find the process id and kill it.

Autostart app (production)

We use 2 systemd scripts to start app processes when machine is rebooted - scripts/newsframes.service and scripts/etherpad.service. These are not deployed using ansible and should be done manually in /etc/systemd/system. If the system does not support systemd, init.d scripts will have to be written specifically.

Once the scripts have been deployed, the following commands can be used to run the scripts on machine boot:

The following commands can be used to control these services:

Notes

To create an admin, run (without <>)

If an existing user is to be made admin, just use the email parameter.