hybrid_platforms_conductor 33.7.4 → 33.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/platform_handler/serverless_chef.rb +9 -0
- data/lib/hybrid_platforms_conductor/version.rb +1 -1
- data/spec/hybrid_platforms_conductor_test/api/platform_handlers/serverless_chef/packaging_spec.rb +20 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6cd97aeaa58547169eee76dd4605b3ee08b9188c718bbef6d3757186d7a6dfdc
|
|
4
|
+
data.tar.gz: e054326d38480c3480578b44e78c10f481e82b750486f5c1c8007ee2491731da
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d63c0cf64b6c5163ed7c1f6cb0c927c325d18c21dbf286b5dce91578f4fa5b4a1e6119b41ac877be20812b475306b3f7ab444474e482ebe36c0735b90c7ae9b7
|
|
7
|
+
data.tar.gz: 23cdf3242c78e993c3df565f1123eea67c5aca527218122e22a0ed1fcacfbf33adf3396aaebbdeb82666cbdf3e7ace44ecfd4a1c453e0fe8d38fc7d4064c7b89
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
# [v33.8.0](https://github.com/sweet-delights/hybrid-platforms-conductor/compare/v33.7.4...v33.8.0) (2021-08-04 15:55:54)
|
|
2
|
+
|
|
3
|
+
## Global changes
|
|
4
|
+
### Patches
|
|
5
|
+
|
|
6
|
+
* [[Feature(platform_handler_serverless_chef)] Integrate testadmin public key while deploying in local mode](https://github.com/sweet-delights/hybrid-platforms-conductor/commit/6083463bf3bc760c393b786515db59af89315333)
|
|
7
|
+
|
|
8
|
+
## Changes for platform_handler_serverless_chef
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* [[Feature(platform_handler_serverless_chef)] Integrate testadmin public key while deploying in local mode](https://github.com/sweet-delights/hybrid-platforms-conductor/commit/6083463bf3bc760c393b786515db59af89315333)
|
|
12
|
+
|
|
1
13
|
# [v33.7.4](https://github.com/sweet-delights/hybrid-platforms-conductor/compare/v33.7.3...v33.7.4) (2021-08-04 14:21:08)
|
|
2
14
|
|
|
3
15
|
## Global changes
|
|
@@ -190,6 +190,15 @@ module HybridPlatformsConductor
|
|
|
190
190
|
secrets_file = "#{@repository_path}/#{package_dir}/data_bags/hpc_secrets/hpc_secrets.json"
|
|
191
191
|
FileUtils.mkdir_p(File.dirname(secrets_file))
|
|
192
192
|
File.write(secrets_file, secrets.merge(id: 'hpc_secrets').to_json)
|
|
193
|
+
# Make the testadmin public key available for deployment for hpc_test cookbook
|
|
194
|
+
testadmin_pub_key = "#{@config.hybrid_platforms_dir}/testadmin.key.pub"
|
|
195
|
+
if local_environment && File.exist?(testadmin_pub_key)
|
|
196
|
+
Dir.glob("#{@repository_path}/#{package_dir}/cookbook_artifacts/hpc_test-*") do |hpc_test_cookbook_path|
|
|
197
|
+
hpc_test_files_dir = "#{hpc_test_cookbook_path}/files/default"
|
|
198
|
+
FileUtils.mkdir_p hpc_test_files_dir
|
|
199
|
+
FileUtils.cp(testadmin_pub_key, "#{hpc_test_files_dir}/testadmin.key.pub")
|
|
200
|
+
end
|
|
201
|
+
end
|
|
193
202
|
# Remember the package info
|
|
194
203
|
File.write(package_info_file, package_info.to_json)
|
|
195
204
|
end
|
data/spec/hybrid_platforms_conductor_test/api/platform_handlers/serverless_chef/packaging_spec.rb
CHANGED
|
@@ -51,6 +51,7 @@ describe HybridPlatformsConductor::HpcPlugins::PlatformHandler::ServerlessChef d
|
|
|
51
51
|
[
|
|
52
52
|
%r{^cd #{Regexp.escape(repository)} &&\s+sudo rm -rf dist/#{Regexp.escape(env)}/#{Regexp.escape(policy)} &&\s+/opt/chef-workstation/bin/chef export #{Regexp.escape(policy_file)} dist/#{Regexp.escape(env)}/#{Regexp.escape(policy)} --chef-license accept#{data_bags ? " && cp -ar data_bags/ dist/#{Regexp.escape(env)}/#{Regexp.escape(policy)}/" : ''}$},
|
|
53
53
|
proc do
|
|
54
|
+
# Mock the packaging in the dist directory
|
|
54
55
|
package_dir = "#{repository}/dist/#{env}/#{policy}"
|
|
55
56
|
FileUtils.mkdir_p package_dir
|
|
56
57
|
FileUtils.cp_r("#{repository}/data_bags", "#{package_dir}/") if data_bags
|
|
@@ -329,6 +330,25 @@ describe HybridPlatformsConductor::HpcPlugins::PlatformHandler::ServerlessChef d
|
|
|
329
330
|
end
|
|
330
331
|
end
|
|
331
332
|
|
|
333
|
+
it 'packages the repository with a testadmin public key' do
|
|
334
|
+
with_serverless_chef_platforms('hpc_test') do |platform, repository|
|
|
335
|
+
File.write("#{ENV['hpc_platforms']}/testadmin.key.pub", 'ssh-rsa 12345 testadmin@test.com')
|
|
336
|
+
with_packaging_mocked(
|
|
337
|
+
repository,
|
|
338
|
+
policy_file: 'policyfiles/test_policy.local.rb',
|
|
339
|
+
env: 'local',
|
|
340
|
+
cookbook_metadata: {
|
|
341
|
+
'hpc_test-1234' => {}
|
|
342
|
+
}
|
|
343
|
+
) do
|
|
344
|
+
platform.package(services: { 'node' => %w[test_policy] }, secrets: {}, local_environment: true)
|
|
345
|
+
testadmin_key_pub = Dir.glob("#{repository}/dist/local/test_policy/cookbook_artifacts/hpc_test-*/files/default/testadmin.key.pub").first
|
|
346
|
+
expect(testadmin_key_pub).not_to eq nil
|
|
347
|
+
expect(File.read(testadmin_key_pub)).to eq 'ssh-rsa 12345 testadmin@test.com'
|
|
348
|
+
end
|
|
349
|
+
end
|
|
350
|
+
end
|
|
351
|
+
|
|
332
352
|
end
|
|
333
353
|
|
|
334
354
|
end
|