adt/after-deploy

v3.4 2017-08-31 09:00 UTC

README

  • Git
  • Composer
  • Bower
  • OP Cache (optional)
  • APCu (optional)
  • Redis (optional)

Installation & usage

  1. The best way to install is using Composer:
$ composer require adt/after-deploy
  1. Add this code in bootstrap.php before including autoload.php
 include __DIR__ . '/../vendor/adt/after-deploy/src/AfterDeploy.php';
 (new ADT\AfterDeploy\AfterDeploy())
 	->runBase([
 		'tempDir' => '/path/to/tempDir/', // required
 		'logDir' => '/path/to/logDir/', // required
 		'wwwDir' => '/path/to/wwwDir/', // optional, if not given, tempDir/../www is used, on
 		'key' => 'afterDeploy', // optional
 		'useMaintenance' => 1, // optional, default = 0
 		'sleep' => 1 // optional, time to wait before afterDeploy starts in seconds, if useMaintenance is 0 it's not used
 	]
);
  1. Enable the extension in your neon config:
extensions:
	afterDeploy: ADT\AfterDeploy\DI\AfterDeployExtension
  1. Update deployment configuration file deployment.ini like:
after[] = http://example.com/?afterDeploy
  1. Run dg/ftp-deployment script
$ php private/vendor/dg/ftp-deployment/Deployment/deployment.php deployment.ini
  1. Optionally you can set the redis in neon config:
afterDeploy:
	redis:
		client: @redis.client # \Kdyby\Redis\RedisClient
		dbs:
			- 1 # clear db 1
  1. If you use BackgroundQueue >= v2.1.1, you can optionally set it in neon config:
afterDeploy:
	backgroundQueue:
		service: @backgroundQueue.service # \ADT\BackgroundQueue\Service

This will send a noop to currently running consumers, so they check if they should terminate. Telling the consumer to terminate on next check (by -m 1 or by sending SIGINT signal) is not part of this component and is up to you.