ext/packaging/tasks/20_setupextravars.rake in puppet-2.7.20 vs ext/packaging/tasks/20_setupextravars.rake in puppet-2.7.21
- old
+ new
@@ -4,35 +4,54 @@
# source project's build_data.yaml and project_data.yaml with
# Puppet Labs-specific data, rather than having to clutter the
# generic tasks with data not generally useful outside the
# PL Release team
namespace :pl do
- task :load_extras do
- begin
- @build_data = YAML.load_file("#{ENV['HOME']}/.packaging/#{@builder_data_file}")
- @rpm_build_host = @build_data['rpm_build_host'] if @build_data['rpm_build_host']
- @deb_build_host = @build_data['deb_build_host'] if @build_data['deb_build_host']
- @osx_build_host = @build_data['osx_build_host'] if @build_data['osx_build_host']
- @ips_build_host = @build_data['ips_build_host'] if @build_data['ips_build_host']
- @tarball_path = @build_data['tarball_path'] if @build_data['tarball_path']
- @dmg_path = @build_data['dmg_path'] if @build_data['dmg_path']
- @pe_version = @build_data['pe_version'] if @build_data['pe_version']
- @team = @build_data['team'] if @build_data['team']
- @yum_repo_path = @build_data['yum_repo_path'] if @build_data['yum_repo_path']
- @apt_repo_path = @build_data['apt_repo_path'] if @build_data['apt_repo_path']
- @freight_conf = @build_data['freight_conf'] if @build_data['freight_conf']
- @sles_build_host = @build_data['sles_build_host'] if @build_data['sles_build_host']
- @sles_arch_repos = @build_data['sles_arch_repos'] if @build_data['sles_arch_repos']
- @sles_repo_path = @build_data['sles_repo_path'] if @build_data['sles_repo_path']
- @sles_repo_host = @build_data['sles_repo_host'] if @build_data['sles_repo_host']
- @ips_path = @build_data['ips_path'] if @build_data['ips_path']
- @ips_package_host = @build_data['ips_package_host'] if @build_data['ips_package_host']
- @certificate_pem = @build_data['certificate_pem'] if @build_data['certificate_pem']
- @privatekey_pem = @build_data['privatekey_pem'] if @build_data['privatekey_pem']
- @ips_inter_cert = @build_data['ips_inter_cert'] if @build_data['ips_inter_cert']
- rescue => e
- STDERR.puts "There was an error loading the builder data from #{ENV['HOME']}/.packaging/#{@builder_data_file}. Try rake pl:fetch to download the current extras builder data.\n" + e
- exit 1
+ task :load_extras, :tempdir do |t, args|
+ unless ENV['PARAMS_FILE'] && ENV['PARAMS_FILE'] != ''
+ tempdir = args.tempdir
+ raise "pl:load_extras requires a directory containing extras data" if tempdir.nil?
+ @build.set_params_from_file("#{tempdir}/team/#{@build.builder_data_file}")
+ @build.set_params_from_file("#{tempdir}/project/#{@build.builder_data_file}")
+ # Overrideable
+ @build.build_pe = boolean_value(ENV['PE_BUILD']) if ENV['PE_BUILD']
+ # right now, puppetdb is the only one to override these, because it needs
+ # two sets of cows, one for PE and the other for FOSS
+ @build.cows = ENV['COW'] if ENV['COW']
+ @build.final_mocks = ENV['MOCK'] if ENV['MOCK']
+ @build.packager = ENV['PACKAGER'] if ENV['PACKAGER']
+ @build.pe_version = ENV['PE_VER'] if ENV['PE_VER']
+ @build.yum_repo_path = ENV['YUM_REPO'] if ENV['YUM_REPO']
+ @build.yum_host = ENV['YUM_HOST'] if ENV['YUM_HOST']
+ @build.apt_host = ENV['APT_HOST'] if ENV['APT_HOST']
+ @build.apt_repo_path = ENV['APT_REPO'] if ENV['APT_REPO']
end
end
end
+if @build.team == 'release'
+ @build.benchmark = TRUE
+end
+##
+# Starting with puppetdb, we'll maintain two separate build-data files, one for
+# PE and the other for FOSS. This is the start to maintaining both PE and FOSS
+# packaging in one source repo. As is done in 10_setupvars.rake, the @name
+# variable is set to the value of @project, for backwards compatibility.
+#
+unless @build.pe_name.nil?
+ @build.project = @build.pe_name
+ @build.name = @build.project
+end
+
+##
+# MM 1-22-2013
+# We have long made all of the variables available to erb templates in the
+# various projects. The problem is now that we've switched to encapsulating all
+# of this inside a build object, that information is no longer available. This
+# section is for backwards compatibility only. It sets an instance variable
+# for all of the parameters inside the build object. This is repeated in
+# 10_setupvars.rake. Note that the intention is to eventually abolish this
+# behavior, and access the parameters via the build object only.
+#
+@build.params.each do |param, value|
+ self.instance_variable_set("@#{param}", value)
+end