@@ 35-45 (lines=11) @@ | ||
32 | return $this->input->getOption('crap4j'); |
|
33 | } |
|
34 | ||
35 | public function getGitlabApiToken() : string |
|
36 | { |
|
37 | $gitlabApiToken = $this->input->getOption('gitlab-api-token'); |
|
38 | if ($gitlabApiToken === null) { |
|
39 | $gitlabApiToken = getenv('GITLAB_API_TOKEN'); |
|
40 | if ($gitlabApiToken === false) { |
|
41 | 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.'); |
|
42 | } |
|
43 | } |
|
44 | return $gitlabApiToken; |
|
45 | } |
|
46 | ||
47 | public function getGitlabUrl() : string |
|
48 | { |
|
@@ 102-114 (lines=13) @@ | ||
99 | return $commitSha; |
|
100 | } |
|
101 | ||
102 | public function getJobStage() : string |
|
103 | { |
|
104 | $commitSha = $this->input->getOption('job-stage'); |
|
105 | ||
106 | if ($commitSha === null) { |
|
107 | $commitSha = getenv('CI_JOB_STAGE'); |
|
108 | if ($commitSha === false) { |
|
109 | throw new \RuntimeException('Could not find the Gitlab job stage in the "CI_JOB_STAGE" (Gitlab 9+) environment variable (usually set by Gitlab CI). Either set this environment variable or pass the job stage via the --job_stage command line option.'); |
|
110 | } |
|
111 | } |
|
112 | ||
113 | return $commitSha; |
|
114 | } |
|
115 | ||
116 | public function getGitlabBuildId() : int |
|
117 | { |