Completed
Pull Request — 2.0 (#26)
by
unknown
01:57
created

RunCommand::getMeasuresFromBranch()   A

Complexity

Conditions 4
Paths 13

Size

Total Lines 23

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 23
rs 9.552
c 0
b 0
f 0
cc 4
nc 13
nop 8

How to fix   Many Parameters   

Many Parameters

Methods with many parameters are not only hard to understand, but their parameters also often become inconsistent when you need more, or different data.

There are several approaches to avoid long parameter lists:

1
<?php
2
namespace TheCodingMachine\WashingMachine\Commands;
3
4
use Gitlab\Client;
5
use Gitlab\Model\Project;
6
use Psr\Log\LoggerInterface;
7
use Symfony\Component\Console\Command\Command;
8
use Symfony\Component\Console\Input\InputInterface;
9
use Symfony\Component\Console\Input\InputOption;
10
use Symfony\Component\Console\Logger\ConsoleLogger;
11
use Symfony\Component\Console\Output\OutputInterface;
12
use TheCodingMachine\WashingMachine\Clover\CloverFile;
13
use TheCodingMachine\WashingMachine\Clover\Crap4JFile;
14
use TheCodingMachine\WashingMachine\Clover\CrapMethodMerger;
15
use TheCodingMachine\WashingMachine\Clover\DiffService;
16
use TheCodingMachine\WashingMachine\Clover\EmptyCloverFile;
17
use TheCodingMachine\WashingMachine\Git\GitRepository;
18
use TheCodingMachine\WashingMachine\Gitlab\BuildNotFoundException;
19
use TheCodingMachine\WashingMachine\Gitlab\BuildService;
20
use TheCodingMachine\WashingMachine\Gitlab\MergeRequestNotFoundException;
21
use TheCodingMachine\WashingMachine\Gitlab\Message;
22
use TheCodingMachine\WashingMachine\Gitlab\SendCommentService;
23
24
class RunCommand extends Command
25
{
26
    /**
27
     * @var LoggerInterface
28
     */
29
    private $logger;
30
31
    protected function configure()
32
    {
33
        $this
34
            ->setName('run')
35
            ->setDescription('Analyses the coverage report files and upload the result to Gitlab')
36
            //->setHelp("This command allows you to create users...")
37
            ->addOption('clover',
38
                'c',
39
                InputOption::VALUE_REQUIRED,
40
                'The path to the clover.xml file generated by PHPUnit.',
41
                'clover.xml')
42
            ->addOption('crap4j',
43
                'j',
44
                InputOption::VALUE_REQUIRED,
45
                'The path to the crap4j.xml file generated by PHPUnit.',
46
                'crap4j.xml')
47
            ->addOption('gitlab-url',
48
                'u',
49
                InputOption::VALUE_REQUIRED,
50
                'The Gitlab URL. If not specified, it is deduced from the CI_REPOSITORY_URL environment variable.',
51
                null)
52
            ->addOption('gitlab-api-token',
53
                't',
54
                InputOption::VALUE_REQUIRED,
55
                'The Gitlab API token. If not specified, it is fetched from the GITLAB_API_TOKEN environment variable.',
56
                null)
57
            /*->addOption('gitlab-project-id',
0 ignored issues
show
Unused Code Comprehensibility introduced by
64% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
58
                'p',
59
                InputOption::VALUE_REQUIRED,
60
                'The Gitlab project ID. If not specified, it is fetched from the CI_PROJECT_ID environment variable.',
61
                null)*/
62
            ->addOption('gitlab-project-name',
63
                'p',
64
                InputOption::VALUE_REQUIRED,
65
                'The Gitlab project name (in the form "group/name"). If not specified, it is deduced from the CI_PROJECT_DIR environment variable.',
66
                null)
67
            ->addOption('commit-sha',
68
                'r',
69
                InputOption::VALUE_REQUIRED,
70
                'The commit SHA. If not specified, it is deduced from the CI_COMMIT_SHA environment variable.',
71
                null)
72
            ->addOption('gitlab-job-id',
73
                'b',
74
                InputOption::VALUE_REQUIRED,
75
                'The Gitlab CI build/job id. If not specified, it is deduced from the CI_JOB_ID environment variable.',
76
                null)
77
            ->addOption('gitlab-build-name',
78
                'a',
79
                InputOption::VALUE_REQUIRED,
80
                'The Gitlab CI build name (the name of this build in the job). If not specified, it is deduced from the CI_BUILD_NAME environment variable.',
81
                null)
82
            ->addOption('gitlab-pipeline-id',
83
                'e',
84
                InputOption::VALUE_REQUIRED,
85
                'The Gitlab CI pipeline ID. If not specified, it is deduced from the CI_PIPELINE_ID environment variable.',
86
                null)
87
            ->addOption('job-stage',
88
                's',
89
                InputOption::VALUE_REQUIRED,
90
                'The Gitlab CI job stage. If not specified, it is deduced from the CI_JOB_STAGE environment variable.',
91
                null)
92
            ->addOption('file',
93
                'f',
94
                InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED,
95
                'Text file to be sent in the merge request comments (can be used multiple times).',
96
                [])
97
            ->addOption('open-issue',
98
                'i',
99
                InputOption::VALUE_NONE,
100
                'Opens an issue (if the build is not part of a merge request)')
101
            ->addOption('add-comments-in-commits',
102
                null,
103
                InputOption::VALUE_NONE,
104
                'Add comments directly in the commit')
105
        ;
106
    }
107
108
    protected function execute(InputInterface $input, OutputInterface $output)
109
    {
110
        $this->logger = new ConsoleLogger($output);
111
        $config = new Config($input);
112
113
        $cloverFilePath = $config->getCloverFilePath();
114
115
        $cloverFile = null;
116
        if (file_exists($cloverFilePath)) {
117
            $cloverFile = CloverFile::fromFile($cloverFilePath, getcwd());
118
            //$output->writeln(sprintf('Code coverage: %.2f%%', $cloverFile->getCoveragePercentage() * 100));
0 ignored issues
show
Unused Code Comprehensibility introduced by
67% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
119
        }
120
121
        $crap4JFilePath = $config->getCrap4JFilePath();
122
123
        $crap4jFile = null;
124
        if (file_exists($crap4JFilePath)) {
125
            $crap4jFile = Crap4JFile::fromFile($crap4JFilePath);
126
        }
127
128
        $files = $config->getFiles();
129
130
        $methodsProvider = null;
131
        $codeCoverageProvider = null;
132
133
        if ($cloverFile !== null && $crap4jFile !== null) {
134
            $methodsProvider = new CrapMethodMerger($cloverFile, $crap4jFile);
135
            $codeCoverageProvider = $cloverFile;
136
        } elseif ($cloverFile !== null) {
137
            $methodsProvider = $cloverFile;
138
            $codeCoverageProvider = $cloverFile;
139
        } elseif ($crap4jFile !== null) {
140
            $methodsProvider = $crap4jFile;
141
        } elseif (empty($files)) {
142
            $output->writeln('<error>Could not find neither clover file, nor crap4j file for analysis nor files to send in comments. Nothing done. Searched paths: '.$cloverFilePath.' and '.$crap4JFilePath.'.</error>');
143
            $output->writeln('<comment>You might want to check that your unit tests where run successfully</comment>');
144
            $output->writeln('<comment>Alternatively, maybe you did not run Clover file generation? Use "phpunit --coverage-clover clover.xml"</comment>');
145
            return;
146
        }
147
148
        $gitlabApiToken = $config->getGitlabApiToken();
149
150
        $gitlabUrl = $config->getGitlabUrl();
151
        $gitlabApiUrl = $config->getGitlabApiUrl();
152
153
154
        /*$projectId = $input->getOption('gitlab-project-id');
0 ignored issues
show
Unused Code Comprehensibility introduced by
55% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
155
        if ($projectId === null) {
156
            $projectId = getenv('CI_PROJECT_ID');
157
            if ($projectId === false) {
158
                throw new \RuntimeException('Could not find the Gitlab project ID in the "CI_PROJECT_ID" environment variable (usually set by Gitlab CI). Either set this environment variable or pass the ID via the --gitlab-project-id command line option.');
159
            }
160
        }*/
161
162
        $projectName = $config->getGitlabProjectName();
163
164
        $commitSha = $config->getCommitSha();
165
166
        $currentBranchName = $config->getCurrentBranchName();
167
168
        $client = Client::create($gitlabApiUrl);
169
        $client->authenticate($gitlabApiToken);
170
171
        $diffService = new DiffService(5, 30, 20);
172
173
        $sendCommentService = new SendCommentService($client, $diffService);
174
175
        // From CI_COMMIT_SHA, we can get the commit ( -> project -> build -> commit )
176
        // From the merge_requests API, we can get the list of commits for a single merge request
177
        // Hence, we can find the merge_request matching a build!
178
179
        $buildService = new BuildService($client, $this->logger);
180
181
        $inMergeRequest = false;
182
183
        try {
184
            $mergeRequest = $buildService->findMergeRequestByCommitSha($projectName, $commitSha);
185
186
            $repo = new GitRepository(getcwd());
187
            $targetCommit = $repo->getLatestCommitForBranch('origin/'.$mergeRequest['target_branch']);
188
            $lastCommonCommit = $repo->getMergeBase($targetCommit, $commitSha);
189
190
            $output->writeln('Pipeline current commit: '.$commitSha, OutputInterface::VERBOSITY_DEBUG);
191
            $output->writeln('Target branch: '.$mergeRequest['target_branch'], OutputInterface::VERBOSITY_DEBUG);
192
            $output->writeln('Target commit: '.$targetCommit, OutputInterface::VERBOSITY_DEBUG);
193
            $output->writeln('Last common commit: '.$lastCommonCommit, OutputInterface::VERBOSITY_DEBUG);
194
195
            list($previousCodeCoverageProvider, $previousMethodsProvider) = $this->getMeasuresFromCommit($buildService, $mergeRequest['target_project_id'], $lastCommonCommit, $cloverFilePath, $crap4JFilePath, $config->getJobStage(), $config->getGitlabBuildName(), null);
196
            //list($previousCodeCoverageProvider, $previousMethodsProvider) = $this->getMeasuresFromBranch($buildService, $mergeRequest['target_project_id'], $mergeRequest['target_branch'], $cloverFilePath, $crap4JFilePath);
0 ignored issues
show
Unused Code Comprehensibility introduced by
75% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
197
198
            $message = new Message();
199
            if ($codeCoverageProvider !== null) {
200
                $message->addCoverageMessage($codeCoverageProvider, $previousCodeCoverageProvider);
201
            } else {
202
                $output->writeln('Could not find clover file for code coverage analysis.');
203
            }
204
            if ($methodsProvider !== null) {
205
                $message->addDifferencesHtml($methodsProvider, $previousMethodsProvider, $diffService, $commitSha, $gitlabUrl, $projectName);
206
            } else {
207
                $output->writeln('Could not find clover file nor crap4j file for CRAP score analysis.');
208
            }
209
210
            $this->addFilesToMessage($message, $files, $output, $config);
211
212
            $client->merge_requests->addNote($projectName, $mergeRequest['iid'], (string) $message);
213
214
            $inMergeRequest = true;
215
        } catch (MergeRequestNotFoundException $e) {
216
            // If there is no merge request attached to this build, let's skip the merge request comment. We can still make some comments on the commit itself!
217
            $output->writeln('It seems that this CI build is not part of a merge request.');
218
        }
219
220
        if ($config->isAddCommentsInCommits() || ($config->isOpenIssue() && !$inMergeRequest)) {
221
            try {
222
                $targetProjectId = $mergeRequest['target_project_id'] ?? $projectName;
223
                list($lastCommitCoverage, $lastCommitMethodsProvider) = $this->getMeasuresFromBranch($buildService, $targetProjectId, $currentBranchName, $cloverFilePath, $crap4JFilePath, $config->getJobStage(), $config->getGitlabBuildName(), $config->getGitlabPipelineId());
224
225
                if ($config->isAddCommentsInCommits()) {
226
                    $sendCommentService->sendDifferencesCommentsInCommit($methodsProvider, $lastCommitMethodsProvider, $projectName, $commitSha, $gitlabUrl);
0 ignored issues
show
Bug introduced by
It seems like $methodsProvider defined by null on line 130 can also be of type null; however, TheCodingMachine\Washing...encesCommentsInCommit() does only seem to accept object<TheCodingMachine\...MethodFetcherInterface>, maybe add an additional type check?

If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:

/**
 * @return array|string
 */
function returnsDifferentValues($x) {
    if ($x) {
        return 'foo';
    }

    return array();
}

$x = returnsDifferentValues($y);
if (is_array($x)) {
    // $x is an array.
}

If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.

Loading history...
227
                }
228
229
                if ($config->isOpenIssue() && !$inMergeRequest) {
230
                    $message = new Message();
231
232
                    if ($codeCoverageProvider !== null) {
233
                        $message->addCoverageMessage($codeCoverageProvider, $lastCommitCoverage);
234
                    } else {
235
                        $output->writeln('Could not find clover file for code coverage analysis.');
236
                    }
237
238
                    if ($methodsProvider !== null) {
239
                        $message->addDifferencesHtml($methodsProvider, $lastCommitMethodsProvider, $diffService, $commitSha, $gitlabUrl, $projectName);
240
                    } else {
241
                        $output->writeln('Could not find clover file nor crap4j file for CRAP score analysis.');
242
                    }
243
244
                    $this->addFilesToMessage($message, $files, $output, $config);
245
246
                    $project = new Project($projectName, $client);
247
248
                    $options = [
249
                        'description' => (string) $message
250
                    ];
251
252
                    $userId = $this->getCommiterId($project, $commitSha);
253
                    if ($userId !== null) {
254
                        $options['assignee_id'] = $userId;
255
                    }
256
257
                    $project->createIssue('Build failed', $options);
258
                }
259
            } catch (BuildNotFoundException $e) {
260
                $output->writeln('Unable to find a previous build for this branch. Skipping adding comments inside the commit. '.$e->getMessage());
261
            }
262
        }
263
    }
264
265
    /**
266
     * Returns the user id of the committer.
267
     *
268
     * @param Project $project
269
     * @param string $commitRef
270
     * @return int|null
271
     */
272
    private function getCommiterId(Project $project, $commitRef)
273
    {
274
275
        $commit = $project->commit($commitRef);
276
277
        return $commit->committer ? $commit->committer->id :  null;
278
    }
279
280
    /**
281
     * @param BuildService $buildService
282
     * @param string $projectName
283
     * @param string $targetBranch
284
     * @param string $cloverPath
285
     * @param string $crap4JPath
286
     * @return array First element: code coverage, second element: list of methods.
287
     * @throws BuildNotFoundException
288
     */
289
    public function getMeasuresFromBranch(BuildService $buildService, string $projectName, string $targetBranch, string $cloverPath, string $crap4JPath, string $jobStage, string $buildName, string $excludePipelineId) : array
290
    {
291
        try {
292
            $tmpFile = tempnam(sys_get_temp_dir(), 'art').'.zip';
293
294
            $buildService->dumpArtifactFromBranch($projectName, $targetBranch, $buildName, $jobStage, $tmpFile, $excludePipelineId);
295
            $zipFile = new \ZipArchive();
296
            if ($zipFile->open($tmpFile)!==true) {
297
                throw new \RuntimeException('Invalid ZIP archive '.$tmpFile);
298
            }
299
            return $this->getMeasuresFromZipFile($zipFile, $cloverPath, $crap4JPath);
300
        } catch (\RuntimeException $e) {
301
            if ($e->getCode() === 404) {
302
                // We could not find a previous clover file in the master branch.
303
                // Maybe this branch is the first to contain clover files?
304
                // Let's deal with this by generating a fake "empty" clover file.
305
                $this->logger->info('We could not find a previous clover file in the build attached to branch '.$targetBranch.'. Maybe this commit is the first on this branch?');
306
                return [EmptyCloverFile::create(), EmptyCloverFile::create()];
307
            } else {
308
                throw $e;
309
            }
310
        }
311
    }
312
313
    public function getMeasuresFromCommit(BuildService $buildService, string $projectName, string $commitId, string $cloverPath, string $crap4JPath, string $jobStage, string $buildName, ?string $excludePipelineId) : array
314
    {
315
        try {
316
            $tmpFile = tempnam(sys_get_temp_dir(), 'art').'.zip';
317
318
            $pipeline = $buildService->getLatestPipelineFromCommitId($projectName, $commitId, $excludePipelineId);
319
            $buildService->dumpArtifact($projectName, $pipeline['id'], $buildName, $jobStage, $tmpFile);
320
            $zipFile = new \ZipArchive();
321
            $result = $zipFile->open($tmpFile);
322
            if ($result !== true) {
323
                switch ($result) {
324
                    case 9:
0 ignored issues
show
Coding Style introduced by
case statements should be defined using a colon.

As per the PSR-2 coding standard, case statements should not be wrapped in curly braces. There is no need for braces, since each case is terminated by the next break.

There is also the option to use a semicolon instead of a colon, this is discouraged because many programmers do not even know it works and the colon is universal between programming languages.

switch ($expr) {
    case "A": { //wrong
        doSomething();
        break;
    }
    case "B"; //wrong
        doSomething();
        break;
    case "C": //right
        doSomething();
        break;
}

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
325
                        throw new \RuntimeException("An error occurred while unzipping artifact from commit $commitId. Error code $result: No such file");
326
                    case 11:
327
                        throw new \RuntimeException("An error occurred while unzipping artifact from commit $commitId. Error code $result: Can't open file");
328
                    case 19:
329
                        throw new \RuntimeException("An error occurred while unzipping artifact from commit $commitId. Error code $result: Not a zip archive");
330
                    default:
331
                        throw new \RuntimeException("An error occurred while unzipping artifact from commit $commitId. Error code $result: ".$zipFile->getStatusString());
332
                }
333
            }
334
            return $this->getMeasuresFromZipFile($zipFile, $cloverPath, $crap4JPath);
335
        } catch (\RuntimeException $e) {
336
            if ($e->getCode() === 404) {
337
                // We could not find a previous clover file in the given commit.
338
                // Maybe this branch is the first to contain clover files?
339
                // Let's deal with this by generating a fake "empty" clover file.
340
                $this->logger->warning('We could not find a previous clover file in the build attached to commit '.$commitId.'. Maybe this branch is the first to contain clover files?');
341
                $this->logger->debug($e->getMessage().' - '.$e->getTraceAsString(), [
342
                    'exception' => $e
343
                ]);
344
                return [EmptyCloverFile::create(), EmptyCloverFile::create()];
345
            } else {
346
                throw $e;
347
            }
348
        } catch (BuildNotFoundException $e) {
349
            // Maybe there is no .gitlab-ci.yml file on the target branch? In this case, there is no build.
350
            $this->logger->warning('We could not find a build for commit '.$commitId.'.');
351
            return [EmptyCloverFile::create(), EmptyCloverFile::create()];
352
        }
353
    }
354
355
    private function getMeasuresFromZipFile(\ZipArchive $zipFile, string $cloverPath, string $crap4JPath) : array
356
    {
357
        $cloverFileString = $zipFile->getFromName($cloverPath);
358
359
        $cloverFile = null;
360
        if ($cloverFileString !== false) {
361
            $cloverFile = CloverFile::fromString($cloverFileString, getcwd());
362
        }
363
364
        $crap4JString = $zipFile->getFromName($crap4JPath);
365
366
        $crap4JFile = null;
367
        if ($crap4JString !== false) {
368
            $crap4JFile = Crap4JFile::fromString($crap4JString);
369
        }
370
371
        $methodsProvider = null;
0 ignored issues
show
Unused Code introduced by
$methodsProvider is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
372
        $codeCoverageProvider = null;
373
374
        if ($cloverFile !== null && $crap4JFile !== null) {
375
            $methodsProvider = new CrapMethodMerger($cloverFile, $crap4JFile);
376
            $codeCoverageProvider = $cloverFile;
377
        } elseif ($cloverFile !== null) {
378
            $methodsProvider = $cloverFile;
379
            $codeCoverageProvider = $cloverFile;
380
        } elseif ($crap4JFile !== null) {
381
            $methodsProvider = $crap4JFile;
382
        } else {
383
            return [EmptyCloverFile::create(), EmptyCloverFile::create()];
384
        }
385
386
        return [$codeCoverageProvider, $methodsProvider];
387
    }
388
389
    private function addFilesToMessage(Message $message, array $files, OutputInterface $output, Config $config) {
390
        foreach ($files as $file) {
391
            if (!file_exists($file)) {
392
                $output->writeln('<error>Could not find file to send "'.$file.'". Skipping this file.</error>');
393
                continue;
394
            }
395
396
            $message->addFile(new \SplFileInfo($file), $config->getGitlabUrl(), $config->getGitlabProjectName(), $config->getGitlabJobId());
397
        }
398
    }
399
}
400
401
/*
402
=================ENV IN A PR CONTEXT =========================
403
404
CI_BUILD_TOKEN=xxxxxx
405
HOSTNAME=runner-9431b96d-project-428-concurrent-0
406
PHP_INI_DIR=/usr/local/etc/php
407
PHP_ASC_URL=https://secure.php.net/get/php-7.0.15.tar.xz.asc/from/this/mirror
408
CI_BUILD_BEFORE_SHA=7af13f8e3bd090c7c34750e4badfc66a5f0af110
409
CI_SERVER_VERSION=
410
CI_BUILD_ID=109
411
OLDPWD=/
412
PHP_CFLAGS=-fstack-protector-strong -fpic -fpie -O2
413
PHP_MD5=dca23412f3e3b3987e582091b751925d
414
CI_PROJECT_ID=428
415
PHPIZE_DEPS=autoconf 		file 		g++ 		gcc 		libc-dev 		make 		pkg-config 		re2c
416
PHP_URL=https://secure.php.net/get/php-7.0.15.tar.xz/from/this/mirror
417
CI_BUILD_REF_NAME=feature/js-ci
418
CI_BUILD_REF=7af13f8e3bd090c7c34750e4badfc66a5f0af110
419
PHP_LDFLAGS=-Wl,-O1 -Wl,--hash-style=both -pie
420
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
421
CI_BUILD_STAGE=test
422
CI_PROJECT_DIR=/builds/tcm-projects/uneo
423
PHP_CPPFLAGS=-fstack-protector-strong -fpic -fpie -O2
424
GPG_KEYS=1A4E8B7277C42E53DBA9C7B9BCAA30EA9C0D5763 6E4F6AB321FDC07F2C332E3AC2BF0BC433CFC8B3
425
PWD=/builds/tcm-projects/uneo
426
CI_DEBUG_TRACE=false
427
CI_SERVER_NAME=GitLab CI
428
XDEBUG_VERSION=2.5.0
429
GITLAB_CI=true
430
CI_SERVER_REVISION=
431
CI_BUILD_NAME=test:app
432
HOME=/root
433
SHLVL=1
434
PHP_SHA256=300364d57fc4a6176ff7d52d390ee870ab6e30df121026649f8e7e0b9657fe93
435
CI_SERVER=yes
436
CI=true
437
CI_BUILD_REPO=http://gitlab-ci-token:[email protected]/tcm-projects/uneo.git
438
PHP_VERSION=7.0.15
439
440
===================ENV IN A COMMIT CONTEXT
441
442
CI_BUILD_TOKEN=xxxxxx
443
HOSTNAME=runner-9431b96d-project-447-concurrent-0
444
PHP_INI_DIR=/usr/local/etc/php
445
PHP_ASC_URL=https://secure.php.net/get/php-7.0.15.tar.xz.asc/from/this/mirror
446
CI_BUILD_BEFORE_SHA=42dd9686eafc2e8fb0a6b4d2c6785baec229c94a
447
CI_SERVER_VERSION=
448
CI_BUILD_ID=192
449
OLDPWD=/
450
PHP_CFLAGS=-fstack-protector-strong -fpic -fpie -O2
451
PHP_MD5=dca23412f3e3b3987e582091b751925d
452
CI_PROJECT_ID=447
453
GITLAB_API_TOKEN=xxxxxxxxxxxxxxchangedmanually
454
PHPIZE_DEPS=autoconf 		file 		g++ 		gcc 		libc-dev 		make 		pkg-config 		re2c
455
PHP_URL=https://secure.php.net/get/php-7.0.15.tar.xz/from/this/mirror
456
CI_BUILD_REF_NAME=master
457
CI_BUILD_REF=42dd9686eafc2e8fb0a6b4d2c6785baec229c94a
458
PHP_LDFLAGS=-Wl,-O1 -Wl,--hash-style=both -pie
459
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
460
CI_BUILD_STAGE=test
461
CI_PROJECT_DIR=/builds/dan/washing-test
462
PHP_CPPFLAGS=-fstack-protector-strong -fpic -fpie -O2
463
GPG_KEYS=1A4E8B7277C42E53DBA9C7B9BCAA30EA9C0D5763 6E4F6AB321FDC07F2C332E3AC2BF0BC433CFC8B3
464
PWD=/builds/dan/washing-test
465
CI_DEBUG_TRACE=false
466
CI_SERVER_NAME=GitLab CI
467
XDEBUG_VERSION=2.5.0
468
GITLAB_CI=true
469
CI_SERVER_REVISION=
470
CI_BUILD_NAME=test
471
HOME=/root
472
SHLVL=1
473
PHP_SHA256=300364d57fc4a6176ff7d52d390ee870ab6e30df121026649f8e7e0b9657fe93
474
CI_SERVER=yes
475
CI=true
476
CI_BUILD_REPO=http://gitlab-ci-token:[email protected]/dan/washing-test.git
477
PHP_VERSION=7.0.15
478
*/
479