class ArtifactoryApi::Client::Builds
Public Class Methods
new(client)
click to toggle source
# File lib/artifactory_api/builds.rb, line 5 def initialize(client) @client = client @logger = @client.logger end
Public Instance Methods
diffs_for_build_run(build, to_run, from_run)
click to toggle source
# File lib/artifactory_api/builds.rb, line 53 def diffs_for_build_run build, to_run, from_run end
get_run_info(build,run)
click to toggle source
# File lib/artifactory_api/builds.rb, line 44 def get_run_info build,run response_json = @client.api_get_request("/api/build/#{build}/#{run}") return nil unless response_json result = response_json["buildInfo"] result[:number] = result["number"] result[:name] = result["name"] result end
get_runs_for_build(build)
click to toggle source
# File lib/artifactory_api/builds.rb, line 31 def get_runs_for_build build response_json = @client.api_get_request("/api/build/#{build}") return nil unless response_json response_json["buildsNumbers"].map do |build| { :number => build["uri"].sub(/^\//,''), :uri => build["uri"], :started => build["started"] } end.sort{|x,y| x[:number].to_i <=> y[:number].to_i} end
list_all()
click to toggle source
Returns an array of hashes, containing a “name” key and a “last_built” key The api returns build names with a starting slash, this will remove them.
# File lib/artifactory_api/builds.rb, line 16 def list_all response_json = @client.api_get_request("/api/build") return nil unless response_json response_json["builds"].map do |build| { :name => build["uri"].sub(/^\//,''), :uri => build["uri"], :lastStarted => build["lastStarted"] } end.sort{ |x,y| x[:name] <=> y[:name]} end
to_s()
click to toggle source
# File lib/artifactory_api/builds.rb, line 10 def to_s "#<ArtifactoryApi::Client::Builds" end