-
Notifications
You must be signed in to change notification settings - Fork 9
/
deploy.php
39 lines (30 loc) · 1.15 KB
/
deploy.php
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
/**
* @author Oliver Tupman <[email protected]>
* Date: 08/06/2012
* Time: 16:34
*/
echo "[deploy] Starting xBoilerplate deployment\n\n";
function copy_directory($source, $destination) {
$result = exec('cp -R ' . $source . ' ' . $destination);
return $result;
}
$autogeneratedDirs = array('tmp', 'test', 'config');
if(!file_exists('vendor')) {
die("[deploy] FAILED: Command must be run at the same level as composer.json\n");
}
if(file_exists('httpdocs')) {
die("[deploy] FAILED: httpdocs directory already exists, remove if you wish to deploy a new xBoilerplate skeleton\n");
}
$baseDir = __DIR__ . DIRECTORY_SEPARATOR;
foreach($autogeneratedDirs as $directory) {
if(!file_exists($directory)) {
mkdir($directory);
}
}
copy_directory($baseDir . 'httpdocs', '.');
copy($baseDir . 'config' . DIRECTORY_SEPARATOR . 'config.php', 'config' . DIRECTORY_SEPARATOR . 'config.php');
copy($baseDir . "Vagrantfile", "Vagrantfile");
echo "[deploy] SUCCESS: your xBoilerplate skeleton was created\n";
echo " You can start it by using the command: vagrant up\n";
echo " And then accessing it via http://10.10.10.10\n";