Fixed naming (phpci -> php-censor)
This commit is contained in:
parent
4fee89fb80
commit
31f92327c1
76 changed files with 357 additions and 348 deletions
|
|
@ -1,7 +1,7 @@
|
|||
Adding PHP Censor Support to Your Projects
|
||||
------------------------------------------
|
||||
|
||||
Similar to Travis CI, to support PHP Censor in your project, you simply need to add a `phpci.yml` file to the root of
|
||||
Similar to Travis CI, to support PHP Censor in your project, you simply need to add a `.php-censor.yml` (`phpci.yml` for backward compatibility with PHPCI) file to the root of
|
||||
your repository. The file should look something like this:
|
||||
|
||||
```yml
|
||||
|
|
|
|||
|
|
@ -3,11 +3,11 @@ 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 phpci 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 `phpci` section in the config file (which is in [yaml format](https://en.wikipedia.org/wiki/YAML)), and add
|
||||
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
|
||||
|
||||
phpci:
|
||||
php-censor:
|
||||
authentication_settings:
|
||||
state: 1
|
||||
user_id: 1
|
||||
|
||||
where you can get the user_id by logging into the mysql database and selecting your user ID from the `users` table in the `phpci` database.
|
||||
where you can get the user_id by logging into the mysql database and selecting your user ID from the `users` table in the PHP Censor database.
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ Installing PHP Censor from Composer
|
|||
* Download Composer if you haven't already: `curl -sS https://getcomposer.org/installer | php`
|
||||
* Download PHP Censor: `./composer.phar create-project corpsee/php-censor php-censor --keep-vcs --no-dev`
|
||||
* Go to the newly created PHP Censor directory, and install Composer dependencies: `cd php-censor && ../composer.phar install`
|
||||
* Run the PHP Censor installer: `./console phpci:install`
|
||||
* Run the PHP Censor installer: `./console php-censor:install`
|
||||
* [Add a virtual host to your web server](virtual_host.md), pointing to the `public` directory within your new PHP Censor directory. You'll need to set up rewrite rules to point all non-existent requests to PHP Censor.
|
||||
* [Set up the PHP Censor Worker](workers/worker.md), or you can run builds using the [daemon](workers/daemon.md) or [a cron-job](workers/cron.md) to run PHP Censor builds.
|
||||
|
||||
|
|
@ -30,6 +30,6 @@ Installing PHP Censor Manually
|
|||
* [Download PHP Censor](https://github.com/corpsee/php-censor/releases/latest) and unzip it.
|
||||
* Go to the PHP Censor directory: `cd /var/www/php-censor`
|
||||
* Install dependencies using Composer: `composer install`
|
||||
* Install PHP Censor itself: `php ./console phpci:install`
|
||||
* Install PHP Censor itself: `./console php-censor:install`
|
||||
* [Add a virtual host to your web server](virtual_host.md), pointing to the `public` directory within your new PHP Censor directory. You'll need to set up rewrite rules to point all non-existent requests to PHP Censor.
|
||||
* [Set up the PHP Censor Worker](workers/worker.md), or you can run builds using the [daemon](workers/daemon.md) or [a cron-job](workers/cron.md) to run PHP Censor builds.
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ Setting up Logging
|
|||
Basics
|
||||
======
|
||||
|
||||
The phpci codebase makes use of the [psr3](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md) logging standard. By default we use [Monolog](https://github.com/Seldaek/monolog) to handle the actual work implementing this standard.
|
||||
The PHP Censor codebase makes use of the [PSR3](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md) logging standard. By default we use [Monolog](https://github.com/Seldaek/monolog) to handle the actual work implementing this standard.
|
||||
|
||||
How to Setup Logging (For people running a PHP Censor instance)
|
||||
===============================================================
|
||||
|
|
@ -22,9 +22,9 @@ return array(
|
|||
}
|
||||
);
|
||||
```
|
||||
This file should return an array of key value pairs. Each key tells phpci which command to attach the logger to (the underscore is a special value which matches all commands). For each command an array of [Monolog](https://github.com/Seldaek/monolog) handlers should be returned. In the example above we've used one that simply writes to the file system but in practise this could be any handler written for monolog.
|
||||
This file should return an array of key value pairs. Each key tells PHP Censor which command to attach the logger to (the underscore is a special value which matches all commands). For each command an array of [Monolog](https://github.com/Seldaek/monolog) handlers should be returned. In the example above we've used one that simply writes to the file system but in practise this could be any handler written for monolog.
|
||||
|
||||
Once this file is created all plugins and core phpci functionality should start writing to the configured handlers.
|
||||
Once this file is created all plugins and core PHP Censor functionality should start writing to the configured handlers.
|
||||
|
||||
How to write to the Log (For people creating a new plugin)
|
||||
==========================================================
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ Configuration
|
|||
|
||||
* **config** - Required - Can be either a single string pointing to a Codeception configuration file, or an array of configuration file paths. By default this is called `codeception.yml` and will be in the root of your project.
|
||||
|
||||
* **args** - Optional - The string of arguments to be passed to the run command. **Important**, due to the assumption made on line [132](https://github.com/Block8/PHPCI/blob/master/PHPCI/Plugin/Codeception.php#L132) regarding the value of `--xml` being the next argument which will not be correct if the user provides arguments using this config param, you must specify `report.xml` before any user input arguments to satisfy the report processing on line [146](https://github.com/Block8/PHPCI/blob/master/PHPCI/Plugin/Codeception.php#L146)
|
||||
* **args** - Optional - The string of arguments to be passed to the run command.**Important**, due to the assumption made on line [132](https://github.com/Block8/PHPCI/blob/master/PHPCI/Plugin/Codeception.php#L132) regarding the value of `--xml` being the next argument which will not be correct if the user provides arguments using this config param, you must specify `report.xml` before any user input arguments to satisfy the report processing on line [146](https://github.com/Block8/PHPCI/blob/master/PHPCI/Plugin/Codeception.php#L146)
|
||||
|
||||
* **path** - Optional - The path from the root of your project to the root of the codeception _output directory
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ Configuration
|
|||
| Field | Required? | Description |
|
||||
|-------|-----------|-------------|
|
||||
| `webhook_url` | Yes | The URL to your Slack WebHook |
|
||||
| `room` | No | Your Slack room name. Default - #phpci |
|
||||
| `room` | No | Your Slack room name. Default - #php-censor |
|
||||
| `username` | No | The name to send the message as. Default - PHP Censor |
|
||||
| `icon` | No | The URL to the user icon or an emoji such as :ghost:. Default - The value configured on Slack's WebHook setup |
|
||||
| `message` | No | The message to send to the room. Default - `<%PROJECT_URI%|%PROJECT_TITLE%> - <%BUILD_URI%|Build #%BUILD%> has finished for commit <%COMMIT_URI%|%SHORT_COMMIT% (%COMMIT_EMAIL%)> on branch <%BRANCH_URI%|%BRANCH%>` |
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ Installation
|
|||
============
|
||||
|
||||
1. On debian system (for example) use aptitude command to install sendxmpp
|
||||
2. Add XMPP plugin in "complete" section of your phpci.yml
|
||||
2. Add XMPP plugin in "complete" section of your `php-censor.yml`
|
||||
|
||||
Configuration
|
||||
=============
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ Updating PHP Censor to the latest release, or even dev-master updates is somethi
|
|||
|
||||
1. Go to your PHP Censor root folder in a Terminal.
|
||||
2. Pull the latest code. This would look like this: `git pull`
|
||||
3. Update the PHP Censor database: `./console phpci:update`
|
||||
3. Update the PHP Censor database: `./console php-censor:update`
|
||||
4. Update the composer and its packages: `composer self-update && composer update`
|
||||
5. Return to the PHP Censor admin screens and check your desired plugins are still installed correctly.
|
||||
7. Run a build to make sure everything is working as expected.
|
||||
|
|
|
|||
|
|
@ -11,7 +11,10 @@ Setting up the Cron Job
|
|||
You'll want to set up PHP Censor to run as a regular cronjob, so run `crontab -e` and enter the following:
|
||||
|
||||
```sh
|
||||
* * * * * /usr/bin/php /path/to/phpci/console php-censor:run-builds
|
||||
|
||||
# For backward compatibility with PHPCI
|
||||
* * * * * /usr/bin/php /path/to/phpci/console phpci:run-builds
|
||||
```
|
||||
|
||||
**Note:** Make sure you change the `/path/to/phpci` to the directory in which you installed PHP Censor, and update the PHP path if necessary.
|
||||
**Note:** Make sure you change the `/path/to/php-censor` to the directory in which you installed PHP Censor, and update the PHP path if necessary.
|
||||
|
|
|
|||
|
|
@ -18,13 +18,13 @@ Setting up the PHP Censor worker
|
|||
|
||||
### On a new installation
|
||||
|
||||
Setting up the worker on a new installation of PHP Censor is as simple as entering the appropriate values for your Beanstalkd server hostname and queue name when running the PHP Censor installer. By default, the installer assumes that you'll be using beanstalkd on `localhost` and will use the queue name `phpci`.
|
||||
Setting up the worker on a new installation of PHP Censor is as simple as entering the appropriate values for your Beanstalkd server hostname and queue name when running the PHP Censor installer. By default, the installer assumes that you'll be using beanstalkd on `localhost` and will use the queue name `php-censor-queue`.
|
||||
|
||||

|
||||
|
||||
### On an existing installation
|
||||
|
||||
On an existing installation, to set up the worker, you simply need to add the beanstalkd host and queue names directly into your `config.yml` file. You should add a `worker` key beneath the `phpci` section, with the properties `host` and `queue` as outlined in the screenshot below:
|
||||
On an existing installation, to set up the worker, you simply need to add the beanstalkd host and queue names directly into your `config.yml` file. You should add a `worker` key beneath the `php-censor` section, with the properties `host` and `queue` as outlined in the screenshot below:
|
||||
|
||||

|
||||
|
||||
|
|
@ -33,7 +33,7 @@ Running the PHP Censor worker
|
|||
|
||||
Once you've set up PHP Censor to add your jobs to a beanstalkd queue, you need to start the worker so that it can pick up and run your builds. On most servers, it is best to manage this using supervisord. The following instructions work on Ubuntu, but will need slight amendments for other distributions.
|
||||
|
||||
Using your preferred text editor, create a file named `phpci.conf` under `/etc/supervisor/conf.d`. In it, enter the following config:
|
||||
Using your preferred text editor, create a file named `php-censor.conf` under `/etc/supervisor/conf.d`. In it, enter the following config:
|
||||
|
||||
```
|
||||
[program:phpci]
|
||||
|
|
@ -48,9 +48,9 @@ environment=HOME="/home/phpci",USER="phpci"
|
|||
numprocs=2
|
||||
```
|
||||
|
||||
You'll need to edit the '/path/to/phpci', the `user` value and the `environment` value to suit your server. The user needs to be an actual system user with suitable permissions to execute PHP and PHP Censor.
|
||||
You'll need to edit the '/path/to/php-censor', the `user` value and the `environment` value to suit your server. The user needs to be an actual system user with suitable permissions to execute PHP and PHP Censor.
|
||||
|
||||
Once you've created this file, simply restart supervisord using the command `service supervisor restart` and 2 instances of PHP Censor's worker should start immediately. You can verify this by running the command `ps aux | grep phpci`, which should give you output as follows:
|
||||
Once you've created this file, simply restart supervisord using the command `service supervisor restart` and 2 instances of PHP Censor's worker should start immediately. You can verify this by running the command `ps aux | grep php-censor`, which should give you output as follows:
|
||||
|
||||
```
|
||||
➜ ~ ps aux | grep phpci
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue