module TeamCity::Client::Builds
Defines methods related to builds
Public Instance Methods
Get build details
@param options [Hash] option keys, :id => build_id @return [Hashie::Mash] of build details
# File lib/teamcity/client/builds.rb, line 22 def build(options={}) assert_options(options) get("builds/#{locator(options)}") end
Get build artifacts
@param build_id [String] @return [Array<Hashie::Mash>]
# File lib/teamcity/client/builds.rb, line 60 def build_artifacts(build_id) response = get("builds/#{build_id}/artifacts") response['files'] end
Tells you whether or not a build is pinned
@param id [String] build to check if it is pinned @return [Boolean] whether the build is pinned or not
# File lib/teamcity/client/builds.rb, line 50 def build_pinned?(id) path = "builds/#{id}/pin" response = get(path, :accept => :text, :content_type => :text) response == 'true' end
Get build statistics
@param build_id [String] @return [Array<Hashie::Mash>]
# File lib/teamcity/client/builds.rb, line 41 def build_statistics(build_id) response = get("builds/#{build_id}/statistics") response['property'] end
List of builds
@param options [Hash] list of build locators to filter build results on @return [Array<Hashie::Mash>] of builds (empty array if no builds exist)
# File lib/teamcity/client/builds.rb, line 12 def builds(options={}) url_params = options.empty? ? '' : "?locator=#{locator(options)}" response = get("builds#{url_params}") response.build end
Pin a build
@param id [String] build to pin @param comment [String] provide a comment to the pin @return [nil]
# File lib/teamcity/client/builds.rb, line 72 def pin_build(id, comment='') path = "builds/#{id}/pin" put(path, :accept => :text, :content_type => :text) do |req| req.body = comment end return nil end
Unpin a build
@param id [String] build to unpin @return [nil]
# File lib/teamcity/client/builds.rb, line 86 def unpin_build(id) path = "builds/#{id}/pin" delete(path, :content_type => :text) end