Add hook documentation

This commit is contained in:
Dennis Eichhorn 2018-06-24 18:14:25 +02:00
parent f1dbf260aa
commit ac0718927c
3 changed files with 30 additions and 5 deletions

View File

@ -17,4 +17,12 @@ These tools are all installed by running the `setup.sh` script from the Build re
## External Tools
As external tool scrutinizer is used to automate code inspection and provide insight on issues, bugs, best practices etc.
As external tool scrutinizer is used to automate code inspection and provide insight on issues, bugs, best practices etc.
## Git Hooks (Linux only)
For developers it is recommended to copy the contents of the `default.sh` file in the `Build` repository under `Hooks` to your `pre-commit` file in the `.git/hooks` directory. If the `pre-commit` file doesn't exist just create it.
The same should be done with every module. Simply go to `.git/modules/**/hooks` and also add the content of the `default.sh` file to all `pre-commit` files.
By doing this every commit will be inspected and either pass without warnings, pass with warnings or stop with errors. This will allow you to fix code before committing it. Be aware only changed files will be inspected. Also make sure all `pre-commit` have `+x` permissions.

View File

@ -28,4 +28,12 @@ The following tools are important to test the application and to ensure the code
* pdepend
* documentor
* phpstan
* phan
* phan
## Git Hooks (Linux only)
For developers it is recommended to copy the contents of the `default.sh` file in the `Build` repository under `Hooks` to your `pre-commit` file in the `.git/hooks` directory. If the `pre-commit` file doesn't exist just create it.
The same should be done with every module. Simply go to `.git/modules/**/hooks` and also add the content of the `default.sh` file to all `pre-commit` files.
By doing this every commit will be inspected and either pass without warnings, pass with warnings or stop with errors. This will allow you to fix code before committing it. Be aware only changed files will be inspected. Also make sure all `pre-commit` have `+x` permissions.

View File

@ -24,20 +24,29 @@ This is the prefered way to install the application since this also installs all
### Steps
The following steps will setup the application and perform extensive code quality checks and documentation tasks:
The following steps will setup the application, download all necessary tools and perform extensive code quality checks and documentation tasks:
1. Go somewhere where you want to install the build script
2. Enter `git clone -b develop https://github.com/Orange-Management/Build.git`
3. Modify `config.sh`
4. Run `chmod 777 buildProject.sh`
4. Run `chmod +x buildProject.sh`
5. Run `./buildProject.sh`
Alternatively after cloning the git repository:
1. Run `php phpunit.phar --configuration tests/phpunit_no_coverage.xml` inside `Orange-Management` or open `http://your_url.com/Install`
1. Run `php composor.phar install` inside `Orange-Management`
2. Run `php phpunit.phar --configuration tests/phpunit_no_coverage.xml` inside `Orange-Management` or open `http://your_url.com/Install`
This wil only setup the application instead of also performing additional code quality checks.
### Annotation
During this process the database automatically gets dropped (if existing) and re-created. The database user and password can't be changed right now since the install config relies on the same data. Future releases will make use of a new user that will get set up by the install script as well. If you don't have `xdebug` installed but `phpdbg` you can replace `php phpunit.phar ...` with `phpdbg -qrr phpunit.phar ...`.
## Git Hooks (Linux only)
For developers it is recommended to copy the contents of the `default.sh` file in the `Build` repository under `Hooks` to your `pre-commit` file in the `.git/hooks` directory. If the `pre-commit` file doesn't exist just create it.
The same should be done with every module. Simply go to `.git/modules/**/hooks` and also add the content of the `default.sh` file to all `pre-commit` files.
By doing this every commit will be inspected and either pass without warnings, pass with warnings or stop with errors. This will allow you to fix code before committing it. Be aware only changed files will be inspected. Also make sure all `pre-commit` have `+x` permissions.