vanagon 0.27.0 → 0.30.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/vanagon/platform/deb.rb +1 -1
- data/lib/vanagon/platform/defaults/fedora-36-x86_64.rb +17 -0
- data/lib/vanagon/platform.rb +25 -13
- data/lib/vanagon/utilities/extra_files_signer.rb +13 -9
- data/resources/osx/project-installer.xml.erb +1 -1
- data/spec/lib/vanagon/utilities/extra_files_signer_spec.rb +16 -12
- metadata +25 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d2dda4b6ee0f2e7df4443eee96ac2d6a31a3b70045348a1659a377e3c6fe4d42
|
4
|
+
data.tar.gz: 3cbc04e6447435f41a9dedf83f8d0bc3eb0f606663032384c1e34f526e35dc00
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6395d2ab2f96b64637be1be8fc5ac0548da7cf9b17d3d4365e337fb725cab14c7df026df5e8b5bb632490cfb9ac233bc94e481463a00c2f516e8fc10a252a701
|
7
|
+
data.tar.gz: efb78d1686945d3ca0ca99409c1b4753c628ff077860dcaab5429e065545f48041f62c02472de05dc44295a8fb099d6f3eda47a4097d93d2ba13fa2849846070
|
data/lib/vanagon/platform/deb.rb
CHANGED
@@ -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,
|
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
|
data/lib/vanagon/platform.rb
CHANGED
@@ -144,22 +144,34 @@ class Vanagon
|
|
144
144
|
|
145
145
|
VERSION_REGEX = /^([=<>]+)\s*([^<>=]*)$/.freeze
|
146
146
|
|
147
|
-
# Loads a
|
147
|
+
# Loads a platform from the config/platforms directory
|
148
148
|
#
|
149
|
-
# @param
|
150
|
-
# @param
|
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(
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
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,23 @@ 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
|
+
extra_flags = ''
|
20
|
+
extra_flags = '--extended-attributes' if project.platform.is_macos?
|
21
|
+
|
16
22
|
project.extra_files_to_sign.each do |file|
|
17
|
-
|
23
|
+
remote_file_to_sign_path = File.join(tempdir, File.basename(file))
|
18
24
|
local_source_path = File.join('$(tempdir)', source_dir, file)
|
19
|
-
|
20
|
-
|
21
|
-
remote_file_location = "#{remote_host}:#{file_location}"
|
22
|
-
extra_flags = ''
|
23
|
-
extra_flags = '--extended-attributes' if project.platform.is_macos?
|
25
|
+
remote_source_path = "#{remote_host}:#{remote_file_to_sign_path}"
|
26
|
+
local_destination_path = local_source_path
|
24
27
|
|
25
28
|
commands += [
|
26
|
-
"
|
27
|
-
"#{Vanagon::Utilities.ssh_command} #{
|
28
|
-
"
|
29
|
+
"#{Vanagon::Utilities.ssh_command} #{remote_host} \"echo '#{project.signing_command} #{remote_file_to_sign_path}' > #{remote_signing_script_path}\"",
|
30
|
+
"rsync -e '#{Vanagon::Utilities.ssh_command}' --verbose --recursive --hard-links --links --no-perms --no-owner --no-group #{extra_flags} #{local_source_path} #{remote_destination_directory}",
|
31
|
+
"#{Vanagon::Utilities.ssh_command} #{remote_host} /bin/bash #{remote_signing_script_path}",
|
32
|
+
"rsync -e '#{Vanagon::Utilities.ssh_command}' --verbose --recursive --hard-links --links --no-perms --no-owner --no-group #{extra_flags} #{remote_source_path} #{local_destination_path}"
|
29
33
|
]
|
30
34
|
end
|
31
35
|
|
@@ -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="
|
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
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
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(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),
|
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(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),
|
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(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),
|
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(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)
|
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
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
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(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),
|
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(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),
|
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(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),
|
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(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)
|
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.
|
4
|
+
version: 0.30.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-
|
11
|
+
date: 2022-08-18 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
|
@@ -332,42 +333,42 @@ signing_key:
|
|
332
333
|
specification_version: 3
|
333
334
|
summary: All of your packages will fit into this van with this one simple trick.
|
334
335
|
test_files:
|
335
|
-
- spec/lib/
|
336
|
-
- spec/lib/vanagon/
|
337
|
-
- spec/lib/vanagon/
|
336
|
+
- spec/lib/vanagon/extensions/set/json_spec.rb
|
337
|
+
- spec/lib/vanagon/extensions/ostruct/json_spec.rb
|
338
|
+
- spec/lib/vanagon/extensions/string_spec.rb
|
339
|
+
- spec/lib/vanagon/common/pathname_spec.rb
|
340
|
+
- spec/lib/vanagon/common/user_spec.rb
|
338
341
|
- spec/lib/vanagon/platform_spec.rb
|
339
|
-
- spec/lib/vanagon/
|
340
|
-
- spec/lib/vanagon/engine/
|
342
|
+
- spec/lib/vanagon/cli_spec.rb
|
343
|
+
- spec/lib/vanagon/engine/pooler_spec.rb
|
341
344
|
- spec/lib/vanagon/engine/docker_spec.rb
|
345
|
+
- spec/lib/vanagon/engine/local_spec.rb
|
342
346
|
- spec/lib/vanagon/engine/always_be_scheduling_spec.rb
|
347
|
+
- spec/lib/vanagon/engine/base_spec.rb
|
348
|
+
- spec/lib/vanagon/engine/ec2_spec.rb
|
343
349
|
- spec/lib/vanagon/engine/hardware_spec.rb
|
344
|
-
- spec/lib/vanagon/
|
345
|
-
- spec/lib/vanagon/
|
346
|
-
- spec/lib/vanagon/
|
347
|
-
- spec/lib/vanagon/
|
348
|
-
- spec/lib/vanagon/utilities/extra_files_signer_spec.rb
|
349
|
-
- spec/lib/vanagon/utilities/shell_utilities_spec.rb
|
350
|
+
- spec/lib/vanagon/project_spec.rb
|
351
|
+
- spec/lib/vanagon/utilities_spec.rb
|
352
|
+
- spec/lib/vanagon/driver_spec.rb
|
353
|
+
- spec/lib/vanagon/component/rules_spec.rb
|
350
354
|
- spec/lib/vanagon/component/source_spec.rb
|
351
|
-
- spec/lib/vanagon/component/source/http_spec.rb
|
352
355
|
- spec/lib/vanagon/component/source/rewrite_spec.rb
|
353
356
|
- spec/lib/vanagon/component/source/local_spec.rb
|
357
|
+
- spec/lib/vanagon/component/source/http_spec.rb
|
354
358
|
- spec/lib/vanagon/component/source/git_spec.rb
|
355
359
|
- spec/lib/vanagon/component/dsl_spec.rb
|
356
|
-
- spec/lib/vanagon/component/rules_spec.rb
|
357
|
-
- spec/lib/vanagon/utilities_spec.rb
|
358
|
-
- spec/lib/vanagon/extensions/ostruct/json_spec.rb
|
359
|
-
- spec/lib/vanagon/extensions/set/json_spec.rb
|
360
|
-
- spec/lib/vanagon/extensions/string_spec.rb
|
361
|
-
- spec/lib/vanagon/driver_spec.rb
|
362
360
|
- spec/lib/vanagon/project/dsl_spec.rb
|
363
|
-
- spec/lib/vanagon/
|
361
|
+
- spec/lib/vanagon/utilities/extra_files_signer_spec.rb
|
362
|
+
- spec/lib/vanagon/utilities/shell_utilities_spec.rb
|
364
363
|
- spec/lib/vanagon/platform/solaris_11_spec.rb
|
365
364
|
- spec/lib/vanagon/platform/solaris_10_spec.rb
|
366
365
|
- spec/lib/vanagon/platform/osx_spec.rb
|
367
366
|
- spec/lib/vanagon/platform/windows_spec.rb
|
368
|
-
- spec/lib/vanagon/platform/rpm_spec.rb
|
369
|
-
- spec/lib/vanagon/platform/dsl_spec.rb
|
370
367
|
- spec/lib/vanagon/platform/deb_spec.rb
|
368
|
+
- spec/lib/vanagon/platform/rpm_spec.rb
|
371
369
|
- spec/lib/vanagon/platform/rpm/aix_spec.rb
|
372
|
-
- spec/lib/vanagon/
|
370
|
+
- spec/lib/vanagon/platform/dsl_spec.rb
|
371
|
+
- spec/lib/vanagon/environment_spec.rb
|
372
|
+
- spec/lib/vanagon/component_spec.rb
|
373
|
+
- spec/lib/git/rev_list_spec.rb
|
373
374
|
- spec/lib/makefile_spec.rb
|