Class: Terraspace::Cloud::Vcs::LocalGit::Gitlab

Inherits:
Base
  • Object
show all
Defined in:
lib/terraspace/cloud/vcs/local_git/gitlab.rb

Instance Attribute Summary

Attributes inherited from Base

#git_url

Instance Method Summary collapse

Methods inherited from Base

#initialize, #pr_number, #vars, vars_method, vars_methods

Constructor Details

This class inherits a constructor from Terraspace::Cloud::Vcs::LocalGit::Base

Instance Method Details

#branch_urlObject



7
8
9
# File 'lib/terraspace/cloud/vcs/local_git/gitlab.rb', line 7

def branch_url
  "#{host}/#{full_repo}/-/tree/#{branch_name}" if branch_name
end

#commit_urlObject



3
4
5
# File 'lib/terraspace/cloud/vcs/local_git/gitlab.rb', line 3

def commit_url
  "#{host}/#{full_repo}/-/commits/#{sha}" if sha
end

#pr_urlObject

Also computed in ci plugins which detects it from the ci env. Also handling here for case when user provides PR_NUMBER and GIT_REPO outside of normal CI env.



13
14
15
# File 'lib/terraspace/cloud/vcs/local_git/gitlab.rb', line 13

def pr_url
  "#{host}/#{full_repo}/-/merge_requests/#{pr_number}" if pr_number
end