Skip to content

Commit

Permalink
Added CentOS / Fedora support and added missing dependencies. (#1023)
Browse files Browse the repository at this point in the history
  • Loading branch information
ecalder6 committed Sep 15, 2017
1 parent 67fd292 commit fa8bee6
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 5 deletions.
24 changes: 21 additions & 3 deletions docs/environment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,22 @@ Setup Your Database

Semester.ly stores objects like courses, timetables, and students in a Postgres database. Let's get one setup for you.

Let's enter the Postgres shell by typing:
Let's first initialize Postgres using the default user account ``postgres``

Log into this account with

.. code-block:: bash
sudo -i -u postgres
Then, enter Postgres environment with

.. code-block:: bash
psql postgres
.. note:: If you see an error in CentOS / Fedora, it's most likely due to postgres is not running. Initialize it with ``sudo service postgresql initdb && sudo service postgresql start``.

Here you can enter SQL to create/manipulate/access databases. Let's create a Semester.ly database. Enter:

.. code-block:: psql
Expand All @@ -40,6 +50,14 @@ Great. You are all set. Enter the following to quit psql:
\q
Then enter the following to log out from user ``postgres``

.. code-block:: bash
exit
.. note:: For CentOS / Fedora, Change all occurances of ident to md5 in pg_hba.conf. You can modify the file through ``sudo vim /var/lib/pgsql9/data/pg_hba.conf``. After you change it, restart postgres with ``sudo service postgresql restart``.

Create Local Settings
~~~~~~~~~~~~~~~~~~~~~

Expand Down Expand Up @@ -88,13 +106,13 @@ For development purposes, we map http://sem.ly:8000 to http://localhost:8000. To

Set your Environment Type
~~~~~~~~~~~~~~~~~~~~~~~~~
Add the following line to either your ``~/.bash.rc`` or ``~/.zshrc`` which tells webpack you are running a development environment:
Add the following line to either your ``~/.bashrc`` or ``~/.zshrc`` which tells webpack you are running a development environment:

.. code-block:: bash
export NODE_ENV=development
Then ``source ~/.bash.rc`` or ``source ~/.zshrc``
Then ``source ~/.bashrc`` or ``source ~/.zshrc``

And make sure the following line returns "development"

Expand Down
25 changes: 23 additions & 2 deletions docs/setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,32 @@ Before installing the python requirements, you must make sure to have PostgreSQL

.. code-block:: bash
sudo apt-get install postgresql
sudo apt-get install sudo apt-get install postgresql python-psycopg2 libpq-dev libxslt-dev libxml2-dev
**On CentOS / Fedora** use yum:

.. code-block:: bash
sudo yum install postgresql gcc python-lxml postgresql-libs libxslt-devel libxml2-devel
Install Python Requirements
~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. note:: **ATTENTION MAC USERS:**, you must install the xcode command line tools via ``xcode-select --install`` before proceeding. You may also need to update openssl. If so, please `follow this guide <https://medium.com/@katopz/how-to-upgrade-openssl-8d005554401>`_.
.. note:: **ATTENTION MAC USERS:** you must install the xcode command line tools via ``xcode-select --install`` before proceeding. You may also need to update openssl. If so, please `follow this guide <https://medium.com/@katopz/how-to-upgrade-openssl-8d005554401>`_.

All python dependencies are kept in a file called ``requirements.txt``. Anytime a dependency is added or changed, we update it in this file. To bring your virutal environment up to date with all of these requirements easily, simply execute:

.. code-block:: bash
pip install --upgrade pip
pip install -r requirements.txt
There are python modules that are missing from requirements.txt. Install them with:

.. code-block:: bash
pip install pyyaml pygments kombu==3.0.33 billiard
Install Node Packages
~~~~~~~~~~~~~~~~~~~~~~
Node and node package manager are the backbone of our frontend setup. To begin, install Node Package Manager (npm).
Expand All @@ -91,6 +104,14 @@ Node and node package manager are the backbone of our frontend setup. To begin,
sudo apt-get install nodejs
sudo apt-get install npm
**On CentOS / Fedora**:

.. code-block:: bash
sudo yum install -y gcc-c++ make
curl -sL https://rpm.nodesource.com/setup_6.x | sudo -E bash -
sudo yum install nodejs
Then use the newly installed Node Package Manager (npm) to install all javascript dependencies. When you execute this command, it reads from the file ``package.json`` which specifies all dependencies, their versions, and some additional node related configurations:

.. code-block:: bash
Expand Down

0 comments on commit fa8bee6

Please sign in to comment.