Page "BloodhoundContributing" was changed by gjm Diff URL: <https://issues.apache.org/bloodhound/wiki/BloodhoundContributing?action=diff&version=20> Revision 20 Comment: adding hints for checking out the source code and notes on running with multiple databases Changes: -------8<------8<------8<------8<------8<------8<------8<------8<-------- Index: BloodhoundContributing ========================================================================= --- BloodhoundContributing (version: 19) +++ BloodhoundContributing (version: 20) @@ -14,31 +14,69 @@ Apache Bloodhound is written in Python and so, if you have already successfully installed Bloodhound, you will probably have all that you need to develop it too. -BloodhoundInstall and BloodhoundDetailedInstallation both provide information about installing but, if you already have Python, python-setuptools, python-pip and python-virtualenv, installation can be achieved as follows: +The latest version of the source code is available from the ASF's subversion repository at [https://svn.apache.org/repos/asf/bloodhound/trunk/]. In order to get the code from here, you will require a subversion client. For linux users there will certainly be a command line client in your distribution's repositories (e.g. {{{sudo apt-get install subversion}}} or {{{sudo yum install subversion}}}). For most platforms there should be various graphical programs that will also work (e.g. SmartSVN or TortoiseSVN) and it is also possible that the IDE that you choose to program with will also have subversion integration. See http://en.wikipedia.org/wiki/Comparison_of_Subversion_clients for more information on these choices. + +While the subversion repository is where committers are expected to submit their code, there is also an official mirror of the repositories on GitHub https://github.com/apache/bloodhound which provides an alternative if you prefer using git. Git, of course, requires its own client programs to be installed on your computer. + +If you choose to checkout from the subversion repository you can do this: +{{{ +#!sh +svn co https://svn.apache.org/repos/asf/bloodhound/trunk/ bloodhound +}}} + +Using git you would instead: +{{{ +#!sh +git clone https://github.com/apache/bloodhound.git +}}} + +BloodhoundInstall and BloodhoundDetailedInstallation both provide information about installing but, if you already have Python, python-setuptools, python-pip and python-virtualenv, installation proceed as follows: {{{ -svn co https://svn.apache.org/repos/asf/bloodhound/trunk/ bloodhound +#!sh +virtualenv bh +source bh/bin/activate cd bloodhound/installer -virtualenv bloodhound -source bloodhound/bin/activate pip install -r requirements-dev.txt -python bloodhound_setup.py --database-type=sqlite --admin-user=admin --admin-password=adminpasswd +}}} + +To complete the setup, the easiest option is to use the SQLite database: +{{{ +#!sh +python bloodhound_setup.py --project=sqlite --database-type=sqlite --admin-user=admin --admin-password=adminpasswd }}} after which you can run the standalone server: {{{ -tracd -r --port=8000 bloodhound/environments/main +#!sh +tracd -r --port=8000 bloodhound/environments/sqlite }}} With this method of installation, the Bloodhound and Trac code is run direct from the checked out code. Any source code for external dependencies and plugins meanwhile will be found in {{{../installer/bloodhound/src/}}}. -You should find that when you make changes to the associated source code, when using the {{{-r}}} option on {{{tracd}}}, the server will reload and the edited code will be run instead of the original. In order to get templates to reload after modifications are made, you can edit {{{bloodhound/environments/main/conf/trac.ini}}} and add the following line to the {{{[trac]}}} section: +It is also possible to run multiple environments at once from the {{{tracd}}} development server. This means that if you have also created a PostgreSQL database for testing you can setup a new environment with the command: +{{{ +#!sh +python bloodhound_setup.py --project=postgres --database-type=postgres -u bloodhound -p bloodhound --admin-user=admin --admin-password=adminpasswd +}}} + +and if all everything is set up properly you will be able to run both environments with: +{{{ +#!sh +tracd -r --port=8000 bloodhound/environments/sqlite bloodhound/environments/postgres +}}} + +This is particularly useful for making sure that changes that involve database interactions work for all the databases we support. + +You should find that when you make changes to the associated source code, when using the {{{-r}}} option on {{{tracd}}}, the server will reload and the edited code will be run instead of the original. In order to get templates to reload after modifications are made, you can edit {{{bloodhound/environments/main/sqlite/trac.ini}}} and add the following line to the {{{[trac]}}} section: {{{ #!ini auto_reload = true }}} + +and repeat for the postgres environment if required. == Contributing Code == -------8<------8<------8<------8<------8<------8<------8<------8<--------
-- Page URL: <https://issues.apache.org/bloodhound/wiki/BloodhoundContributing> Apache Bloodhound <https://issues.apache.org/bloodhound/> The Apache Bloodhound issue tracker This is an automated message. Someone added your email address to be notified of changes on 'BloodhoundContributing' page. If it was not you, please report to .