-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.php
74 lines (57 loc) · 1.72 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
69
70
71
72
73
<?php
namespace Deployer;
require 'recipe/laravel.php';
require 'contrib/rsync.php';
// Config
set('repository', 'https://github.com/Tirya/smartcalendar.git');
set('bin/composer', '/usr/bin/composer');
add('shared_files', []);
add('shared_dirs', []);
add('writable_dirs', []);
// Hosts
host('smartcalendar.axelschn.ch')
->setHostname('cr7pm.ftp.infomaniak.com')
->set('remote_user', 'cr7pm_deployer')
->set('deploy_path', '/home/clients/55e0a135b89a29f2d29615838ee954a1/sites/smartcalendar.axelschn.ch');
add('rsync', [
'exclude' => [
'.git',
'/.env',
// '/storage/',
'/vendor/',
'/node_modules/',
'.github',
'deploy.php',
],
]);
set('ssh_multiplexing', true); // Speed up deployment
set('rsync_src', function () {
return __DIR__; // If your project isn't in the root, you'll need to change this.
});
after('deploy:failed', 'deploy:unlock'); // Unlock after failed deploy
desc('Deploy the application');
// Tasks
task('deploy', [
'deploy:setup',
'deploy:release',
'deploy:info',
'deploy:lock',
'rsync', // Deploy code & built assets
'deploy:secrets', // Deploy secrets
'deploy:vendors',
'artisan:storage:link', // |
'artisan:view:cache', // |
'artisan:config:cache', // | Laravel specific steps
'artisan:optimize', // |
'artisan:migrate', // |
'deploy:symlink',
'deploy:unlock',
'deploy:cleanup',
]);
// Set up a deployer task to copy secrets to the server.
// Grabs the dotenv file from the github secret
task('deploy:secrets', function () {
file_put_contents(__DIR__ . '/.env', getenv('DOT_ENV'));
upload('.env', get('release_path'));
});
after('deploy:failed', 'deploy:unlock');