Skip to content

Commit

Permalink
installation: update installation instructions
Browse files Browse the repository at this point in the history
Signed-off-by: Graeme Watt <graeme.watt@durham.ac.uk>
  • Loading branch information
GraemeWatt committed Dec 7, 2016
1 parent 0731a25 commit 643c8b0
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 30 deletions.
10 changes: 5 additions & 5 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Types of Contributions
Report Bugs
~~~~~~~~~~~

Report bugs at https://github.com/hepdata/hepdata/issues.
Report bugs at https://github.com/HEPData/hepdata/issues.

If you are reporting a bug, please include:

Expand Down Expand Up @@ -41,7 +41,7 @@ Submit Feedback
~~~~~~~~~~~~~~~

The best way to send feedback is to file an issue at
https://github.com/hepdata/hepdata/issues.
https://github.com/HEPData/hepdata/issues.

If you are proposing a feature:

Expand All @@ -53,9 +53,9 @@ If you are proposing a feature:
Get Started!
------------

Ready to contribute? Here's how to set up `invenio` for local development.
Ready to contribute? Here's how to set up `hepdata` for local development.

1. Fork the `invenio` repo on GitHub.
1. Fork the `hepdata` repo on GitHub.
2. Clone your fork locally:

.. code-block:: console
Expand Down Expand Up @@ -109,5 +109,5 @@ Before you submit a pull request, check that it meets these guidelines:
2. If the pull request adds functionality, the docs should be updated. Put
your new functionality into a function with a docstring.
3. The pull request should work for Python 2.7, 3.3, 3.4 and 3.5. Check
https://travis-ci.com/hepdata/hepdata/pull_requests
https://travis-ci.org/HEPData/hepdata/pull_requests
and make sure that the tests pass for all supported Python versions.
42 changes: 20 additions & 22 deletions INSTALL.rst
Original file line number Diff line number Diff line change
@@ -1,56 +1,54 @@
Installation
============

First install HEPData all requirements:
First install all requirements:

.. code-block:: console
$ mkvirtualenv hepdata3
(hepdata3)$ pip install -r requirements.txt --pre --src ~/src/ --exists-action i
(hepdata3)$ pip install -e .[postgresql]
$ mkvirtualenv hepdata
$ mkdir ~/src/
$ cd ~/src/
$ git clone https://github.com/HEPData/hepdata
$ cd hepdata
(hepdata)$ pip install -e . --pre --upgrade
Next, install and build assets:

.. code-block:: console
(hepdata3)$ npm update && npm install --silent -g node-sass clean-css uglify-js requirejs
(hepdata3)$ hepdata npm
(hepdata3)$ cdvirtualenv var/hepdata-instance/static
(hepdata3)$ npm install
(hepdata3)$ hepdata collect -v
(hepdata3)$ hepdata assets build
(hepdata)$ npm update && npm install --silent -g node-sass clean-css uglify-js requirejs
(hepdata)$ ./scripts/clean_assets.sh
Next, create the database and database tables if you haven't already done so:
Run Celery:

.. code-block:: console
(hepdata3)$ hepdata db init
(hepdata3)$ hepdata db create
# -B runs celery beat
(hepdata)$ celery worker -E -B -A hepdata.celery
Run Celery
Next, create the database and database tables if you haven't already done so.
Also create a user (pass your email address as an argument to the script) and populate the database with some records:

.. code-block:: console
# -B runs celery beat
(hepdata3)$ celery worker -E -B -A hepdata.celery
(hepdata)$ ./scripts/initialise_db.sh your@email.com
Now, start HEPData:

.. code-block:: console
(hepdata3)$ hepdata --debug run
(hepdata)$ hepdata run --debugger --reload
(hepdata)$ firefox http://localhost:5000/
Run using honcho
============
================

Honcho will run elasticsearch, redis, celery, and the web application for you automatically.
Just workon your virtual environment, go to the root directory of hepdata source where you can see a file called
Procfile. Then install flower if you haven't done so already, and then start honcho.

.. code-block:: console
(hepdata3)$ pip install flower
(hepdata3)$ honcho start
(hepdata)$ pip install flower
(hepdata)$ honcho start
12 changes: 9 additions & 3 deletions scripts/initialise_db.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
#!/usr/bin/env bash

if [ $# -ne 1 ]; then
echo "Usage: $0 your_email_address"
exit 1
fi

hepdata db drop
hepdata db init
hepdata db create
Expand All @@ -8,11 +14,11 @@ hepdata roles create coordinator
hepdata roles create admin

# Next, create the users
hepdata users create eamonnmag@gmail.com --password -a
hepdata users create $1 --password -a

# Finally, add the roles to the user
hepdata roles add eamonnmag@gmail.com coordinator
hepdata roles add eamonnmag@gmail.com admin
hepdata roles add $1 coordinator
hepdata roles add $1 admin

# now populate the database with some records. NOTE:
# Celery needs to be running.
Expand Down

0 comments on commit 643c8b0

Please sign in to comment.