-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.php
More file actions
73 lines (65 loc) · 1.84 KB
/
deploy.php
File metadata and controls
73 lines (65 loc) · 1.84 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
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
69
70
71
72
73
<?php
namespace Deployer;
if (file_exists('.env')) {
$dotenv = \Dotenv\Dotenv::createImmutable(__DIR__);
$dotenv->load();
}
require 'recipe/common.php';
set('application', $_ENV['APP_NAME']);
set('timezone', 'Europe/Amsterdam');
set('repository', 'git@github.com:verdant-studio/blue-circle.git');
set('keep_releases', 3);
set('git_tty', true);
set('allow_anonymous_stats', false);
set('default_stage', 'production');
set('shared_files', [
'.env',
'public/sitemap.xml'
]);
set('shared_dirs', [
'storage/app/analytics',
'storage/app/public',
'storage/framework/cache',
'storage/framework/sessions',
'storage/framework/logs',
'storage/framework/views',
]);
// Hosts
host($_ENV['DEPLOYER_PROD_HOST'])
->stage('production')
->user($_ENV['DEPLOYER_PROD_USER'])
->port($_ENV['DEPLOYER_PROD_PORT'])
->set('deploy_path', '')
->set('branch', 'master')
->set('http_user', $_ENV['DEPLOYER_PROD_USER'])
->set('domain', '')
->set('composer_options', 'install --verbose --prefer-dist --no-progress --no-interaction --optimize-autoloader --ignore-platform-reqs')
->set('writable_mode', 'chmod')
->set('writable_use_sudo', true)
->set('ssh_multiplexing', true);
// Tasks
desc('Deploy your project');
task('deploy', [
'deploy:info',
'deploy:prepare',
'deploy:lock',
'deploy:release',
'deploy:update_code',
'deploy:shared',
'deploy:vendors',
'deploy:assets',
'deploy:clear_paths',
'deploy:symlink',
'deploy:unlock',
'cleanup',
'success',
]);
// [Optional] If deploy fails automatically unlock.
after('deploy:failed', 'deploy:unlock');
/**
* Compile assets on production
*/
task('deploy:assets', function () {
runLocally('npm install && npm run prod');
upload('./public', '{{release_path}}/.');
})->desc('Generating assets and uploading them to server');