-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathLaravelPostDeployHook.php
More file actions
28 lines (20 loc) · 965 Bytes
/
LaravelPostDeployHook.php
File metadata and controls
28 lines (20 loc) · 965 Bytes
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
<?php
class LaravelPostDeployHook implements Hooks_DeployerInterface {
public function preDeployer(Deployer &$deployer) {
// TODO: Implement preDeployer() method.
}
public function postDeployer(Deployer &$deployer) {
NedStars_Log::message('Running Post Deploy commands:');
$path = (string) $deployer->getConfig()->paths->web_live_path;
$output = array();
$return = 0;
$command = 'cd "'.$path.'" ; php composer.phar dump-autoload -o';
exec($command, $output, $return);
NedStars_Log::message('Output: '.implode(PHP_EOL, $output));
$output = array();
$return = 0;
$command = 'cd "'.$path.'" ; chmod -R 0777 app/storage';
exec($command, $output, $return);
NedStars_Log::message('Output: '.implode(PHP_EOL, $output));
}
}