visavi/rotor

View on GitHub
deploy.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

namespace Deployer;

require 'recipe/laravel.php';

set('default_stage', 'production');
set('keep_releases', 5); // Max releases

// Project repository
set('repository', 'git@github.com:visavi/rotor.git');

add('shared_files', []);
add('shared_dirs', [
    'public/uploads',
    'public/assets/modules',
]);
add('writable_dirs', [
    'public/uploads/*',
    'public/assets/modules',
]);

set('bin/npm', function () {
    return which('npm');
});

// Hosts
host('production')
    ->setHostname('hostname')
    ->set('remote_user', 'www-data')
    ->set('deploy_path', '/var/www/rotor');

// Tasks
task('build', function () {
    cd('{{release_path}}');
    run('{{bin/npm}} ci');
    run('{{bin/npm}} run prod');
});

after('deploy:update_code', 'build');
after('deploy:failed', 'deploy:unlock');