-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.php
51 lines (41 loc) · 1.47 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
<?php
namespace Deployer;
require 'recipe/laravel.php';
require 'contrib/npm.php';
// Config
set('repository', 'git@github.com:umn-cla/smartycards-api.git');
set('ssh_type', 'native');
set('update_code_strategy', 'clone');
add('shared_files', []);
add('shared_dirs', []);
add('writable_dirs', []);
// Hosts
host('dev')
->set('hostname', 'cla-smartycards-dev.oit.umn.edu')
->set('remote_user', 'latis_deploy')
->set('labels', ['stage' => 'dev'])
->set('deploy_path', '/var/www/smartycards/');
host('stage')
->set('hostname', 'cla-smartycards-tst.oit.umn.edu')
->set('remote_user', 'latis_deploy')
->set('labels', ['stage' => 'dev'])
->set('deploy_path', '/var/www/smartycards/');
host('prod')
->set('hostname', 'cla-smartcards-prd.oit.umn.edu')
->set('remote_user', 'latis_deploy')
->set('labels', ['stage' => 'prod'])
->set('deploy_path', '/var/www/smartycards/');
// install private composer packages, like Laravel Nova
task('composer:private', function () {
cd('{{release_path}}');
run('source .env && {{bin/composer}} config "http-basic.nova.laravel.com" "$NOVA_USERNAME" "$NOVA_LICENSE_KEY"');
});
before('deploy:vendors', 'composer:private');
// NPM tasks - unncecessary right now
after('deploy:update_code', 'npm:install');
task('assets:generate', function () {
cd('{{release_path}}');
run('npm run build');
})->desc('Assets generation');
after('deploy:vendors', 'assets:generate');
after('deploy:failed', 'deploy:unlock');