Sha256: 9c63ae750158584bf8d696700ced0dbd50762ac6bdc69bc7713e44c19c0fb04e
Contents?: true
Size: 1.18 KB
Versions: 1
Compression:
Stored size: 1.18 KB
Contents
require "uri" module TerraspaceCiCodebuild class Vars # Interface method. Hash of properties to be stored # Usually available from env vars. # Provide as many CI system as possible. 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 def host uri = URI(ENV['CODEBUILD_SOURCE_REPO_URL']) # https://github.com/ORG/REPO "#{uri.scheme}://#{uri.host}" end # ORG/REPO def full_repo uri = URI(repo_url) uri.path.sub(/^\//,'') end # https://github.com/ORG/REPO def repo_url # https://github.com/ORG/REPO.git ENV['CODEBUILD_SOURCE_REPO_URL'].sub('.git','') end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
terraspace_ci_codebuild-0.1.0 | lib/terraspace_ci_codebuild/vars.rb |