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.

Code

< 40 %
40-60 %
> 60 %
1
<?php
2
namespace Deployer;
3
4
set('repository', '[email protected]:shopware/production.git');
5
6
set('release_name', static function () {
7
    return date('YmdHis');
8
});
9
10
set('shared_files', [
11
    '.env',
12
]);
13
set('shared_dirs', [
14
    'custom/plugins',
15
    'config/jwt',
16
    'files',
17
    'var/log',
18
    'public/media',
19
    'public/thumbnail',
20
    'public/sitemap',
21
]);
22
set('writable_dirs', [
23
    'custom/plugins',
24
    'config/jwt',
25
    'files',
26
    'var',
27
    'public/media',
28
    'public/thumbnail',
29
    'public/sitemap',
30
]);
31
set('static_folders', []);
32
33
task('sw:update_code', static function () {
34
    run('git clone {{repository}} {{release_path}}');
35
});
36
task('sw:system:install', static function () {
37
    run('cd {{release_path}} && bin/console system:install');
38
});
39
task('sw:build', static function () {
40
    run('cd {{release_path}}/bin && bash build.sh');
41
});
42
task('sw:system:setup', static function () {
43
    run('cd {{release_path}} && bin/console system:setup');
44
});
45
task('sw:theme:compile', static function () {
46
    run('cd {{release_path}} && bin/console theme:compile');
47
});
48
task('sw:cache:clear', static function () {
49
    run('cd {{release_path}} && bin/console cache:clear');
50
});
51
task('sw:cache:warmup', static function () {
52
    run('cd {{release_path}} && bin/console cache:warmup');
53
    run('cd {{release_path}} && bin/console http:cache:warm:up');
54
});
55
task('sw:database:migrate', static function () {
56
    run('cd {{release_path}} && bin/console database:migrate --all');
57
});
58
task('sw:plugin:refresh', function (){
59
    run('cd {{release_path}} && bin/console plugin:refresh');
60
});
61
task('sw:plugin:activate:all', static function () {
62
    task('sw:plugin:refresh');
63
    $plugins = explode("\n", run('cd {{release_path}} && bin/console plugin:list'));
64
65
    // take line over headlines and count "-" to get the size of the cells
66
    $lengths = array_filter(array_map('strlen', explode(' ', $plugins[4])));
67
68
    // ignore first seven lines (headline, title, table, ...)
69
    $plugins = array_slice($plugins, 7, -3);
70
    foreach ($plugins as $plugin) {
71
        $pluginParts = [];
72
        foreach ($lengths as $length) {
73
            $pluginParts[] = trim(substr($plugin, 0, $length));
74
            $plugin = substr($plugin, $length + 1);
75
        }
76
77
        [
78
            $plugin,
79
            $label,
80
            $version,
81
            $upgrade,
82
            $version,
83
            $author,
84
            $installed,
85
            $active,
86
            $upgradeable,
87
        ] = $pluginParts;
88
89
        if ($installed === 'No' || $active === 'No') {
90
            run("cd {{release_path}} && bin/console plugin:install --activate $plugin");
91
        }
92
    }
93
});
94
task('sw:plugin:migrate:all', static function(){
95
    $plugins = explode("\n", run('cd {{release_path}} && bin/console plugin:list'));
96
97
    // take line over headlines and count "-" to get the size of the cells
98
    $lengths = array_filter(array_map('strlen', explode(' ', $plugins[4])));
99
100
    // ignore first seven lines (headline, title, table, ...)
101
    $plugins = array_slice($plugins, 7, -3);
102
    foreach ($plugins as $plugin) {
103
        $pluginParts = [];
104
        foreach ($lengths as $length) {
105
            $pluginParts[] = trim(substr($plugin, 0, $length));
106
            $plugin = substr($plugin, $length + 1);
107
        }
108
109
        [
110
            $plugin,
111
            $label,
112
            $version,
113
            $upgrade,
114
            $version,
115
            $author,
116
            $installed,
117
            $active,
118
            $upgradeable,
119
        ] = $pluginParts;
120
121
        if ($installed === 'Yes' || $active === 'Yes') {
122
            run("cd {{release_path}} && bin/console database:migrate --all $plugin || true");
123
        }
124
    }
125
});
126
127
/**
128
 * Grouped SW deploy tasks
129
 */
130
task('sw:deploy', [
131
    'sw:build',
132
    'sw:plugin:activate:all',
133
    'sw:database:migrate',
134
    'sw:plugin:migrate:all',
135
    'sw:theme:compile',
136
    'sw:cache:clear',
137
]);
138
139
/**
140
 * Main task
141
 */
142
task('deploy', [
143
    'deploy:prepare',
144
    'deploy:lock',
145
    'deploy:release',
146
    'deploy:update_code',
147
    'deploy:shared',
148
    'sw:deploy',
149
    'deploy:writable',
150
    'deploy:clear_paths',
151
    'deploy:symlink',
152
    'deploy:unlock',
153
    'sw:cache:warmup',
154
    'cleanup',
155
    'success',
156
])->desc('Deploy your project');
157
158
after('deploy', 'success');
159
after('deploy:failed', 'deploy:unlock');
160