Small content fixes

This commit is contained in:
Dmitry Khomutov 2017-02-02 19:32:17 +07:00
parent 8779880a8f
commit 327f442ebb
No known key found for this signature in database
GPG key ID: 7EB36C9576F9ECB9
9 changed files with 127 additions and 78 deletions

View file

@ -80,7 +80,7 @@ complete:
default_mailto_address: admin@php-censor.local
```
More details about [configuring project](docs/en/config.md).
More details about [configuring project](docs/en/configuring_project.md).
Installing
----------

View file

@ -1,9 +1,9 @@
{
"name": "corpsee/php-censor",
"description": "PHP Censor is a fork of PHPCI and is a open source continuous integration tool specifically designed for PHP",
"description": "PHP Censor is a open source self-hosted continuous integration server for PHP projects (Fork of PHPCI)",
"minimum-stability": "stable",
"type": "application",
"keywords": ["php", "php-censor", "ci", "continuous integration"],
"keywords": ["php", "php-censor", "phpci", "ci-server", "testing", "self-hosted", "open-source", "ci", "continuous integration"],
"homepage": "https://github.com/corpsee/php-censor",
"license": "BSD-2-Clause",
"authors": [

View file

@ -8,7 +8,7 @@ Getting Started
* [Adding a Virtual Host](virtual_host.md)
* [Run builds using a worker](workers/worker.md)
* [Run builds using cronjob](workers/cron.md)
* [Adding PHP Censor Support to Your Projects](config.md)
* [Adding PHP Censor Support to Your Projects](configuring_project.md)
* [Setting up Logging](logging.md)
* [Updating PHP Censor](updating.md)
* [Configuring PHP Censor](configuring.md)

View file

@ -1,62 +0,0 @@
Adding PHP Censor Support to Your Projects
==========================================
Similar to Travis CI, to support PHP Censor in your project, you simply need to add a `.php-censor.yml` (`phpci.yml`/`.phpci.yml` for backward compatibility with PHPCI) file to the root of
your repository. The file should look something like this:
```yml
build_settings:
clone_depth: 1 # depth of 1 is a shallow clone, remove this line to clone entire repo
ignore:
- "vendor"
- "tests"
mysql:
host: "localhost"
user: "root"
pass: ""
setup:
mysql:
- "DROP DATABASE IF EXISTS test;"
- "CREATE DATABASE test;"
- "GRANT ALL PRIVILEGES ON test.* TO test@'localhost' IDENTIFIED BY 'test';"
composer:
action: "install"
test:
php_unit:
config:
- "PHPUnit-all.xml"
- "PHPUnit-ubuntu-fix.xml"
directory:
- "tests/"
run_from: "phpunit/"
coverage: "tests/logs/coverage"
php_mess_detector:
allow_failures: true
php_code_sniffer:
standard: "PSR2"
php_cpd:
allow_failures: true
grunt:
task: "build"
complete:
mysql:
host: "localhost"
user: "root"
pass: ""
- "DROP DATABASE IF EXISTS test;"
```
As mentioned earlier, PHP Censor is powered by plugins, there are several phases in which plugins can be run:
* `setup` - This phase is designed to initialise the build procedure.
* `test` - The tests that should be run during the build. Plugins run during this phase will contribute to the success or failure of the build.
* `complete` - Always called when the `test` phase completes, regardless of success or failure. **Note** that is you do any DB stuff here, you will need to add the DB credentials to this section as well, as it runs in a separate instance.
* `success` - Called upon success of the `test` phase.
* `failure` - Called upon failure of the `test` phase.
* `fixed` - Called upon success of the `test` phase if the previous build of the branch was a success.
* `broken` - Called upon failure of the `test` phase if the previous build of the branch was a failure.
The `ignore` section is merely an array of paths that should be ignored in all tests (where possible.)

View file

@ -4,17 +4,52 @@ Configuring PHP Censor
The PHP Censor configuration on the server is automatically generated into the `config.yml` file during installation.
One might need to also edit the file manually.
For example, one could log into PHP Censor and go into the settings to disable it. But if you have already set up a
username/password pair and have forgotten the password, and if the server is on a local network, and it's not sending
the `forgot password` email, then editing the config file manually would be handy. To do so, just edit the `php-censor`
section in the config file (which is in [yaml format](https://en.wikipedia.org/wiki/YAML)), and add
There is `config.yml` example:
```yml
b8:
database:
servers:
read:
- host: localhost
port: 3306
write:
- host: localhost
port: 3306
type: mysql # Database type: "mysql" or "pgsql"
name: php-censor-db
username: php-censor-user
password: php-censor-password
php-censor:
language: en
per_page: 10
url: 'http://php-censor.local'
email_settings:
from_address: 'no-reply@php-censor.local'
smtp_address:
queue:
use_queue: true
host: localhost
name: php-censor-queue
lifetime: 600
github:
token: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
comments:
commit: false # This option allow/deny to post comments to Github commit
pull_request: false # This option allow/deny to post comments to Github Pull Request
build:
remove_builds: true # This option allow/deny build cleaning
security:
disable_auth: true
default_user_id: 1
disable_auth: false # This option allows/deny you to disable authentication for PHP Censor
default_user_id: 1 # Default user when authentication disabled
auth_providers: # Authentication providers
internal:
type: internal # Default provider (PHP Censor internal authentication)
ldap:
type: ldap # Your LDAP provider
data:
host: 'ldap.php-censor.local'
port: 389
base_dn: 'dc=php-censor,dc=local'
mail_attribute: mail
```
where you can get the `default_user_id` by logging into the database and selecting your user ID from the `users` table in
the PHP Censor database.

View file

@ -0,0 +1,75 @@
Adding PHP Censor Support to Your Projects
==========================================
Similar to Travis CI, to support PHP Censor in your project, you simply need to add a `.php-censor.yml`
(`phpci.yml`/`.phpci.yml` for backward compatibility with PHPCI) file to the root of your repository. The file should
look something like this:
```yml
build_settings:
clone_depth: 1 # depth of 1 is a shallow clone, remove this line to clone entire repo
ignore:
- "vendor"
- "tests"
mysql:
host: "localhost"
user: "root"
pass: ""
setup:
mysql:
- "DROP DATABASE IF EXISTS test;"
- "CREATE DATABASE test;"
- "GRANT ALL PRIVILEGES ON test.* TO test@'localhost' IDENTIFIED BY 'test';"
composer:
action: "install"
test:
php_unit:
config:
- "PHPUnit-all.xml"
- "PHPUnit-ubuntu-fix.xml"
directory:
- "tests/"
run_from: "phpunit/"
coverage: "tests/logs/coverage"
php_mess_detector:
allow_failures: true
php_code_sniffer:
standard: "PSR2"
php_cpd:
allow_failures: true
grunt:
task: "build"
complete:
mysql:
host: "localhost"
user: "root"
pass: ""
- "DROP DATABASE IF EXISTS test;"
branch-dev: # Branch-specific config (for "dev" branch)
run-option: replace # "run-option" parameter can be set to 'replace', 'after' or 'before'
test:
grunt:
task: "build-dev"
```
As mentioned earlier, PHP Censor is powered by plugins, there are several phases in which plugins can be run:
* `setup` - This phase is designed to initialise the build procedure.
* `test` - The tests that should be run during the build. Plugins run during this phase will contribute to the success or failure of the build.
* `complete` - Always called when the `test` phase completes, regardless of success or failure. **Note** that is you do any DB stuff here, you will need to add the DB credentials to this section as well, as it runs in a separate instance.
* `success` - Called upon success of the `test` phase.
* `failure` - Called upon failure of the `test` phase.
* `fixed` - Called upon success of the `test` phase if the previous build of the branch was a success.
* `broken` - Called upon failure of the `test` phase if the previous build of the branch was a failure.
The `ignore` section is merely an array of paths that should be ignored in all tests (where possible).

View file

@ -14,12 +14,11 @@ Configuration
* **cc** - A list of addresses that will receive a copy of every emails sent.
* **template** - The template to use, options are short and long. Default is short on success and long otherwise.
**Note:** _This plugin will only work if you configured email settings during installation or configured them later in Admin Options > Settings > Email Settings_
### Examples
See [Adding PHP Censor Support to Your Projects](../config.md) for more information about how to configure plugins.
See [Adding PHP Censor Support to Your Projects](../configuring_project.md) for more information about how to configure plugins.
Send an email to the committer as well as one@exameple.com if a build fails:
```yml

View file

@ -268,6 +268,9 @@ class InstallCommand extends Command
{
$skipQueueConfig = [
'queue-use' => false,
'host' => null,
'name' => null,
'lifetime' => 600
];
if (!$input->getOption('queue-use')) {

View file

@ -93,7 +93,6 @@ class Executor
$plugins = $branchConfig[$stage];
$runOption = 'after';
if (!empty($branchConfig['run-option'])) {
$runOption = $branchConfig['run-option'];
}