vanagon 0.26.3 → 0.29.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d675c65a485d790f1c1270033c15282c2c2c6773fd2229f66a4a9203049619db
4
- data.tar.gz: a79195a18df08e3103c7e9a69cd1551bf76149fa31275e11d5685b15576ff542
3
+ metadata.gz: 85733d41e3c9a2981c37db8b12e17ccbf3beb30b217fd7c575f2d02f7cfc8167
4
+ data.tar.gz: 2547ea591a28c8e78b6745dc4bb2782d797fd6a418685325b51145e8198b10d6
5
5
  SHA512:
6
- metadata.gz: 64dccb409eb072492bf3c2a9e8bfe7aa98dcabc0055fcc61d671d836793704083b81b67ba05bea0d49be61e1e0ca5d1100278c8e370b3598ac17764a4af5bc9d
7
- data.tar.gz: 7d2b511b858ff78c5268ed021cf033a4f6440fe722ada71d85bb8ef35766286045477846e3b7c485942b584984fe0c78ec866b160823d668cf0eab357cb030dd
6
+ metadata.gz: 2d0dfd0cf748f471e75d2ddaefa8680d4ccfa77d65d578227de3a0c3bfe65a8b993a0c681522f97e3667fc920e4af9f4fa3a6e6e2414085f7a05faa7769caaaa
7
+ data.tar.gz: d55dc6da693eee3d063a01badceb19520c823229f2af1143f11fae0a7f4dd8deeca432de233d01676482d0110330df1d65397214c1d366e7ebe9601a8d526702
@@ -46,7 +46,7 @@ class Vanagon
46
46
  end
47
47
 
48
48
  # These could be templates, but their content is static, so that seems weird.
49
- File.open(File.join(deb_dir, "compat"), "w") { |f| f.puts("7") }
49
+ File.open(File.join(deb_dir, 'compat'), 'w') { |f| f.puts('10') }
50
50
  FileUtils.mkdir_p(File.join(deb_dir, "source"))
51
51
  File.open(File.join(deb_dir, "source", "format"), "w") { |f| f.puts("3.0 (quilt)") }
52
52
  end
@@ -0,0 +1,17 @@
1
+ platform 'fedora-36-x86_64' do |plat|
2
+ plat.servicedir '/usr/lib/systemd/system'
3
+ plat.defaultdir '/etc/sysconfig'
4
+ plat.servicetype 'systemd'
5
+ plat.dist 'fc36'
6
+
7
+ packages = %w[
8
+ autoconf automake bzip2-devel gcc gcc-c++ libselinux-devel
9
+ libsepol libsepol-devel make cmake pkgconfig readline-devel
10
+ rpmdevtools rsync swig zlib-devel systemtap-sdt-devel
11
+ perl-lib perl-FindBin
12
+ ]
13
+ plat.provision_with("/usr/bin/dnf install -y --best --allowerasing #{packages.join(' ')}")
14
+
15
+ plat.install_build_dependencies_with '/usr/bin/dnf install -y --best --allowerasing'
16
+ plat.vmpooler_template 'fedora-36-x86_64'
17
+ end
@@ -0,0 +1,11 @@
1
+ platform "ubuntu-22.04-aarch64" do |plat|
2
+ plat.servicedir "/lib/systemd/system"
3
+ plat.defaultdir "/etc/default"
4
+ plat.servicetype "systemd"
5
+ plat.codename "jammy"
6
+
7
+ packages = %w(build-essential devscripts make quilt pkg-config debhelper rsync fakeroot cmake)
8
+ plat.provision_with "export DEBIAN_FRONTEND=noninteractive; apt-get update -qq; apt-get install -qy --no-install-recommends #{packages.join(' ')}"
9
+ plat.install_build_dependencies_with "DEBIAN_FRONTEND=noninteractive; apt-get install -qy --no-install-recommends "
10
+ plat.vmpooler_template "ubuntu-2204-arm64"
11
+ end
@@ -0,0 +1,11 @@
1
+ platform "ubuntu-22.04-amd64" do |plat|
2
+ plat.servicedir "/lib/systemd/system"
3
+ plat.defaultdir "/etc/default"
4
+ plat.servicetype "systemd"
5
+ plat.codename "jammy"
6
+
7
+ packages = %w(build-essential devscripts make quilt pkg-config debhelper rsync fakeroot cmake)
8
+ plat.provision_with "export DEBIAN_FRONTEND=noninteractive; apt-get update -qq; apt-get install -qy --no-install-recommends #{packages.join(' ')}"
9
+ plat.install_build_dependencies_with "DEBIAN_FRONTEND=noninteractive; apt-get install -qy --no-install-recommends "
10
+ plat.vmpooler_template "ubuntu-2204-x86_64"
11
+ end
@@ -144,22 +144,34 @@ class Vanagon
144
144
 
145
145
  VERSION_REGEX = /^([=<>]+)\s*([^<>=]*)$/.freeze
146
146
 
147
- # Loads a given platform from the configdir
147
+ # Loads a platform from the config/platforms directory
148
148
  #
149
- # @param name [String] the name of the platform
150
- # @param configdir [String] the path to the platform config file
149
+ # @param platform_name [String] the name of the platform
150
+ # @param config_directory [String] the path to the platform config file
151
151
  # @return [Vanagon::Platform] the platform as specified in the platform config
152
152
  # @raise if the instance_eval on Platform fails, the exception is reraised
153
- def self.load_platform(name, configdir)
154
- platfile = File.join(configdir, "#{name}.rb")
155
- dsl = Vanagon::Platform::DSL.new(name)
156
- dsl.instance_eval(File.read(platfile), platfile, 1)
157
- dsl._platform
158
- rescue StandardError => e
159
- VanagonLogger.error "Error loading platform '#{name}' using '#{platfile}':"
160
- VanagonLogger.error(e)
161
- VanagonLogger.error e.backtrace.join("\n")
162
- raise e
153
+ def self.load_platform(platform_name, config_directory) # rubocop:disable Metrics/AbcSize
154
+ platform_name = File.basename(platform_name, '.rb')
155
+ platform_file_name = "#{platform_name}.rb"
156
+ platform_path = File.join(config_directory, platform_file_name)
157
+
158
+ begin
159
+ platform_definition = File.read(platform_path)
160
+ rescue Errno::ENOENT, Errno::EACCES => e
161
+ VanagonLogger.error "Error loading '#{platform_name}': #{e}"
162
+ exit 1
163
+ end
164
+
165
+ dsl = Vanagon::Platform::DSL.new(platform_name)
166
+ begin
167
+ dsl.instance_eval(platform_definition, platform_path, 1)
168
+ dsl._platform
169
+ rescue StandardError => e
170
+ VanagonLogger.error "Error loading platform '#{platform_name}' using '#{platform_path}':"
171
+ VanagonLogger.error(e)
172
+ VanagonLogger.error e.backtrace.join("\n")
173
+ raise e
174
+ end
163
175
  end
164
176
 
165
177
  # Generate the scripts required to add a group to the package generated.
@@ -13,19 +13,21 @@ class Vanagon
13
13
  tempdir = Vanagon::Utilities::remote_ssh_command("#{project.signing_username}@#{project.signing_hostname}", "#{mktemp} 2>/dev/null", return_command_output: true)
14
14
  end
15
15
 
16
+ remote_host = "#{project.signing_username}@#{project.signing_hostname}"
17
+ remote_destination_directory = "#{remote_host}:#{tempdir}"
18
+ remote_signing_script_path = File.join(tempdir, File.basename('sign_extra_file'))
19
+
16
20
  project.extra_files_to_sign.each do |file|
17
- file_location = File.join(tempdir, File.basename(file))
21
+ remote_file_to_sign_path = File.join(tempdir, File.basename(file))
18
22
  local_source_path = File.join('$(tempdir)', source_dir, file)
19
- remote_host = "#{project.signing_username}@#{project.signing_hostname}"
20
- remote_destination_path = "#{remote_host}:#{tempdir}"
21
- remote_file_location = "#{remote_host}:#{file_location}"
22
- extra_flags = ''
23
- extra_flags = '--extended-attributes' if project.platform.is_macos?
23
+ remote_source_path = "#{remote_host}:#{remote_file_to_sign_path}"
24
+ local_destination_path = local_source_path
24
25
 
25
26
  commands += [
26
- "rsync -e '#{Vanagon::Utilities.ssh_command}' --verbose --recursive --hard-links --links --no-perms --no-owner --no-group #{extra_flags} #{local_source_path} #{remote_destination_path}",
27
- "#{Vanagon::Utilities.ssh_command} #{remote_host} #{project.signing_command} #{file_location}",
28
- "rsync -e '#{Vanagon::Utilities.ssh_command}' --verbose --recursive --hard-links --links --no-perms --no-owner --no-group #{extra_flags} #{remote_file_location} #{local_source_path}"
27
+ "#{Vanagon::Utilities.ssh_command} #{remote_host} \"echo '#{project.signing_command} #{remote_file_to_sign_path}' > #{remote_signing_script_path}\"",
28
+ "scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no #{local_source_path} #{remote_destination_directory}",
29
+ "#{Vanagon::Utilities.ssh_command} #{remote_host} /bin/bash #{remote_signing_script_path}",
30
+ "scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no #{remote_source_path} #{local_destination_path}"
29
31
  ]
30
32
  end
31
33
 
@@ -27,5 +27,10 @@ override_dh_shlibdeps:
27
27
 
28
28
  override_dh_usrlocal:
29
29
 
30
+ override_dh_builddeb:
31
+ # Force builddeb to use gzip for its internal compression. reprepro can get
32
+ # confused if something newer is used.
33
+ dh_builddeb -- -Zgzip
34
+
30
35
  %:
31
36
  dh $@
@@ -5,7 +5,7 @@
5
5
  <license file="<%= @name -%>-License.rtf"/>
6
6
  <domains enable_anywhere="true" enable_currentUserHome="false" enable_localSystem="true" />
7
7
  <pkg-ref id="<%= @identifier-%>.<%= @name -%>"/>
8
- <options customize="never" hostArchitectures="i386" require-scripts="false"/>
8
+ <options customize="never" hostArchitectures="x86_64,arm64" require-scripts="false"/>
9
9
  <choices-outline>
10
10
  <line choice="default">
11
11
  <line choice="<%= @identifier-%>.<%= @name -%>"/>
@@ -83,12 +83,14 @@ describe Vanagon::Utilities::ExtraFilesSigner do
83
83
  commands = Vanagon::Utilities::ExtraFilesSigner.commands(project._project, mktemp, source_dir)
84
84
  expect(commands).to match(
85
85
  [
86
- "rsync -e '/usr/bin/ssh -p 22 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' --verbose --recursive --hard-links --links --no-perms --no-owner --no-group --extended-attributes $(tempdir)/dir/source_dir/test1/a.rb test@abc:/tmp/xyz",
87
- "/usr/bin/ssh -p 22 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no test@abc codesign /tmp/xyz/a.rb",
88
- "rsync -e '/usr/bin/ssh -p 22 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' --verbose --recursive --hard-links --links --no-perms --no-owner --no-group --extended-attributes test@abc:/tmp/xyz/a.rb $(tempdir)/dir/source_dir/test1/a.rb",
89
- "rsync -e '/usr/bin/ssh -p 22 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' --verbose --recursive --hard-links --links --no-perms --no-owner --no-group --extended-attributes $(tempdir)/dir/source_dir/test2/b.rb test@abc:/tmp/xyz",
90
- "/usr/bin/ssh -p 22 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no test@abc codesign /tmp/xyz/b.rb",
91
- "rsync -e '/usr/bin/ssh -p 22 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' --verbose --recursive --hard-links --links --no-perms --no-owner --no-group --extended-attributes test@abc:/tmp/xyz/b.rb $(tempdir)/dir/source_dir/test2/b.rb"
86
+ %q(/usr/bin/ssh -p 22 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no test@abc "echo 'codesign /tmp/xyz/a.rb' > /tmp/xyz/sign_extra_file"),
87
+ %q(scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $(tempdir)/dir/source_dir/test1/a.rb test@abc:/tmp/xyz),
88
+ %q(/usr/bin/ssh -p 22 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no test@abc /bin/bash /tmp/xyz/sign_extra_file),
89
+ %q(scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no test@abc:/tmp/xyz/a.rb $(tempdir)/dir/source_dir/test1/a.rb),
90
+ %q(/usr/bin/ssh -p 22 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no test@abc "echo 'codesign /tmp/xyz/b.rb' > /tmp/xyz/sign_extra_file"),
91
+ %q(scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $(tempdir)/dir/source_dir/test2/b.rb test@abc:/tmp/xyz),
92
+ %q(/usr/bin/ssh -p 22 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no test@abc /bin/bash /tmp/xyz/sign_extra_file),
93
+ %q(scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no test@abc:/tmp/xyz/b.rb $(tempdir)/dir/source_dir/test2/b.rb)
92
94
  ]
93
95
  )
94
96
  end
@@ -107,12 +109,14 @@ describe Vanagon::Utilities::ExtraFilesSigner do
107
109
  commands = Vanagon::Utilities::ExtraFilesSigner.commands(project._project, mktemp, source_dir)
108
110
  expect(commands).to match(
109
111
  [
110
- "rsync -e '/usr/bin/ssh -p 22 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' --verbose --recursive --hard-links --links --no-perms --no-owner --no-group $(tempdir)/dir/source_dir/test1/a.rb test@abc:/tmp/xyz",
111
- "/usr/bin/ssh -p 22 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no test@abc codesign /tmp/xyz/a.rb",
112
- "rsync -e '/usr/bin/ssh -p 22 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' --verbose --recursive --hard-links --links --no-perms --no-owner --no-group test@abc:/tmp/xyz/a.rb $(tempdir)/dir/source_dir/test1/a.rb",
113
- "rsync -e '/usr/bin/ssh -p 22 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' --verbose --recursive --hard-links --links --no-perms --no-owner --no-group $(tempdir)/dir/source_dir/test2/b.rb test@abc:/tmp/xyz",
114
- "/usr/bin/ssh -p 22 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no test@abc codesign /tmp/xyz/b.rb",
115
- "rsync -e '/usr/bin/ssh -p 22 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' --verbose --recursive --hard-links --links --no-perms --no-owner --no-group test@abc:/tmp/xyz/b.rb $(tempdir)/dir/source_dir/test2/b.rb"
112
+ %q(/usr/bin/ssh -p 22 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no test@abc "echo 'codesign /tmp/xyz/a.rb' > /tmp/xyz/sign_extra_file"),
113
+ %q(scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $(tempdir)/dir/source_dir/test1/a.rb test@abc:/tmp/xyz),
114
+ %q(/usr/bin/ssh -p 22 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no test@abc /bin/bash /tmp/xyz/sign_extra_file),
115
+ %q(scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no test@abc:/tmp/xyz/a.rb $(tempdir)/dir/source_dir/test1/a.rb),
116
+ %q(/usr/bin/ssh -p 22 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no test@abc "echo 'codesign /tmp/xyz/b.rb' > /tmp/xyz/sign_extra_file"),
117
+ %q(scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $(tempdir)/dir/source_dir/test2/b.rb test@abc:/tmp/xyz),
118
+ %q(/usr/bin/ssh -p 22 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no test@abc /bin/bash /tmp/xyz/sign_extra_file),
119
+ %q(scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no test@abc:/tmp/xyz/b.rb $(tempdir)/dir/source_dir/test2/b.rb)
116
120
  ]
117
121
  )
118
122
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vanagon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.26.3
4
+ version: 0.29.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet Labs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-11 00:00:00.000000000 Z
11
+ date: 2022-08-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: docopt
@@ -169,6 +169,7 @@ files:
169
169
  - lib/vanagon/platform/defaults/el-9-x86_64.rb
170
170
  - lib/vanagon/platform/defaults/fedora-32-x86_64.rb
171
171
  - lib/vanagon/platform/defaults/fedora-34-x86_64.rb
172
+ - lib/vanagon/platform/defaults/fedora-36-x86_64.rb
172
173
  - lib/vanagon/platform/defaults/osx-10.15-x86_64.rb
173
174
  - lib/vanagon/platform/defaults/osx-11-x86_64.rb
174
175
  - lib/vanagon/platform/defaults/osx-12-x86_64.rb
@@ -184,6 +185,8 @@ files:
184
185
  - lib/vanagon/platform/defaults/ubuntu-18.04-amd64.rb
185
186
  - lib/vanagon/platform/defaults/ubuntu-20.04-aarch64.rb
186
187
  - lib/vanagon/platform/defaults/ubuntu-20.04-amd64.rb
188
+ - lib/vanagon/platform/defaults/ubuntu-22.04-aarch64.rb
189
+ - lib/vanagon/platform/defaults/ubuntu-22.04-amd64.rb
187
190
  - lib/vanagon/platform/dsl.rb
188
191
  - lib/vanagon/platform/osx.rb
189
192
  - lib/vanagon/platform/rpm.rb
@@ -330,42 +333,42 @@ signing_key:
330
333
  specification_version: 3
331
334
  summary: All of your packages will fit into this van with this one simple trick.
332
335
  test_files:
333
- - spec/lib/makefile_spec.rb
334
336
  - spec/lib/git/rev_list_spec.rb
335
- - spec/lib/vanagon/platform_spec.rb
337
+ - spec/lib/vanagon/environment_spec.rb
338
+ - spec/lib/vanagon/project/dsl_spec.rb
339
+ - spec/lib/vanagon/extensions/string_spec.rb
340
+ - spec/lib/vanagon/extensions/set/json_spec.rb
341
+ - spec/lib/vanagon/extensions/ostruct/json_spec.rb
336
342
  - spec/lib/vanagon/utilities/shell_utilities_spec.rb
337
343
  - spec/lib/vanagon/utilities/extra_files_signer_spec.rb
338
- - spec/lib/vanagon/common/pathname_spec.rb
339
- - spec/lib/vanagon/common/user_spec.rb
340
- - spec/lib/vanagon/component/rules_spec.rb
341
344
  - spec/lib/vanagon/component/dsl_spec.rb
342
- - spec/lib/vanagon/component/source/git_spec.rb
343
345
  - spec/lib/vanagon/component/source/http_spec.rb
344
- - spec/lib/vanagon/component/source/local_spec.rb
345
346
  - spec/lib/vanagon/component/source/rewrite_spec.rb
347
+ - spec/lib/vanagon/component/source/local_spec.rb
348
+ - spec/lib/vanagon/component/source/git_spec.rb
346
349
  - spec/lib/vanagon/component/source_spec.rb
347
- - spec/lib/vanagon/platform/dsl_spec.rb
350
+ - spec/lib/vanagon/component/rules_spec.rb
348
351
  - spec/lib/vanagon/platform/deb_spec.rb
352
+ - spec/lib/vanagon/platform/rpm/aix_spec.rb
353
+ - spec/lib/vanagon/platform/osx_spec.rb
349
354
  - spec/lib/vanagon/platform/solaris_11_spec.rb
355
+ - spec/lib/vanagon/platform/dsl_spec.rb
350
356
  - spec/lib/vanagon/platform/rpm_spec.rb
351
- - spec/lib/vanagon/platform/osx_spec.rb
352
- - spec/lib/vanagon/platform/rpm/aix_spec.rb
353
357
  - spec/lib/vanagon/platform/solaris_10_spec.rb
354
358
  - spec/lib/vanagon/platform/windows_spec.rb
355
- - spec/lib/vanagon/project_spec.rb
359
+ - spec/lib/vanagon/common/pathname_spec.rb
360
+ - spec/lib/vanagon/common/user_spec.rb
361
+ - spec/lib/vanagon/driver_spec.rb
362
+ - spec/lib/vanagon/platform_spec.rb
356
363
  - spec/lib/vanagon/component_spec.rb
357
- - spec/lib/vanagon/extensions/set/json_spec.rb
358
- - spec/lib/vanagon/extensions/string_spec.rb
359
- - spec/lib/vanagon/extensions/ostruct/json_spec.rb
360
- - spec/lib/vanagon/project/dsl_spec.rb
361
- - spec/lib/vanagon/environment_spec.rb
362
- - spec/lib/vanagon/cli_spec.rb
363
- - spec/lib/vanagon/utilities_spec.rb
364
+ - spec/lib/vanagon/project_spec.rb
365
+ - spec/lib/vanagon/engine/ec2_spec.rb
364
366
  - spec/lib/vanagon/engine/docker_spec.rb
367
+ - spec/lib/vanagon/engine/pooler_spec.rb
365
368
  - spec/lib/vanagon/engine/local_spec.rb
366
- - spec/lib/vanagon/engine/base_spec.rb
367
369
  - spec/lib/vanagon/engine/always_be_scheduling_spec.rb
370
+ - spec/lib/vanagon/engine/base_spec.rb
368
371
  - spec/lib/vanagon/engine/hardware_spec.rb
369
- - spec/lib/vanagon/engine/pooler_spec.rb
370
- - spec/lib/vanagon/engine/ec2_spec.rb
371
- - spec/lib/vanagon/driver_spec.rb
372
+ - spec/lib/vanagon/cli_spec.rb
373
+ - spec/lib/vanagon/utilities_spec.rb
374
+ - spec/lib/makefile_spec.rb