Class: Publisher::Providers::Info::Gitlab
- Includes:
- Helpers, Singleton
- Defined in:
- lib/allure_report_publisher/lib/providers/info/gitlab.rb
Overview
Gitlab executor info
Constant Summary
Constants inherited from Base
Base::ALLURE_JOB_NAME, Base::ALLURE_RUN_ID
Instance Method Summary collapse
-
#allure_mr_iid ⇒ String
Custom mr iid name.
-
#allure_project ⇒ String
Custom repository name.
-
#build_name ⇒ String
Job name.
-
#build_url ⇒ String
Build url.
-
#executor(report_url) ⇒ Hash
Executor info.
-
#mr_iid ⇒ Integer
Merge request iid.
-
#pr? ⇒ Boolean
Pull request run.
-
#run_id ⇒ String
Get ci run ID without creating instance of ci provider.
-
#server_url ⇒ String
Server url.
Methods included from Helpers
allure_cli?, colorize, debug_io, #env, error, execute_shell, log, log_debug, logger, pastel, path, reset_debug_io!
Instance Method Details
#allure_mr_iid ⇒ String
Custom mr iid name
71 72 73 |
# File 'lib/allure_report_publisher/lib/providers/info/gitlab.rb', line 71 def allure_mr_iid @allure_mr_iid ||= env("ALLURE_MERGE_REQUEST_IID") end |
#allure_project ⇒ String
Custom repository name
57 58 59 |
# File 'lib/allure_report_publisher/lib/providers/info/gitlab.rb', line 57 def allure_project @allure_project ||= env("ALLURE_PROJECT_PATH") end |
#build_name ⇒ String
Job name
78 79 80 |
# File 'lib/allure_report_publisher/lib/providers/info/gitlab.rb', line 78 def build_name @build_name ||= env(ALLURE_JOB_NAME) || env("CI_JOB_NAME") end |
#build_url ⇒ String
Build url
50 51 52 |
# File 'lib/allure_report_publisher/lib/providers/info/gitlab.rb', line 50 def build_url @build_url ||= env("CI_PIPELINE_URL") end |
#executor(report_url) ⇒ Hash
Executor info
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/allure_report_publisher/lib/providers/info/gitlab.rb', line 13 def executor(report_url) { name: "Gitlab", type: "gitlab", reportName: "AllureReport", reportUrl: report_url, url: server_url, buildUrl: build_url, buildOrder: run_id, buildName: build_name } end |
#mr_iid ⇒ Integer
Merge request iid
64 65 66 |
# File 'lib/allure_report_publisher/lib/providers/info/gitlab.rb', line 64 def mr_iid @mr_iid ||= allure_mr_iid || env("CI_MERGE_REQUEST_IID") end |
#pr? ⇒ Boolean
Pull request run
29 30 31 |
# File 'lib/allure_report_publisher/lib/providers/info/gitlab.rb', line 29 def pr? !!((allure_project && allure_mr_iid) || mr_iid) end |
#run_id ⇒ String
Get ci run ID without creating instance of ci provider
36 37 38 |
# File 'lib/allure_report_publisher/lib/providers/info/gitlab.rb', line 36 def run_id @run_id ||= env(ALLURE_RUN_ID) || ENV["CI_PIPELINE_ID"] end |
#server_url ⇒ String
Server url
43 44 45 |
# File 'lib/allure_report_publisher/lib/providers/info/gitlab.rb', line 43 def server_url @server_url ||= env("CI_SERVER_URL") end |