From 6c1e32131e04af170fe0cb787c1f5274d026790a Mon Sep 17 00:00:00 2001 From: PhoeniXAbhisheK Date: Feb 28 2019 17:15:17 +0000 Subject: Windows-specific documentation added windows-specific documentation added fixes fixes fixes fixes fixes Fix for 'Title overline too short' markup and spacing fixes doc sequence changed --- diff --git a/docs/index.rst b/docs/index.rst index bb378af..c88fae2 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -10,6 +10,7 @@ Welcome to Fedora Happiness Packets's documentation! :maxdepth: 2 setup/development + setup/development_windows setup/authentication model diff --git a/docs/setup/development_windows.rst b/docs/setup/development_windows.rst new file mode 100644 index 0000000..d28647b --- /dev/null +++ b/docs/setup/development_windows.rst @@ -0,0 +1,84 @@ +=================================================== + Setting up a development environment on Windows +=================================================== + +This guide will take you through the process to setup your development environment on Windows OS. + +Prerequisites +=============== + +You will need the following programs installed on your system before proceeding with the setup. + +#. `Git `_ +#. `Python `_ (version >= 3.5) +#. `Docker Desktop for Windows `_ (Download, installation, and run instructions available) +#. Docker Compose (Docker Compose is included as part of Docker Desktop, but if you still need to download it, you can do it from `here `_) + + +Setting up the development environment +======================================== + +#. Fork the `current repository `_ to your profile . +#. Clone this forked repository to your system using Git with the following command:: + + git clone "https://pagure.io/forks//fedora-commops/fedora-happiness-packets.git" + + OR, if using ssh, + + git clone "ssh://git@pagure.io/forks//fedora-commops/fedora-happiness-packets.git" + +#. Once cloned, move inside the directory using the command:: + + cd fedora-happiness-packets + +#. Start the Docker application(With elevated/admin access). +#. Run the client secret generation script:: + + chmod -x generate_client_secrets.sh + generate_client_secrets.sh + + Here, you might get an error saying:: + + /bin/sh: ./generate_client_secrets.sh: not found + + This occurs mostly due to line endings being CRLF instead or the required LF. + This can be changed by modifying the settings of your respective editor, or else from console using `this method `_ + +#. To run the web server, run:: + + docker-compose up + +Once executed successfully, you should be able to view the main page on `http://localhost:8000/ `_ + +Congratulations, you have successfully setup the development environment on your system. + +After making changes to any file, you'll have to run the command:: + + docker-compose up --build + +For ``docker-compose up`` or ``docker-compose up --build`` you might get an error of:: + + alpinelinux.org error ERROR: unsatisfiable constraints + +This can be resolved by simply following the below steps + +#. Open Docker settings. +#. Click on Network. +#. Look for 'DNS Server' section. +#. It is set to *Automatic* by default, change it to *fixed*. +#. The IP address should now be editable. Change it from ``8.8.8.8`` to ``8.8.4.4``. +#. Save the settings and restart Docker. + +In order to run tests, make sure to execute ``docker-compose up`` command. Now in a new terminal(for the same container) run:: + + docker-compose exec web sh + +Then the terminal will show a ``#`` symbol. +Simply type in ``t`` to initiate the test suite. + +(The test suite are run by running the ``t`` script, which runs the tests with the appropriate testing settings and provides a coverage report.) + +Integration tests are run via the following command:: + + manage.py test -v 2 -p integration_test*.py --settings=happinesspackets.settings.tsting +