-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.php
More file actions
66 lines (49 loc) · 1.66 KB
/
deploy.php
File metadata and controls
66 lines (49 loc) · 1.66 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
<?php
namespace Deployer;
require 'recipe/composer.php';
// Project name
set('application', 'fresh');
// Project repository
set('repository', 'git@github.com:PSUGraphicDesign/fresh.git');
// [Optional] Allocate tty for git clone. Default value is false.
// set('git_tty', true);
// Use Git cache to speed up cloning new code:
set('git_cache', true);
// Allow multiplexing
set('ssh_multiplexing', true);
// Shared files/dirs between deploys
add('shared_files', [
'app/site/config/config.{{hostname}}.php'
]);
add('shared_dirs', [
'app/content',
'app/thumbs',
'app/site/cache',
'app/site/accounts',
'web/uploads',
]);
// Composer Settings
set('composer_options', '{{composer_action}} --no-dev --optimize-autoloader --no-progress --no-interaction --ignore-platform-reqs');
// Writable dirs by web server
add('writable_dirs', []);
// Hosts
inventory('hosts.yml');
// Tasks
// Build front-end assets
desc('Custom Pipeline: Build local assets');
task('build:render', function () {
runLocally('npm run build');
});
after('deploy:update_code', 'build:render');
// Sync assets to release
desc('Custom Pipeline: Sync built assets to remote server');
task('build:sync', function () {
upload('app/assets/css', '{{release_path}}/app/assets', ['options' => ['--recursive']]);
upload('app/assets/js', '{{release_path}}/app/assets', ['options' => ['--recursive']]);
});
after('deploy:update_code', 'build:sync');
// Re-trigger this, as it isn't part of the default `composer` recipe:
after('deploy:vendors', 'deploy:writable');
// [Optional] if deploy fails automatically unlock.
after('deploy:failed', 'deploy:unlock');
set('allow_anonymous_stats', false);