-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathexample.php
More file actions
39 lines (36 loc) · 1.29 KB
/
example.php
File metadata and controls
39 lines (36 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
require_once 'lib/base/BaseDeploy.class.php';
require_once 'lib/Deploy.class.php';
require_once 'lib/exceptions/DeployException.class.php';
$deploy = new Deploy(array(
'project_name' => 'project',
'basedir' => dirname(__FILE__), // the root dir of the project
'remote_host' => 'www.example.com', // can also be: array('serv1.example.com', 'serv2.example.com')
'remote_port' => 22, // this is the default port and may be omitted
'remote_dir' => '/home/user/project', // this is the same for all remote hosts if you define multiple
'remote_user' => 'user', // setup public key access to make it easy for yourself, many connections are made
'rsync_excludes' => 'config/rsync_exclude.txt',
'data_dirs' => array( // these dirs are stored separate from the other code and replaced by symlinks
'web/uploads',
'logs'
),
'target_specific_files' => array( // list of files that will be renamed on the remote host
'web/.htaccess',
'config/database.php'
),
'target' => 'prod',
'datadir_patcher' => 'lib/deployer/datadir-patcher.php',
));
switch($_SERVER['argv'][1]) {
case 'deploy':
$deploy->deploy();
break;
case 'rollback':
$deploy->rollback();
break;
case 'cleanup':
$deploy->cleanup();
break;
default:
echo 'Usage: php deploy.php [deploy|rollback|cleanup]'. PHP_EOL;
}