|
@@ 30-40 (lines=11) @@
|
| 27 |
|
return $this->input->getOption('clover'); |
| 28 |
|
} |
| 29 |
|
|
| 30 |
|
public function getGitlabApiToken() : string |
| 31 |
|
{ |
| 32 |
|
$gitlabApiToken = $this->input->getOption('gitlab-api-token'); |
| 33 |
|
if ($gitlabApiToken === null) { |
| 34 |
|
$gitlabApiToken = getenv('GITLAB_API_TOKEN'); |
| 35 |
|
if ($gitlabApiToken === false) { |
| 36 |
|
throw new \RuntimeException('Could not find the Gitlab API token in the "GITLAB_API_TOKEN" environment variable. Either set this environment variable or pass the token via the --gitlab-api-token command line option.'); |
| 37 |
|
} |
| 38 |
|
} |
| 39 |
|
return $gitlabApiToken; |
| 40 |
|
} |
| 41 |
|
|
| 42 |
|
public function getGitlabUrl() : string |
| 43 |
|
{ |
|
@@ 77-87 (lines=11) @@
|
| 74 |
|
return $projectName; |
| 75 |
|
} |
| 76 |
|
|
| 77 |
|
public function getGitlabBuildRef() : string |
| 78 |
|
{ |
| 79 |
|
$buildRef = $this->input->getOption('gitlab-build-ref'); |
| 80 |
|
if ($buildRef === null) { |
| 81 |
|
$buildRef = getenv('CI_BUILD_REF'); |
| 82 |
|
if ($buildRef === false) { |
| 83 |
|
throw new \RuntimeException('Could not find the Gitlab build reference in the "CI_BUILD_REF" environment variable (usually set by Gitlab CI). Either set this environment variable or pass the build reference via the --gitlab-build-ref command line option.'); |
| 84 |
|
} |
| 85 |
|
} |
| 86 |
|
return $buildRef; |
| 87 |
|
} |
| 88 |
|
|
| 89 |
|
/** |
| 90 |
|
* Returns the current branch name (from Git) |