File: /home/imensosw/public_html/imenso.co/demo/individuals/deploy.php
<?php
namespace Deployer;
require 'recipe/laravel.php';
// Configuration
set('repository', 'git@github.com:overcomethebarrier/octb-individuals.git');
add('shared_files', [
'logs',
'var'
]);
add('shared_dirs', []);
add('writable_dirs', []);
// Servers
server('staging', getenv('staging_ip'))
->user(getenv('user'))
->password(getenv('password'))
->set('deploy_path', getenv('deploy_path'));
// Tasks
task('deploy:staging', function() {
$deployPath = get('deploy_path');
cd($deployPath);
writeln($deployPath);
run('pwd');
$status = run("git init");
writeln($status);
$result = run("git pull --rebase ".getenv('git_path'));
writeln($result);
//run("chown -R www-data:www-data app/storage");
//set('writable_dirs', ['app/storage']);
})->desc('Deploy application to staging.');
task('deploy:started', function() {
writeln('<info>Deploying...</info>');
});
task('deploy:done', function() {
writeln('<info>Deployment is done.</info>');
});
before('deploy:staging', 'deploy:started');
after('deploy:staging', 'deploy:done');