Skip to content
Snippets Groups Projects
Select Git revision
  • 0fe53b5e0521e0ec530131e1d11270eef77c1a6f
  • main default protected
  • renovate/lock-file-maintenance
  • demo protected
  • person-select-custom
  • dbp-translation-component
  • icon-set-mapping
  • port-i18next-parser
  • remove-sentry
  • favorites-and-recent-files
  • revert-6c632dc6
  • lit2
  • advertisement
  • wc-part
  • automagic
  • publish
  • wip-cleanup
  • demo-file-handling
18 results

deploy.php

Blame
  • deploy.php 1.26 KiB
    <?php
    namespace Deployer;
    
    require 'recipe/common.php';
    require 'recipe/rsync.php';
    
    // Global config
    set('allow_anonymous_stats', false);
    
    set('rsync',[
        'exclude'      => [
            '.git',
            'deploy.php',
        ],
        'exclude-file' => false,
        'include'      => [],
        'include-file' => false,
        'filter'       => [],
        'filter-file'  => false,
        'filter-perdir'=> false,
        'flags'        => 'rz',
        'options'      => ['delete'],
        'timeout'      => 60,
    ]);
    
    set('rsync_src', __DIR__ . '/../toolkit-showcase/dist');
    set('rsync_dest','{{release_path}}');
    
    // Hosts
    host('demo')
        ->stage('demo')
        ->hostname('mw@vpu01-demo.tugraz.at')
        ->set('deploy_path', '/home/mw/demo/deploy/apps/demo');
    
    host('development')
        ->stage('development')
        ->hostname('mw@mw01-dev.tugraz.at')
        ->set('deploy_path', '/home/mw/dev/deploy/apps/demo');
    
    task('build', function () {
        $stage = get('stage');
        runLocally("yarn install");
        runLocally("APP_ENV=$stage yarn run build");
    });
    
    // Deploy task
    task('deploy', [
        'deploy:info',
        'build',
        'deploy:prepare',
        'deploy:lock',
        'deploy:release',
        'rsync',
        'deploy:shared',
        'deploy:symlink',
        'deploy:unlock',
        'cleanup',
        'success',
    ]);
    after('deploy:failed', 'deploy:unlock');