-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.php
executable file
·68 lines (54 loc) · 1.82 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php
namespace Deployer;
require 'recipe/laravel.php';
server('production', 'codeanarchy.org')
->user('rhymebin-deployer')
->identityFile('~/.ssh/id_rsa.pub', '~/.ssh/id_rsa', '')
->set('deploy_path', '/home/rhymebin-deployer/www')
->stage('production');
set('ssh_type', 'native');
set('ssh_multiplexing', true);
set('repository', 'https://github.com/mogria/rhymebin.git');
// use www-data user of apache
set('http_user', 'www-data');
// copy over the vendor directory to new releases to avoid downloading
// the same dependencies over again
set('copy_dirs', ['vendor']);
before('deploy:vendors', 'deploy:copy_dirs');
set('keep_releases', 10); // keep the last 10 releases
set('bin/npm', function() {
return run('which npm')->toString();
});
set('bin/bower', function() {
return run('which bower')->toString();
});
set('bin/gulp', function() {
return run('which gulp')->toString();
});
task('npm:install', function() {
cd('{{release_path}}');
$output = run('{{bin/npm}} install --production');
writeln('<info>' . $output . '</info>');
})->desc('Install npm dependencies');
task('bower:install', function() {
cd('{{release_path}}');
$output = run('{{bin/bower}} install --production');
writeln('<info>' . $output . '</info>');
})->desc('Install bower dependencies');
task('gulp:all', function() {
cd('{{release_path}}');
$output = run('{{bin/gulp}} --production');
writeln('<info>' . $output . '</info>');
})->desc('Run all gulp tasks');
task('compile:assets', ['npm:install', 'bower:install', 'gulp:all']);
task('deploy', [
'deploy:prepare',
'deploy:release',
'deploy:update_code',
'deploy:shared',
'deploy:vendors',
'compile:assets',
'deploy:writable',
'deploy:symlink',
'cleanup'
])->desc('Deploy your project');