Skip to content

Commit

Permalink
Merge pull request #89 from unifio/issue-88-dmi-process-packer-inputs…
Browse files Browse the repository at this point in the history
…-for-shell-interpolation

Add input processing to packer stacks
  • Loading branch information
disaac authored Sep 14, 2019
2 parents 42f5440 + 134fc7f commit 36cb9d1
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
- image: circleci/ruby:2.5.5

environment:
COVALENCE_VERSION: 0.9.6
COVALENCE_VERSION: 0.9.7
TERRAFORM_VERSION: 0.12.6
SOPS_VERSION: 3.3.1
BUNDLER_VERSION: 1.17.2
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 0.9.7 (Sep 14, 2019)

IMPROVEMENTS:
- Issue [#88](https://github.com/unifio/covalence/issues/88) Add input processing to packer stacks. Allows for shell interpolation processing on inputs for packer stacks.
- Can use the shell interpolation in the template to generate AWS assume role temporary keys to populate template. This allows for role assumption since role assumption is not supported from `~/.aws/config` attributes.

## 0.9.6 (Sep 9, 2019)

IMPROVEMENTS:
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
covalence (0.9.6)
covalence (0.9.7)
activemodel (~> 5.2.0)
activesupport (~> 5.2.0)
aws-sdk-s3 (~> 1)
Expand Down
4 changes: 4 additions & 0 deletions lib/covalence/core/entities/input.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ def to_command_option
"#{name} = #{parse_input(value())}"
end

def to_command_hash_elements
return name, parse_input(value()).delete_prefix('"').delete_suffix('"')
end

private

def get_value(input)
Expand Down
4 changes: 2 additions & 2 deletions lib/covalence/core/entities/stack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ def materialize_cmd_inputs(path)
File.open("#{path}/covalence-inputs.tfvars",'w') {|f| f.write(config)}
elsif type == "packer"
config = Hash.new
inputs.each do |name, input|
config[name] = input.value
inputs.values.map(&:to_command_hash_elements).each do |name, input|
config["#{name}"] = input
end
config_json = JSON.generate(config)
logger.info "path: #{path} module_path: #{module_path}\nStack inputs:\n\n#{config_json}"
Expand Down
2 changes: 1 addition & 1 deletion lib/covalence/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Covalence
VERSION = "0.9.6"
VERSION = "0.9.7"
end

0 comments on commit 36cb9d1

Please sign in to comment.