kitchen-pulumi 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/kitchen/driver/pulumi.rb +26 -2
- data/lib/kitchen/pulumi/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a4a60b8665fa071e284264d175c23f1b48473a55b6df136a8612b37f6e749c6b
|
4
|
+
data.tar.gz: da5c21dda536dd9f821954b9eb684657ae69eeeab579b724d80afc5e30d94404
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10be33e1ce1e9e6d6c17c25aff2e0d2609b16bc9b5968469f75a7da47320f3f15e8d124a5e0fcc7fb239e80af1065ab37e9ed3074616b94fa0cd26893f999d0e
|
7
|
+
data.tar.gz: 855a59728c1c2ec80664815e229df6b220190bce28db008803c2c105b2134e7eb2c31a8304bfe6647839ef3047953d7c02280c6afe1be65848daedf3ca07d19d
|
@@ -48,7 +48,7 @@ module Kitchen
|
|
48
48
|
include ::Kitchen::Pulumi::ConfigAttribute::SecretsProvider
|
49
49
|
include ::Kitchen::Pulumi::ConfigAttribute::PreserveConfig
|
50
50
|
|
51
|
-
# Initializes a stack via `pulumi stack init`
|
51
|
+
# Initializes a stack via `pulumi stack init` & run a preview of changes
|
52
52
|
#
|
53
53
|
# @param _state [::Hash] the current kitchen state
|
54
54
|
# @return [void]
|
@@ -56,13 +56,23 @@ module Kitchen
|
|
56
56
|
dir = "-C #{config_directory}"
|
57
57
|
login
|
58
58
|
initialize_stack(stack, dir)
|
59
|
+
|
60
|
+
::Kitchen::Pulumi.with_temp_conf(config_file) do |temp_conf_file|
|
61
|
+
refresh_config(stack, temp_conf_file, dir) if config_refresh_config
|
62
|
+
configure(config_config, stack, temp_conf_file, dir)
|
63
|
+
configure(config_secrets, stack, temp_conf_file, dir, is_secret: true)
|
64
|
+
preview_stack(stack, temp_conf_file, dir)
|
65
|
+
end
|
59
66
|
end
|
60
67
|
|
61
68
|
# Sets stack config values via `pulumi config` and updates the stack via `pulumi up`
|
62
69
|
#
|
63
70
|
# @param _state [::Hash] the current kitchen state
|
64
71
|
# @param config_only [Boolean] specify true to update the stack config without
|
65
|
-
# applying changes to the stack via `pulumi up
|
72
|
+
# applying changes to the stack via `pulumi up`. This is used primarily for
|
73
|
+
# setting the correct stack inputs by successively applying `pulumi config` in
|
74
|
+
# the order of precedence for specifying stack config values in the config file or
|
75
|
+
# kitchen.yml file.
|
66
76
|
#
|
67
77
|
# for block {|temp_conf_file| ...}
|
68
78
|
# @yield [temp_conf_file] provides the path to the temporary config file used
|
@@ -229,6 +239,20 @@ module Kitchen
|
|
229
239
|
)
|
230
240
|
end
|
231
241
|
|
242
|
+
# Preview effects of `pulumi up`
|
243
|
+
#
|
244
|
+
# @param stack [String] name of the stack being refreshed
|
245
|
+
# @param conf_file [String] path to a stack config file to use for configuration
|
246
|
+
# @param dir [String] path to the directory to run Pulumi commands in
|
247
|
+
# @return [void]
|
248
|
+
def preview_stack(stack, conf_file, dir = '')
|
249
|
+
base_cmd = "preview -r --show-config -s #{stack} #{dir}"
|
250
|
+
::Kitchen::Pulumi::ShellOut.run(
|
251
|
+
cmd: "#{base_cmd} #{config_file(conf_file, flag: true)}",
|
252
|
+
logger: logger,
|
253
|
+
)
|
254
|
+
end
|
255
|
+
|
232
256
|
# Evolves a stack via successive calls to `pulumi config set` and `pulumi up`
|
233
257
|
# according to the `stack_evolution` instance attribute, if set. This permits
|
234
258
|
# testing stack config changes over time.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kitchen-pulumi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jacob Learned
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-04-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: guard
|
@@ -394,7 +394,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
394
394
|
- !ruby/object:Gem::Version
|
395
395
|
version: '0'
|
396
396
|
requirements: []
|
397
|
-
rubygems_version: 3.1.
|
397
|
+
rubygems_version: 3.1.6
|
398
398
|
signing_key:
|
399
399
|
specification_version: 4
|
400
400
|
summary: Test-Kitchen plugins for Pulumi projects
|