Class: TerraspaceCiCodebuild::Vars
- Inherits:
-
Object
- Object
- TerraspaceCiCodebuild::Vars
- Defined in:
- lib/terraspace_ci_codebuild/vars.rb
Instance Method Summary collapse
-
#data ⇒ Object
Interface method.
-
#full_repo ⇒ Object
ORG/REPO.
- #host ⇒ Object
- #repo_url ⇒ Object
Instance Method Details
#data ⇒ Object
Interface method. Hash of properties to be stored Usually available from env vars. Provide as many CI system as possible.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/terraspace_ci_codebuild/vars.rb', line 8 def data { build_system: "codebuild", host: host, full_repo: full_repo, branch_name: ENV['CODEBUILD_SOURCE_VERSION'], # urls build_url: ENV['CODEBUILD_BUILD_URL'], build_id: ENV['CODEBUILD_BUILD_ID'], build_number: ENV['CODEBUILD_BUILD_NUMBER'], build_type: "push", # not available from env var. hard coded and really only type supported sha: ENV['CODEBUILD_RESOLVED_SOURCE_VERSION'], # commit_message: ENV['REPLACE_ME'], # pr_url: ENV['REPLACE_ME'], # pr_number: ENV['REPLACE_ME'], } end |
#full_repo ⇒ Object
ORG/REPO
32 33 34 35 |
# File 'lib/terraspace_ci_codebuild/vars.rb', line 32 def full_repo uri = URI(repo_url) uri.path.sub(/^\//,'') end |
#host ⇒ Object
26 27 28 29 |
# File 'lib/terraspace_ci_codebuild/vars.rb', line 26 def host uri = URI(ENV['CODEBUILD_SOURCE_REPO_URL']) # https://github.com/ORG/REPO "#{uri.scheme}://#{uri.host}" end |
#repo_url ⇒ Object
38 39 40 41 |
# File 'lib/terraspace_ci_codebuild/vars.rb', line 38 def repo_url # https://github.com/ORG/REPO.git ENV['CODEBUILD_SOURCE_REPO_URL'].sub('.git','') end |