Updated Installing PHPCI (markdown)

dancryer 2014-12-12 04:28:16 -08:00
parent 62b8b48f35
commit c18cbab1fd

@ -1,4 +1,4 @@
##Pre-requisites:
## Pre-requisites:
* PHP 5.3.8+
* A web server. We prefer nginx.
* Composer (https://getcomposer.org/download/)
@ -7,11 +7,11 @@
* PHPCI needs to be able to run `exec()` and `shell_exec()`, so make sure these functions are not disabled
* PHP must have OpenSSL support available and enabled.
##Mac Installation Guides
## Mac Installation Guides
- Vanilla Mac Mavericks Server [Installation Guide](https://github.com/Block8/PHPCI/wiki/Vanilla-Mac-Mavericks-Server-Installation-Guide)
- Vanilla Mac Yosemite Server [Installation Guide](https://github.com/Block8/PHPCI/wiki/Vanilla-Installation-on-OS-X-10.10-Yosemite-with-OS-X-Server-4)
##Standard installation process:
## Standard installation process:
* Go to your `www` directory, usually `/var/www`.
* Download composer `curl -sS https://getcomposer.org/installer | php`
* Get the project: `./composer.phar create-project block8/phpci phpci --keep-vcs --no-dev`
@ -20,7 +20,7 @@
* Add a virtual host to your web server, pointing to the directory "public" where you cloned PHPCI into.
* You'll need to set up rewrite rules to point all non-existent requests to PHPCI.
###Apache Example (require mod_rewrite installed):
### Apache Example (require mod_rewrite installed):
`.htaccess` file inside the `public` directory of your PHPCI installation.
```sh
@ -33,7 +33,7 @@
</IfModule>
```
###Nginx Example:
### Nginx Example:
```
location / {
@ -41,11 +41,11 @@ location / {
}
```
###Lighttpd Example (lighttpd >= `1.4.24`):
### Lighttpd Example (lighttpd >= `1.4.24`):
This example uses the `$HTTP["host"]` conditional block because `$HTTP["url"]` blocks aren't supported with url rewriting in lighttpd <= `1.4.33` (source: [lighttpd docs for mod_rewrite](http://redmine.lighttpd.net/projects/1/wiki/Docs_ModRewrite)). In lighttpd >= `1.4.34` however, [this has been fixed](http://redmine.lighttpd.net/issues/2526).
###lighttpd <= `1.4.33`
### lighttpd <= `1.4.33`
```
$HTTP["host"] =~ "^phpci\.example\.com$" {
# Rewrite all requests to non-physical files
@ -56,7 +56,7 @@ $HTTP["host"] =~ "^phpci\.example\.com$" {
}
```
###lighttpd >= `1.4.34`
### lighttpd >= `1.4.34`
```
$HTTP["url"] =~ "^\/PHPCI/$" {
# Rewrite all requests to non-physical files
@ -69,7 +69,7 @@ $HTTP["url"] =~ "^\/PHPCI/$" {
If you ~~would like~~ are forced to use lighttpd <= `1.4.24`, [you can use mod_magnet and Lua instead] (http://redmine.lighttpd.net/projects/1/wiki/AbsoLUAtion).
###Built-in PHP Server Example:
### Built-in PHP Server Example:
You can use the built-in PHP server `php -S localhost:8080` by adding `public/routing.php`.
@ -83,11 +83,11 @@ if (file_exists(__DIR__ . '/' . $_SERVER['REQUEST_URI'])) {
}
```
##Finally
## Finally
There are a couple ways of running PHPCI builds. If you want to run multiple builds at the same time, but don't mind waiting *up to* 1 minute for a cron job to execute, you should use the cron method.
###Cron method
### Cron method
You'll want to set up PHPCI to run as a regular cronjob, so run `crontab -e` and enter the following:
@ -95,7 +95,7 @@ You'll want to set up PHPCI to run as a regular cronjob, so run `crontab -e` and
Obviously, make sure you change the `/path/to/phpci` to the directory in which you installed PHPCI, and update the PHP path if necessary.
###Daemon method
### Daemon method
If you only want to run one build at a time or want your builds to run immediately after they're created, you should use the daemonise method. Run the following command, from the root of your PHPCI installation:
@ -106,7 +106,7 @@ nohup php daemonise phpci:daemonise > daemon.log &
Output will be streamed into the `daemon.log` file. You may encounter errors with composer (specifically related to the `$COMPOSER_HOME` environment variable) when running the above as root, so it may be necessary to run it as a normal user.
##Add Composer
## Add Composer
```bash
cd /path/to/phpci
@ -114,7 +114,7 @@ wget https://getcomposer.org/composer.phar
chmod +x composer.phar
```
##Permissions
## Permissions
The user under which your executed `crontab -e` above, should have write permissions to `PHPCI/build` directory.
So