puppet 2.7.25 → 2.7.26

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of puppet might be problematic. Click here for more details.

Files changed (77) hide show
  1. data/bin/puppet +4 -0
  2. data/ext/build_defaults.yaml +4 -4
  3. data/ext/debian/control +1 -1
  4. data/ext/packaging/Gemfile +8 -0
  5. data/ext/packaging/Gemfile.lock +28 -0
  6. data/ext/packaging/README.md +31 -4
  7. data/ext/packaging/lib/packaging.rb +21 -0
  8. data/ext/packaging/lib/packaging/config.rb +277 -0
  9. data/ext/packaging/lib/packaging/config/params.rb +175 -0
  10. data/ext/packaging/lib/packaging/tar.rb +186 -0
  11. data/ext/packaging/lib/packaging/util.rb +44 -0
  12. data/ext/packaging/lib/packaging/util/date.rb +15 -0
  13. data/ext/packaging/lib/packaging/util/file.rb +60 -0
  14. data/ext/packaging/lib/packaging/util/jira.rb +83 -0
  15. data/ext/packaging/lib/packaging/util/net.rb +16 -0
  16. data/ext/packaging/lib/packaging/util/rake_utils.rb +57 -0
  17. data/ext/packaging/lib/packaging/util/serialization.rb +19 -0
  18. data/ext/packaging/lib/packaging/util/tool.rb +30 -0
  19. data/ext/packaging/lib/packaging/util/version.rb +300 -0
  20. data/ext/packaging/packaging.rake +10 -5
  21. data/ext/packaging/spec/fixtures/config/ext/build_defaults.yaml +2 -0
  22. data/ext/packaging/spec/fixtures/config/ext/project_data.yaml +2 -0
  23. data/ext/packaging/spec/fixtures/config/params.yaml +2 -0
  24. data/ext/packaging/spec/fixtures/util/pre_tasks.yaml +4 -0
  25. data/ext/packaging/spec/lib/packaging/config_spec.rb +330 -0
  26. data/ext/packaging/spec/lib/packaging/tar_spec.rb +122 -0
  27. data/ext/packaging/spec/lib/packaging/util/file_spec.rb +48 -0
  28. data/ext/packaging/spec/lib/packaging/util/jira_spec.rb +50 -0
  29. data/ext/packaging/spec/lib/packaging/util/net_spec.rb +23 -0
  30. data/ext/packaging/spec/lib/packaging/util/rake_utils_spec.rb +70 -0
  31. data/ext/packaging/spec/lib/packaging/util/version_spec.rb +67 -0
  32. data/ext/packaging/spec/lib/packaging_spec.rb +19 -0
  33. data/ext/packaging/spec/spec_helper.rb +10 -0
  34. data/ext/packaging/spec/tasks/00_utils_spec.rb +218 -88
  35. data/ext/packaging/tasks/00_utils.rake +63 -320
  36. data/ext/packaging/tasks/30_metrics.rake +4 -4
  37. data/ext/packaging/tasks/apple.rake +28 -13
  38. data/ext/packaging/tasks/build.rake +2 -176
  39. data/ext/packaging/tasks/deb.rake +61 -20
  40. data/ext/packaging/tasks/deb_repos.rake +12 -12
  41. data/ext/packaging/tasks/doc.rake +5 -5
  42. data/ext/packaging/tasks/fetch.rake +9 -9
  43. data/ext/packaging/tasks/gem.rake +59 -33
  44. data/ext/packaging/tasks/ips.rake +22 -23
  45. data/ext/packaging/tasks/jenkins.rake +34 -34
  46. data/ext/packaging/tasks/jenkins_dynamic.rake +22 -19
  47. data/ext/packaging/tasks/load_extras.rake +21 -0
  48. data/ext/packaging/tasks/mock.rake +16 -16
  49. data/ext/packaging/tasks/pe_deb.rake +2 -2
  50. data/ext/packaging/tasks/pe_remote.rake +9 -9
  51. data/ext/packaging/tasks/pe_rpm.rake +1 -1
  52. data/ext/packaging/tasks/pe_ship.rake +48 -37
  53. data/ext/packaging/tasks/pe_sign.rake +5 -5
  54. data/ext/packaging/tasks/release.rake +5 -5
  55. data/ext/packaging/tasks/remote_build.rake +27 -27
  56. data/ext/packaging/tasks/retrieve.rake +5 -5
  57. data/ext/packaging/tasks/rpm.rake +27 -10
  58. data/ext/packaging/tasks/rpm_repos.rake +13 -12
  59. data/ext/packaging/tasks/ship.rake +67 -45
  60. data/ext/packaging/tasks/sign.rake +37 -30
  61. data/ext/packaging/tasks/tar.rake +14 -69
  62. data/ext/packaging/tasks/tickets.rake +449 -0
  63. data/ext/packaging/tasks/update.rake +2 -2
  64. data/ext/packaging/tasks/vendor_gems.rake +2 -2
  65. data/ext/packaging/tasks/version.rake +8 -38
  66. data/ext/packaging/tasks/z_data_dump.rake +35 -3
  67. data/ext/packaging/templates/downstream.xml.erb +2 -2
  68. data/ext/packaging/templates/packaging.xml.erb +13 -13
  69. data/ext/packaging/templates/repo.xml.erb +9 -7
  70. data/lib/puppet/indirector/facts/facter.rb +1 -1
  71. data/lib/puppet/version.rb +1 -1
  72. data/spec/unit/indirector/facts/facter_spec.rb +2 -2
  73. metadata +38 -13
  74. data/ext/packaging/spec/tasks/build_object_spec.rb +0 -178
  75. data/ext/packaging/tasks/10_setupvars.rake +0 -135
  76. data/ext/packaging/tasks/20_setupextravars.rake +0 -53
  77. data/ext/packaging/tasks/template.rake +0 -27
@@ -1,135 +0,0 @@
1
- require 'yaml'
2
- require 'erb'
3
- require 'benchmark'
4
- load File.expand_path('../build.rake', __FILE__)
5
-
6
- ##
7
- # Where we get the data for our project depends on if a PARAMS_FILE environment
8
- # variable is passed with the rake call. PARAMS_FILE should be a path to a yaml
9
- # file containing all of the build parameters for a project, which are read
10
- # into our BuildInstance object. If no build parameters file is specified, we
11
- # assume input via the original methods of build_data.yaml and
12
- # project_data.yaml. This also applies to the pl:fetch and pl:load_extras
13
- # tasks, which are supplementary means of gathering data. These two are not
14
- # used if a PARAMS_FILE is passed.
15
-
16
- ##
17
- # Create our BuildInstance object, which will contain all the data about our
18
- # proposed build
19
- #
20
- @build = Build::BuildInstance.new
21
-
22
- if ENV['PARAMS_FILE'] && ENV['PARAMS_FILE'] != ''
23
- @build.set_params_from_file(ENV['PARAMS_FILE'])
24
- else
25
- # Load information about the project from the default params files
26
- #
27
- @build.set_params_from_file('ext/project_data.yaml') if File.readable?('ext/project_data.yaml')
28
- @build.set_params_from_file('ext/build_defaults.yaml') if File.readable?('ext/build_defaults.yaml')
29
- end
30
-
31
- # Allow environment variables to override the settings we just read in. These
32
- # variables are called out specifically because they are likely to require
33
- # overriding in at least some cases.
34
- #
35
- @build.sign_tar = boolean_value(ENV['SIGN_TAR']) if ENV['SIGN_TAR']
36
- @build.build_gem = boolean_value(ENV['GEM']) if ENV['GEM']
37
- @build.build_dmg = boolean_value(ENV['DMG']) if ENV['DMG']
38
- @build.build_ips = boolean_value(ENV['IPS']) if ENV['IPS']
39
- @build.build_doc = boolean_value(ENV['DOC']) if ENV['DOC']
40
- @build.build_pe = boolean_value(ENV['PE_BUILD']) if ENV['PE_BUILD']
41
- @build.debug = boolean_value(ENV['DEBUG']) if ENV['DEBUG']
42
- @build.update_version_file = ENV['NEW_STYLE_PACKAGE'] if ENV['NEW_STYLE_PACKAGE']
43
- @build.default_cow = ENV['COW'] if ENV['COW']
44
- @build.cows = ENV['COW'] if ENV['COW']
45
- @build.pbuild_conf = ENV['PBUILDCONF'] if ENV['PBUILDCONF']
46
- @build.packager = ENV['PACKAGER'] if ENV['PACKAGER']
47
- @build.default_mock = ENV['MOCK'] if ENV['MOCK']
48
- @build.final_mocks = ENV['MOCK'] if ENV['MOCK']
49
- @build.rc_mocks = ENV['MOCK'] if ENV['MOCK']
50
- @build.gpg_name = ENV['GPG_NAME'] if ENV['GPG_NAME']
51
- @build.gpg_key = ENV['GPG_KEY'] if ENV['GPG_KEY']
52
- @build.certificate_pem = ENV['CERT_PEM'] if ENV['CERT_PEM']
53
- @build.privatekey_pem = ENV['PRIVATE_PEM'] if ENV['PRIVATE_PEM']
54
- @build.yum_host = ENV['YUM_HOST'] if ENV['YUM_HOST']
55
- @build.yum_repo_path = ENV['YUM_REPO'] if ENV['YUM_REPO']
56
- @build.apt_host = ENV['APT_HOST'] if ENV['APT_HOST']
57
- @build.apt_repo_path = ENV['APT_REPO'] if ENV['APT_REPO']
58
- @build.pe_version = ENV['PE_VER'] if ENV['PE_VER']
59
- @build.notify = ENV['NOTIFY'] if ENV['NOTIFY']
60
-
61
- ##
62
- # These parameters are either generated dynamically by the project, or aren't
63
- # sufficiently generic/multi-purpose enough to justify being in
64
- # build_defaults.yaml or project_data.yaml.
65
- #
66
- @build.release ||= get_release
67
- @build.version ||= get_dash_version
68
- @build.gemversion ||= get_dot_version
69
- @build.ipsversion ||= get_ips_version
70
- @build.debversion ||= get_debversion
71
- @build.origversion ||= get_origversion
72
- @build.rpmversion ||= get_rpmversion
73
- @build.rpmrelease ||= get_rpmrelease
74
- @build.builder_data_file ||= 'builder_data.yaml'
75
- @build.team = ENV['TEAM'] || 'dev'
76
- @build.random_mockroot = ENV['RANDOM_MOCKROOT'] ? boolean_value(ENV['RANDOM_MOCKROOT']) : true
77
- @keychain_loaded ||= FALSE
78
- @build_root ||= Dir.pwd
79
- @build.build_date ||= timestamp('-')
80
- ##
81
- # For backwards compatibilty, we set build:@name to build:@project. @name was
82
- # renamed to @project in an effort to align the variable names with what has
83
- # been supported for parameter names in the params files.
84
- @build.name = @build.project
85
- # We also set @tar_host to @yum_host if @tar_host is not set. This is in
86
- # another effort to fix dumb mistakes. Early on, we just assumed tarballs would
87
- # go to @yum_host (why? probably just laziness) but this is not ideal and does
88
- # not make any sense when looking at the code. Now there's a @tar_host
89
- # variable, but for backwards compatibility, we'll default back to @yum_host if
90
- # @tar_host isn't set.
91
- @build.tar_host ||= @build.yum_host
92
-
93
- # Though undocumented, we had specified gem_devel_dependencies as an allowed
94
- # parameter for @build, and it was supposed to correspond with
95
- # gem_development_dependencies in a gem spec. It was dumb to call it 'devel'
96
- # instead of 'development', which would have been a cleaner mapping. Here, we
97
- # deprecate this.
98
- if @build.gem_devel_dependencies
99
- @build.gem_development_dependencies = @build.gem_devel_dependencies
100
- warn "
101
- DEPRECATED, 9-Nov-2013: 'gem_devel_dependencies' has been replaced with
102
- 'gem_development_dependencies.' Please update this field in your
103
- project_data.yaml
104
- "
105
- end
106
-
107
- if @build.debug
108
- @build.print_params
109
- end
110
-
111
- ##
112
- # MM 1-22-2013
113
- # We have long made all of the variables available to erb templates in the
114
- # various projects. The problem is now that we've switched to encapsulating all
115
- # of this inside a build object, that information is no longer available. This
116
- # section is for backwards compatibility only. It sets an instance variable
117
- # for all of the parameters inside the build object. This is repeated in
118
- # 20_setupextrasvars.rake. Note: The intention is to eventually abolish this
119
- # behavior. We want to access information from the build object, not in what
120
- # are essentially globally available rake variables.
121
- #
122
- @build.params.each do |param, value|
123
- self.instance_variable_set("@#{param}", value)
124
- end
125
-
126
- ##
127
- # Issue a deprecation warning if the packaging repo wasn't loaded by the loader
128
- unless @using_loader
129
- warn "
130
- DEPRECATED: The packaging repo tasks are now loaded by 'packaging.rake'.
131
- Please update your Rakefile or loading task to load
132
- 'ext/packaging/packaging.rake' instead of 'ext/packaging/tasks/*' (25-Jun-2013).
133
- "
134
- end
135
-
@@ -1,53 +0,0 @@
1
- # The pl:load_extras tasks is intended to load variables
2
- # from the extra yaml file downloaded by the pl:fetch task.
3
- # The goal is to be able to augment/override settings in the
4
- # source project's build_data.yaml and project_data.yaml with
5
- # Puppet Labs-specific data, rather than having to clutter the
6
- # generic tasks with data not generally useful outside the
7
- # PL Release team
8
- namespace :pl do
9
- task :load_extras, :tempdir do |t, args|
10
- unless ENV['PARAMS_FILE'] && ENV['PARAMS_FILE'] != ''
11
- tempdir = args.tempdir
12
- raise "pl:load_extras requires a directory containing extras data" if tempdir.nil?
13
- @build.set_params_from_file("#{tempdir}/#{@build.builder_data_file}")
14
- # Overrideable
15
- @build.build_pe = boolean_value(ENV['PE_BUILD']) if ENV['PE_BUILD']
16
- # right now, puppetdb is the only one to override these, because it needs
17
- # two sets of cows, one for PE and the other for FOSS
18
- @build.cows = ENV['COW'] if ENV['COW']
19
- @build.final_mocks = ENV['MOCK'] if ENV['MOCK']
20
- @build.packager = ENV['PACKAGER'] if ENV['PACKAGER']
21
- @build.pe_version = ENV['PE_VER'] if ENV['PE_VER']
22
- @build.yum_repo_path = ENV['YUM_REPO'] if ENV['YUM_REPO']
23
- @build.yum_host = ENV['YUM_HOST'] if ENV['YUM_HOST']
24
- @build.apt_host = ENV['APT_HOST'] if ENV['APT_HOST']
25
- @build.apt_repo_path = ENV['APT_REPO'] if ENV['APT_REPO']
26
- end
27
- end
28
- end
29
-
30
- ##
31
- # Starting with puppetdb, we'll maintain two separate build-data files, one for
32
- # PE and the other for FOSS. This is the start to maintaining both PE and FOSS
33
- # packaging in one source repo. As is done in 10_setupvars.rake, the @name
34
- # variable is set to the value of @project, for backwards compatibility.
35
- #
36
- unless @build.pe_name.nil?
37
- @build.project = @build.pe_name
38
- @build.name = @build.project
39
- end
40
-
41
- ##
42
- # MM 1-22-2013
43
- # We have long made all of the variables available to erb templates in the
44
- # various projects. The problem is now that we've switched to encapsulating all
45
- # of this inside a build object, that information is no longer available. This
46
- # section is for backwards compatibility only. It sets an instance variable
47
- # for all of the parameters inside the build object. This is repeated in
48
- # 10_setupvars.rake. Note that the intention is to eventually abolish this
49
- # behavior, and access the parameters via the build object only.
50
- #
51
- @build.params.each do |param, value|
52
- self.instance_variable_set("@#{param}", value)
53
- end
@@ -1,27 +0,0 @@
1
- # utility task to lay down packaging artifact files from erb templates
2
- namespace :package do
3
- task :template, :workdir do |t, args|
4
- workdir = args.workdir
5
-
6
- if @build.templates
7
- if @build.templates.is_a?(Array)
8
- templates = FileList[@build.templates.map {|path| File.join(workdir, path)}]
9
- else
10
- STDERR.puts "templates must be an Array, not '#{@build.templates.class}'"
11
- end
12
- else
13
- templates = FileList["#{workdir}/ext/**/*.erb"].exclude(/#{workdir}\/ext\/(packaging|osx)/)
14
- end
15
-
16
- templates.each do |template|
17
- # process the template, stripping off the ERB extension
18
- if File.extname(template) == ".erb"
19
- erb(template, template.gsub(/\.erb$/,""))
20
- rm_f(template)
21
- else
22
- STDERR.puts "Skipping #{template} because it doesn't look like an erb template"
23
- end
24
- end
25
- end
26
- end
27
-