ext/packaging/tasks/jenkins.rake in puppet-2.7.23 vs ext/packaging/tasks/jenkins.rake in puppet-2.7.24
- old
+ new
@@ -113,20 +113,43 @@
when /dmg|apple/ then "dmg"
when /gem/ then "gem"
when /tar/ then "tar"
else raise "Could not determine build type for #{build_task}"
end
+
+ # Create a string of metrics to send to Jenkins for data analysis
+ dist = case build_type
+ when /deb/ then @build.default_cow.split('-')[1]
+ when /rpm/
+ if @build.pe_version
+ @build.final_mocks.split(' ')[0].split('-')[2]
+ else
+ @build.final_mocks.split(' ')[0].split('-')[1..2].join("")
+ end
+ when /dmg/ then "apple"
+ when /gem/ then "gem"
+ when /sles/ then "sles"
+ when /tar/ then "tar"
+ else raise "Could not determine build type for #{build_task}"
+ end
+
+ if @build.pe_version
+ metrics = "#{ENV['USER']}~#{@build.version}~#{@build.pe_version}~#{dist}~#{@build.team}"
+ else
+ metrics = "#{ENV['USER']}~#{@build.version}~N/A~#{dist}~#{@build.team}"
+ end
#
# Create the data files to send to jenkins
properties = @build.params_to_yaml
bundle = git_bundle('HEAD')
# Construct the parameters, which is an array of hashes we turn into JSON
parameters = [{ "name" => "BUILD_PROPERTIES", "file" => "file0" },
{ "name" => "PROJECT_BUNDLE", "file" => "file1" },
{ "name" => "PROJECT", "value" => "#{@build.project}" },
- { "name" => "BUILD_TYPE", "label" => "#{build_type}" }]
+ { "name" => "BUILD_TYPE", "label" => "#{build_type}" },
+ { "name" => "METRICS", "value" => "#{metrics}"}]
# Initialize the args array that will hold all of the arguments we pass
# to the curl utility method.
args = []
@@ -147,9 +170,10 @@
args << [
"-Fname=BUILD_PROPERTIES", "-Ffile0=@#{properties}",
"-Fname=PROJECT_BUNDLE" , "-Ffile1=@#{bundle}",
"-Fname=PROJECT" , "-Fvalue=#{@build.project}",
"-Fname=BUILD_TYPE" , "-Fvalue=#{build_type}",
+ "-Fname=METRICS" , "-Fvalue=#{metrics}",
"-FSubmit=Build",
"-Fjson=#{json.to_json}",
]
# We have several arrays inside args by now, flatten it up.