GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Push — master ( 6a3289...514d99 )
by Anton
02:27
created

recipe/symfony.php (1 issue)

Labels
Severity
1
<?php
2
/* (c) Anton Medvedev <[email protected]>
3
 *
4
 * For the full copyright and license information, please view the LICENSE
5
 * file that was distributed with this source code.
6
 */
7
8
namespace Deployer;
9
10
require_once __DIR__ . '/common.php';
11
12
13
/**
14
 * Symfony Configuration
15
 */
16
17
// Symfony build set
18
set('symfony_env', 'prod');
19
20
// Symfony shared dirs
21
set('shared_dirs', ['app/logs']);
22
23
// Symfony shared files
24
set('shared_files', ['app/config/parameters.yml']);
25
26
// Symfony writable dirs
27
set('writable_dirs', ['app/cache', 'app/logs']);
28
29
// Clear paths
30
set('clear_paths', ['web/app_*.php', 'web/config.php']);
31
32
// Assets
33
set('assets', ['web/css', 'web/images', 'web/js']);
34
35
// Requires non symfony-core package `kriswallsmith/assetic` to be installed
36
set('dump_assets', false);
37
38
// Environment vars
39
set('env', function () {
40
    return [
41
        'SYMFONY_ENV' => get('symfony_env')
42
    ];
43
});
44
45
set('composer_options', function () {
46
    $debug = get('symfony_env') === 'dev';
47
    return sprintf('{{composer_action}} --verbose --prefer-dist --no-progress --no-interaction %s --optimize-autoloader --no-suggest', (!$debug ? '--no-dev' : ''));
48
});
49
50
51
// Adding support for the Symfony3 directory structure
52
set('bin_dir', 'app');
53
set('var_dir', 'app');
54
55
// Symfony console bin
56
set('bin/console', function () {
57
    return sprintf('{{release_path}}/%s/console', trim(get('bin_dir'), '/'));
58
});
59
60
// Symfony console opts
61
set('console_options', function () {
62
    $options = '--no-interaction --env={{symfony_env}}';
63
    return get('symfony_env') !== 'prod' ? $options : sprintf('%s --no-debug', $options);
64
});
65
66
// Migrations configuration file
67
set('migrations_config', '');
68
69
70
/**
71
 * Create cache dir
72
 */
73
task('deploy:create_cache_dir', function () {
74
    // Set cache dir
75
    set('cache_dir', '{{release_path}}/' . trim(get('var_dir'), '/') . '/cache');
76
77
    // Remove cache dir if it exist
78
    run('if [ -d "{{cache_dir}}" ]; then rm -rf {{cache_dir}}; fi');
79
80
    // Create cache dir
81
    run('mkdir -p {{cache_dir}}');
82
83
    // Set rights
84
    run("chmod -R g+w {{cache_dir}}");
85
})->desc('Create cache dir');
86
87
88
/**
89
 * Normalize asset timestamps
90
 */
91
task('deploy:assets', function () {
92
    $assets = implode(' ', array_map(function ($asset) {
93
        return "{{release_path}}/$asset";
94
    }, get('assets')));
0 ignored issues
show
It seems like get('assets') can also be of type string; however, parameter $arr1 of array_map() does only seem to accept array, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

94
    }, /** @scrutinizer ignore-type */ get('assets')));
Loading history...
95
96
    run(sprintf('find %s -exec touch -t %s {} \';\' &> /dev/null || true', $assets, date('YmdHi.s')));
97
})->desc('Normalize asset timestamps');
98
99
100
/**
101
 * Install assets from public dir of bundles
102
 */
103
task('deploy:assets:install', function () {
104
    run('{{bin/php}} {{bin/console}} assets:install {{console_options}} {{release_path}}/web');
105
})->desc('Install bundle assets');
106
107
108
/**
109
 * Dump all assets to the filesystem
110
 */
111
task('deploy:assetic:dump', function () {
112
    if (get('dump_assets')) {
113
        run('{{bin/php}} {{bin/console}} assetic:dump {{console_options}}');
114
    }
115
})->desc('Dump assets');
116
117
/**
118
 * Clear Cache
119
 */
120
task('deploy:cache:clear', function () {
121
    run('{{bin/php}} {{bin/console}} cache:clear {{console_options}} --no-warmup');
122
})->desc('Clear cache');
123
124
/**
125
 * Warm up cache
126
 */
127
task('deploy:cache:warmup', function () {
128
    run('{{bin/php}} {{bin/console}} cache:warmup {{console_options}}');
129
})->desc('Warm up cache');
130
131
132
/**
133
 * Migrate database
134
 */
135
task('database:migrate', function () {
136
    $options = '{{console_options}} --allow-no-migration';
137
    if (get('migrations_config') !== '') {
138
        $options = sprintf('%s --configuration={{release_path}}/{{migrations_config}}', $options);
139
    }
140
141
    run(sprintf('{{bin/php}} {{bin/console}} doctrine:migrations:migrate %s', $options));
142
})->desc('Migrate database');
143
144
145
/**
146
 * Main task
147
 */
148
task('deploy', [
149
    'deploy:info',
150
    'deploy:setup',
151
    'deploy:lock',
152
    'deploy:release',
153
    'deploy:update_code',
154
    'deploy:clear_paths',
155
    'deploy:create_cache_dir',
156
    'deploy:shared',
157
    'deploy:assets',
158
    'deploy:vendors',
159
    'deploy:assets:install',
160
    'deploy:assetic:dump',
161
    'deploy:cache:clear',
162
    'deploy:cache:warmup',
163
    'deploy:writable',
164
    'deploy:symlink',
165
    'deploy:unlock',
166
    'deploy:cleanup',
167
])->desc('Deploy your project');
168
169
// Display success message on completion
170
after('deploy', 'success');
171