Improved docs

This commit is contained in:
Dmitry Khomutov 2016-07-19 15:12:28 +06:00
commit 320a249153
49 changed files with 454 additions and 193 deletions

View file

@ -1,8 +1,12 @@
Run Builds Using Cron
---------------------
Running builds using cron is a quick and simple method of getting up and running with PHPCI. It also removes the need for PHPCI to be running all the time.
If you want a little more control over how PHPCI runs, you may want to [set up the PHPCI daemon](/Block8/PHPCI/wiki/Run-Builds-Using-a-Daemon) instead.
If you want a little more control over how PHPCI runs, you may want to [set up the PHPCI daemon](workers/daemon.md) instead.
## Setting up the Cron Job:
Setting up the Cron Job
=======================
You'll want to set up PHPCI to run as a regular cronjob, so run `crontab -e` and enter the following:

View file

@ -1,10 +1,14 @@
Run Builds Using a Daemon
-------------------------
The PHPCI daemon runs in the background on your server and continuously checks for new builds. Unless already running a build, the daemon should pick up and start running new builds within seconds of being created.
The daemon is also useful if you want to run multiple PHPCI workers in a virtualised environment (i.e. Docker)
If you want to run PHPCI builds on a regular schedule instead, you should [set up a cron-job](/Block8/PHPCI/wiki/Run-Builds-Using-Cron).
If you want to run PHPCI builds on a regular schedule instead, you should [set up a cron-job](workers/cron.md).
## Starting the Daemon:
Starting the Daemon
===================
On a Linux/Unix server, the following command will start the daemon and keep it running even when you log out of the server:

View file

@ -1,29 +1,35 @@
Run Builds Using a Worker
-------------------------
The PHPCI Worker (added in v1.7) runs in the background on your server and waits for new builds to be added to a Beanstalkd queue. Unless already running a build, the worker will pick up and start running new builds almost immediately after their creation.
The worker is the recommended way to run PHPCI builds. You can run several workers all watching one queue, allowing jobs to be run simultaneously without the overhead of polling your MySQL database.
If you can't run Beanstalkd on your server, or would prefer to run builds on a regular schedule, you should consider using the [build daemon](https://github.com/Block8/PHPCI/wiki/Run-Builds-Using-a-Daemon) or [running builds via Cron](https://github.com/Block8/PHPCI/wiki/Run-Builds-Using-Cron).
If you can't run Beanstalkd on your server, or would prefer to run builds on a regular schedule, you should consider using the [build daemon](workers/daemon.md) or [running builds via Cron](workers/cron.md).
## Pre-Requisites
Pre-Requisites
==============
* You need to install [Beanstalkd](http://kr.github.io/beanstalkd/) - On Ubuntu, this is as simple as running `apt-get install beanstalkd`.
* [Supervisord](http://supervisord.org/) needs to be installed and running on your server.
## Setting up the PHPCI Worker
Setting up the PHPCI Worker
===========================
### On a new installation:
### On a new installation
Setting up the worker on a new installation of PHPCI is as simple as entering the appropriate values for your Beanstalkd server hostname and queue name when running the PHPCI installer. By default, the installer assumes that you'll be using beanstalkd on `localhost` and will use the queue name `phpci`.
![PHPCI Worker Installer](https://www.phptesting.org/media/render/f48f63699a04444630352643af18b643)
### On an existing installation:
### 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 `/PHPCI/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:
![PHPCI Worker Config](https://www.phptesting.org/media/render/9a88e9298670f2913f5798e68b94c9ed)
## Running the PHPCI Worker:
Running the PHPCI Worker
========================
Once you've set up PHPCI 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.