github
General Information
BHL Europe uses github for configuration management of the project.
The project can be found here:
https://github.com/gbhl/bhl-europe
If you have any problems please also consider reading the
PortalDevelopmentTroubleShooting page.
NOTE: If you cannot connect github via ssl because you have to
work behind a firewall, you can use alternatively connect via HTTP.
To commit to the project you must have commiter's privileges. Contact
wolfgang.koller@nhm-wien.ac.at or
lee.namba@atos.net to be added.
The bhl-europe repository contains directories for all of the components (pre-ingest, ingest, archival storage, portal, etc.).
This guide will go through the portal setup since it is the main shared development environment.
N.B. The following instructions only guide you through the normal workflow, for more flexible usage of git, please refer to
http://www.kernel.org/pub/software/scm/git/docs/user-manual.html
Prepare your github account
Getting the project
cd to the directory where you want to clone the repository on your local machine for example /home/user then execute the command
$ git clone git@github.com:gbhl/bhl-europe.git
Go into the newly created directory
$ cd bhl-europe
Import bhle/portal/drupal/database/bhle-portal.sql to create your instance of the portal drupal database. This script will create a database called
"bhle-portal-ait"
$ mysql -u username -p bhle-portal < portal/drupal/database/bhle-portal.sql
Copy the reference settings file bhle/portal/drupal/www/sites/default/ref.settings.php to settings.php;
$ cp portal/drupal/www/sites/default/ref.settings.php portal/drupal/www/sites/default/settings.php
In the settings.php modify the $database array with your database information.
In Apache create a virtual host or use a symbolic link for example named "portal" to the directory "portal/drupal/www", e.g.
Alias /portal "/home/bhle/portal/drupal/www"
<Directory "/home/bhle/portal/drupal/www">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
then restart the Apache server
Now you can test the portal with your web browser for example
Login to the portal as admin using
- login: bhletech
- password: **
Complete the Installation
In order to complete the installation of the portal and all required components like e.g. solr please follow the instructions in
PortalDevelopementSetup
Contribute to the project
1. Every time you are ready to contribute to the project
$ git pull
$ git checkout -b your-own-branch-name-here
Now remember to update your mysql database from the database file pulled from GitHub!
and now you are working in your own branch, which means the local master branch is unaffected. You can check if you are in the branch by
$ git status
This would print out the name of the branch in the first line and other information.
2. Contribute all want you to this project, and test your contribution until it is good enough to be pushed back to the repository
3. Dump your database (change the user name "root" accordingly to your local setup). Make sure you are in the root folder of your bhle git repository!
$ mysqldump -u root -p --ignore-table="bhle-portal.watchdog, bhle-portal.sessions" bhle-portal > portal/drupal/database/bhle-portal.sql
4. Add additional files to index
$ git add .
5. Commit your contribution
$ git commit -m "your commit message here"
If git is not committing your deletions or other changes you can alternatively use
$ git commit -a -m "your commit message here"
6. Synchronize the repository (within your own branch) again, in case any others update the remote master branch
$ git pull origin master
if pull successfully , go to step 7
if there are conflicts, you can do two things:
1) Decide not to merge. You can roll back to the recent commit (all modification will be lost).
$ git reset --hard HEAD
2) Resolve the conflicts (
recommanded). The most easy way to do it is by using mergetool (depends on your favorite tool for merge)
$ git mergetool
$ git commit -m "your merge message here"
7. Switch to the local branch
$ git checkout master
8. Merge your own branch into the master
$ git merge your-own-branch-name-here
9. Push all your contribution back to the remote repository
$ git push
10. If you need to discard your own branch, type
$ git branch -d your-own-branch-name-here
Working behind a firewall
Please see
https://github.com/blog/642-smart-http-support for more information.
configure the proxy:
$ git config --global http.proxy <PROXY-HOST>:<PORT>
clone via http
$ git clone https://github.com/gbhl/bhl-europe.git
switch your clone to http
replace ${user-name} by your git user name.
$ git remote set-url origin https://${user-name}@github.com/gbhl/bhl-europe.git