Class: Jets::Git::Codebuild
- Inherits:
-
Object
- Object
- Jets::Git::Codebuild
- Defined in:
- lib/jets/git/codebuild.rb
Instance Method Summary collapse
-
#full_repo ⇒ Object
ORG/REPO.
- #git_branch ⇒ Object
- #git_sha ⇒ Object
- #git_url ⇒ Object
- #host ⇒ Object
- #params ⇒ Object
- #repo_url ⇒ Object
Instance Method Details
#full_repo ⇒ Object
ORG/REPO
34 35 36 37 |
# File 'lib/jets/git/codebuild.rb', line 34 def full_repo uri = URI(repo_url) uri.path.sub(/^\//,'') end |
#git_branch ⇒ Object
16 17 18 |
# File 'lib/jets/git/codebuild.rb', line 16 def git_branch ENV['CODEBUILD_SOURCE_VERSION'] end |
#git_sha ⇒ Object
20 21 22 |
# File 'lib/jets/git/codebuild.rb', line 20 def git_sha ENV['CODEBUILD_RESOLVED_SOURCE_VERSION'] end |
#git_url ⇒ Object
24 25 26 |
# File 'lib/jets/git/codebuild.rb', line 24 def git_url "#{host}/#{full_repo}" end |
#host ⇒ Object
28 29 30 31 |
# File 'lib/jets/git/codebuild.rb', line 28 def host uri = URI(ENV['CODEBUILD_SOURCE_REPO_URL']) # https://github.com/ORG/REPO "#{uri.scheme}://#{uri.host}" end |
#params ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/jets/git/codebuild.rb', line 3 def params params = { git_system: 'codebuild', git_branch: git_branch, git_sha: git_sha, git_dirty: false, # git_message: nil, # git_version: nil, } params[:git_url] = git_url if git_url params end |
#repo_url ⇒ Object
40 41 42 43 |
# File 'lib/jets/git/codebuild.rb', line 40 def repo_url # https://github.com/ORG/REPO.git ENV['CODEBUILD_SOURCE_REPO_URL'].sub('.git','') end |