Menu

Tree [253b2c] default tip /
 History

Read Only access


File Date Author Commit
 story_game_engine 2018-09-05 David H David H [c8741c] More deployment progress: build and install wheels
 .hgignore 2018-09-05 David H David H [c8741c] More deployment progress: build and install wheels
 LICENSE.txt 2018-05-29 David H David H [798318] Story Game Engine - put files under source control
 MANIFEST.in 2018-05-29 David H David H [798318] Story Game Engine - put files under source control
 README.txt 2018-09-05 David H David H [4b687d] Implement remote deployment (work-in-progress)
 deploy.yaml 2018-09-05 David H David H [253b2c] Fix to building and installing wheels
 development.ini 2018-09-05 David H David H [4b687d] Implement remote deployment (work-in-progress)
 development.rst 2018-08-25 David H David H [988623] minor updates
 production.ini 2018-09-05 David H David H [4b687d] Implement remote deployment (work-in-progress)
 pytest.ini 2018-05-29 David H David H [798318] Story Game Engine - put files under source control
 setup.py 2018-09-05 David H David H [4b687d] Implement remote deployment (work-in-progress)

Read Me

Story Game Engine
=================

Overview
--------

This is a web application for creating simple text-adventure style games
in a web browser using a wiki-style user interface.


Setting up for Development
--------------------------

- Clone the repository and cd to its directory.

    hg clone ssh://hg@bitbucket.org/dhandy2013/story-game-engine
    cd story-game-engine

- Create a Python virtual environment.

    python3 -m venv env

- Upgrade packaging tools.

    env/bin/pip install --upgrade pip setuptools
    env/bin/pip install wheel

- Install the project in editable mode with its testing requirements.

    env/bin/pip install -e ".[testing]"

- Configure the database.

    env/bin/initialize_story_game_engine_db development.ini

- Run the project's tests.

    env/bin/pytest

- Run the project.

    env/bin/pserve development.ini

- Open a web browser to: http://localhost:6543/story-game-engine/


Deployment to Production
------------------------

Install Ansible (using Python 3.x)::

    $ pip3 install --user ansible

Make sure ``~/.local/bin`` is in your ``PATH`` so you can run ansible.

Create ``/etc/ansible/hosts`` with these contents, replacing
``<your-server-hostname>`` with the real server host, and setting
``ansible_connection`` as needed::

    [story-game-engine]
    <your-server-hostname> ansible_connection=local

Create ``/etc/ansible/group_vars/story-game-engine`` with these variable settings::

    ---
    # Settings used by production.ini template and deploy.yaml
    http_port: <http-port-number>
    auth_secret: <random-secret-string-of-hex-characters>
    session_secret: <another-random-secret-string-of-hex-characters>
    app_url_prefix: /story-game-engine

Change permissions on this file so that only you and root can read it.

Hint: To generate 64 random hex digits::

    python -c "import random; r = random.SystemRandom(); print(''.join(r.choice('0123456789abcdef') for i in range(64)))"

To deploy the latest code and restart the services::

    $ ansible-playbook -K deploy.yaml

The starting admin password will be printed (among many other messages) if a
database doesn't already exist and therefore a new database is created.