simplygenius-atmos 0.12.1 → 0.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +21 -0
- data/README.md +1 -1
- data/lib/simplygenius/atmos/commands/init.rb +0 -2
- data/lib/simplygenius/atmos/commands/secret.rb +1 -1
- data/lib/simplygenius/atmos/commands/terraform.rb +8 -10
- data/lib/simplygenius/atmos/commands/tfutil.rb +2 -2
- data/lib/simplygenius/atmos/config.rb +1 -1
- data/lib/simplygenius/atmos/providers/aws/container_manager.rb +2 -1
- data/lib/simplygenius/atmos/providers/aws/provider.rb +3 -0
- data/lib/simplygenius/atmos/terraform_executor.rb +20 -3
- data/lib/simplygenius/atmos/version.rb +1 -1
- data/templates/new/config/atmos/runtime.yml +6 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e57a5d360cd9c6016f83847333f3bf1519e70a8b73b0203c969d79fdf5a5e3f0
|
4
|
+
data.tar.gz: 4307c006f083fb94fdf5155df08a18a43d2ad6493070d279502b9a2a87a73c34
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d084865f58d1dfe8081debef0ce69c7fd2ab1068d813d8d704a4dc40962337c883be4763a2b161d5b8df4d0f6edd34a28209f95abb780b964d3abeb6dd7a94ab
|
7
|
+
data.tar.gz: 9f5f91afd5545dc14a073c4dfea67b86b699ed4add68077896cb151c990d50d32089246fe03b08b372eb98bb2694e98166933ac072fd22578e654a48771bc5b2
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,24 @@
|
|
1
|
+
0.13.0 (01/20/2021)
|
2
|
+
-------------------
|
3
|
+
|
4
|
+
#### Notes on major changes
|
5
|
+
|
6
|
+
* Now testing the atmos runtime against terraform 0.14 (and 0.11, 0.13)
|
7
|
+
* The ability to link files into the terraform execution directory was enhanced, but still doesn't work for the .terraform.lock.hcl as it is overwritten by terraform and doesn't follow the link
|
8
|
+
|
9
|
+
#### Full changelog
|
10
|
+
|
11
|
+
* exclude some new taskdef attributes for creation of new taskdef during deploy [a01b997](https://github.com/simplygenius/atmos/commit/a01b997)
|
12
|
+
* add debug logging for aws sdk logger [55dd303](https://github.com/simplygenius/atmos/commit/55dd303)
|
13
|
+
* directory sorting made more consistent across platforms [13622ff](https://github.com/simplygenius/atmos/commit/13622ff)
|
14
|
+
* switch ci/cd from travis to github actions [13622ff](https://github.com/simplygenius/atmos/commit/13622ff)
|
15
|
+
* fix test for tf 0.14 [122f861](https://github.com/simplygenius/atmos/commit/122f861)
|
16
|
+
* replace plugin sharing with built in terraform variant [eb75266](https://github.com/simplygenius/atmos/commit/eb75266)
|
17
|
+
* allow more options for linking in non-tf files into working dir [9878336](https://github.com/simplygenius/atmos/commit/9878336)
|
18
|
+
* sort secret list [6b2dbfe](https://github.com/simplygenius/atmos/commit/6b2dbfe)
|
19
|
+
* Only run terraform init when needed [d77186b](https://github.com/simplygenius/atmos/commit/d77186b)
|
20
|
+
|
21
|
+
|
1
22
|
0.12.1 (10/14/2020)
|
2
23
|
-------------------
|
3
24
|
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
[![Build Status](https://
|
1
|
+
[![Build Status](https://github.com/simplygenius/atmos/workflows/CD/badge.svg)](https://github.com/simplygenius/atmos/actions)
|
2
2
|
[![Coverage Status](https://coveralls.io/repos/github/simplygenius/atmos/badge.svg?branch=master)](https://coveralls.io/github/simplygenius/atmos?branch=master)
|
3
3
|
[![Gitter](https://badges.gitter.im/simplygenius/atmos.svg)](https://gitter.im/simplygenius/atmos?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
|
4
4
|
|
@@ -60,7 +60,7 @@ module SimplyGenius
|
|
60
60
|
Atmos.config.provider.auth_manager.authenticate(ENV) do |auth_env|
|
61
61
|
ClimateControl.modify(auth_env) do
|
62
62
|
logger.info "Secret keys are:"
|
63
|
-
Atmos.config.provider.secret_manager.to_h.keys.each {|k| logger.info k}
|
63
|
+
Atmos.config.provider.secret_manager.to_h.keys.sort.each {|k| logger.info k}
|
64
64
|
end
|
65
65
|
end
|
66
66
|
|
@@ -21,27 +21,23 @@ module SimplyGenius
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def init_automatically(auth_env, get_modules)
|
24
|
-
tf_init_dir = File.join(Atmos.config.tf_working_dir, '.terraform')
|
24
|
+
tf_init_dir = File.join(Atmos.config.tf_working_dir, 'recipes', '.terraform')
|
25
25
|
backend_initialized = File.exist?(File.join(tf_init_dir, 'terraform.tfstate'))
|
26
26
|
auto_init_enabled = Atmos.config["atmos.terraform.auto_init"].to_s == "true"
|
27
27
|
|
28
28
|
if auto_init && auto_init_enabled && ! backend_initialized
|
29
29
|
exe = TerraformExecutor.new(process_env: auth_env)
|
30
30
|
exe.run("init", get_modules: get_modules.present?)
|
31
|
-
init_shared_plugins
|
32
31
|
end
|
33
32
|
end
|
34
33
|
|
35
|
-
def
|
34
|
+
def enable_shared_plugins(env)
|
36
35
|
if ! Atmos.config["atmos.terraform.disable_shared_plugins"]
|
37
36
|
home_dir = OS.windows? ? File.join("~", "Application Data") : "~"
|
38
|
-
|
39
|
-
logger.debug("
|
40
|
-
mkdir_p(
|
41
|
-
|
42
|
-
if File.exist?(terraform_plugins_dir)
|
43
|
-
cp_r("#{terraform_plugins_dir}/.", shared_plugins_dir)
|
44
|
-
end
|
37
|
+
plugin_cache_dir = File.expand_path(File.join(home_dir,".terraform.d", "plugin-cache"))
|
38
|
+
logger.debug("Plugin cache dir: #{plugin_cache_dir}")
|
39
|
+
mkdir_p(plugin_cache_dir)
|
40
|
+
env["TF_PLUGIN_CACHE_DIR"] = plugin_cache_dir
|
45
41
|
end
|
46
42
|
end
|
47
43
|
|
@@ -58,6 +54,8 @@ module SimplyGenius
|
|
58
54
|
begin
|
59
55
|
get_modules = @terraform_arguments.delete("--get-modules")
|
60
56
|
|
57
|
+
enable_shared_plugins(auth_env)
|
58
|
+
|
61
59
|
init_automatically(auth_env, get_modules)
|
62
60
|
|
63
61
|
exe = TerraformExecutor.new(process_env: auth_env)
|
@@ -73,9 +73,9 @@ module SimplyGenius
|
|
73
73
|
chunk = $stdin.read_nonblock(1)
|
74
74
|
data = chunk + $stdin.read
|
75
75
|
logger.debug("Received stdin: " + data)
|
76
|
-
rescue Errno
|
76
|
+
rescue EOFError, SystemCallError => e # All Errno exceptions
|
77
77
|
data = nil
|
78
|
-
logger.debug("No stdin")
|
78
|
+
logger.debug("No stdin due to: #{e}")
|
79
79
|
end
|
80
80
|
return data
|
81
81
|
end
|
@@ -64,7 +64,8 @@ module SimplyGenius
|
|
64
64
|
|
65
65
|
new_defn = latest_defn.to_h
|
66
66
|
[:revision, :status, :task_definition_arn,
|
67
|
-
:requires_attributes, :compatibilities
|
67
|
+
:requires_attributes, :compatibilities,
|
68
|
+
:registered_at, :registered_by].each do |attr|
|
68
69
|
new_defn.delete(attr)
|
69
70
|
end
|
70
71
|
new_defn[:container_definitions].each {|c| c[:image] = remote_image}
|
@@ -1,5 +1,7 @@
|
|
1
1
|
require_relative '../../../atmos'
|
2
2
|
|
3
|
+
require 'aws-sdk-core'
|
4
|
+
|
3
5
|
Dir.glob(File.join(__dir__, '*.rb')) do |f|
|
4
6
|
require_relative "#{File.basename(f).sub(/\.rb$/, "")}"
|
5
7
|
end
|
@@ -11,6 +13,7 @@ module SimplyGenius
|
|
11
13
|
|
12
14
|
class Provider
|
13
15
|
include GemLogger::LoggerSupport
|
16
|
+
::Aws.config.update(logger: logger, log_level: :debug)
|
14
17
|
|
15
18
|
def initialize(name)
|
16
19
|
@name = name
|
@@ -308,7 +308,7 @@ module SimplyGenius
|
|
308
308
|
|
309
309
|
def clean_links
|
310
310
|
Find.find(Atmos.config.tf_working_dir) do |f|
|
311
|
-
Find.prune if f =~ /\/.terraform
|
311
|
+
Find.prune if f =~ /\/.terraform\//
|
312
312
|
File.delete(f) if File.symlink?(f)
|
313
313
|
end
|
314
314
|
end
|
@@ -318,13 +318,30 @@ module SimplyGenius
|
|
318
318
|
working_dir_links ||= ['modules', 'templates']
|
319
319
|
working_dir_links.each do |subdir|
|
320
320
|
source = File.join(Atmos.config.root_dir, subdir)
|
321
|
-
|
321
|
+
parts = File.split(subdir)
|
322
|
+
target_dir = Atmos.config.tf_working_dir
|
323
|
+
if parts[0] != "."
|
324
|
+
target_dir = File.join(Atmos.config.tf_working_dir, parts[0])
|
325
|
+
mkdir_p(target_dir)
|
326
|
+
end
|
327
|
+
ln_sf(source, target_dir) if File.exist?(source)
|
322
328
|
end
|
323
329
|
end
|
324
330
|
|
325
331
|
def link_recipes
|
326
332
|
@recipes.each do |recipe|
|
327
|
-
|
333
|
+
recipe_satisfied = false
|
334
|
+
["#{recipe}.tf", recipe].each do |recipe_variant|
|
335
|
+
fqrecipe = File.join(Atmos.config.root_dir, 'recipes', recipe_variant)
|
336
|
+
if File.exist?(fqrecipe)
|
337
|
+
ln_sf(fqrecipe, tf_recipes_dir)
|
338
|
+
recipe_satisfied = true
|
339
|
+
break
|
340
|
+
else
|
341
|
+
logger.debug("Recipe target does not exist: #{fqrecipe}")
|
342
|
+
end
|
343
|
+
end
|
344
|
+
logger.error("Recipe '#{recipe}' is not present") unless recipe_satisfied
|
328
345
|
end
|
329
346
|
end
|
330
347
|
|
@@ -119,12 +119,12 @@ atmos:
|
|
119
119
|
terraform:
|
120
120
|
# Disable module fetch from convenience plan/apply commands
|
121
121
|
disable_auto_modules: false
|
122
|
-
# By default (value=false), `atmos init`
|
123
|
-
#
|
124
|
-
#
|
125
|
-
# Otherwise, disabling this functionality (value=true) means
|
126
|
-
# env/group combination will be independent and download all
|
127
|
-
# itself only
|
122
|
+
# By default (value=false), `atmos init` (and auto init) will set
|
123
|
+
# TF_PLUGIN_CACHE_DIR to ~/.terraform.d/plugin-cache so that when terraform
|
124
|
+
# installs providers/plugins they can be reused across all env/group
|
125
|
+
# combinations. Otherwise, disabling this functionality (value=true) means
|
126
|
+
# that each env/group combination will be independent and download all
|
127
|
+
# plugins for itself only
|
128
128
|
disable_shared_plugins: false
|
129
129
|
# Customize what gets linked into the working directory that terraform gets
|
130
130
|
# executed in
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simplygenius-atmos
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.13.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Conway
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|