terraspace 1.1.6 → 1.1.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1645fa9d7679907d214d87b276d1282f0ae0fba29f1a2fff4019c4324a61b9c4
4
- data.tar.gz: 26e2f27c70bf1872fce821778a80d20e3923b1dbf8e56013c88ee3d0c66ff002
3
+ metadata.gz: 82379236de38c541366efe70b69e9393490f5da74a4aecd4a975b3b9be0af907
4
+ data.tar.gz: b5cb25d94d6015f01768ec6970b66221b78851ef72ef5614f0a5e54e774aaa94
5
5
  SHA512:
6
- metadata.gz: 9a512a5c8c7d9b30959a967023be912979c2f666d510f95094cf1c531c00b3d52c11bca88528e72e62842484fdfa82d22c62edffe86d11a6a8ec11126117baba
7
- data.tar.gz: 9f88a7337013171c4944f4c8b86067ba1df3a9e009cedb773fac0199cd35a7828c535439848abc9addec41cf918b7df0152c2d0360255ec8381a7df9ff87c000
6
+ metadata.gz: 917fc2cd69a9eab564e2c8a69e9493a04e0a2e424784e09217a79f5c3433b9a790a1bfc9669e9b68a0f53cce32565900aeb4134861faf9a9266b91d847fea39d
7
+ data.tar.gz: a2977e19c20a1841892f4b275623e080837ccd10359282108475cad9bdd993ccaac3d7d1f0f7e38a530b823ab4c8c2816e9564b882cb482618bd7701e306da6d
@@ -0,0 +1,33 @@
1
+ #!/bin/bash
2
+
3
+ set -eu
4
+
5
+ # will build from /tmp because terraspace/Gemfile may interfere
6
+ cd /tmp
7
+
8
+ export PATH=~/bin:$PATH # ~/bin/terraspace wrapper
9
+
10
+ set -x
11
+
12
+ git clone https://github.com/boltops-tools/terraspace-graph-demo
13
+ cd terraspace-graph-demo
14
+
15
+ # Rewrite the Gemfile to use the local terraspace gem for testing
16
+ cat << EOF > Gemfile
17
+ source "https://rubygems.org"
18
+ gem "terraspace", path: "$CODEBUILD_SRC_DIR", submodules: true
19
+ gem "rspec-terraspace", git: "https://github.com/boltops-tools/rspec-terraspace", branch: "master"
20
+ gem "terraspace_plugin_aws", git: "https://github.com/boltops-tools/terraspace_plugin_aws", branch: "master"
21
+ EOF
22
+ bundle
23
+
24
+ # Uncomment to enable logger level debug
25
+ # cat << EOF > config/app.rb
26
+ # Terraspace.configure do |config|
27
+ # config.logger.level = :debug
28
+ # end
29
+ # EOF
30
+
31
+ terraspace all up -y
32
+ terraspace clean all -y
33
+ terraspace all down -y
@@ -0,0 +1,10 @@
1
+ version: 0.2
2
+
3
+ phases:
4
+ install:
5
+ runtime-versions:
6
+ ruby: latest
7
+ build:
8
+ commands:
9
+ - .cody/shared/script/install.sh
10
+ - .cody/all/bin/build.sh
@@ -0,0 +1,2 @@
1
+ github_url("https://github.com/boltops-tools/terraspace.git")
2
+ linux_image("aws/codebuild/amazonlinux2-x86_64-standard:3.0")
data/.cody/all/role.rb ADDED
@@ -0,0 +1,6 @@
1
+ iam_policy(
2
+ "dynamodb",
3
+ "logs",
4
+ "s3",
5
+ "ssm",
6
+ )
@@ -9,6 +9,7 @@ end
9
9
  stage "Build" do
10
10
  # in parallel
11
11
  codebuild(
12
+ "terraspace-all",
12
13
  "terraspace-aws",
13
14
  "terraspace-azurerm",
14
15
  "terraspace-google",
data/CHANGELOG.md CHANGED
@@ -3,6 +3,10 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  This project *loosely tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
5
5
 
6
+ ## [1.1.7] - 2022-02-22
7
+ - [#215](https://github.com/boltops-tools/terraspace/pull/215) fix all down by building child nodes
8
+ - [#216](https://github.com/boltops-tools/terraspace/pull/216) add codebuild project with acceptance test for terraspace all
9
+
6
10
  ## [1.1.6] - 2022-02-21
7
11
  - [#213](https://github.com/boltops-tools/terraspace/pull/213) ability to show layers for debugging
8
12
 
@@ -68,7 +68,8 @@ module Terraspace::All
68
68
  end
69
69
 
70
70
  def build_stack(name)
71
- builder = Terraspace::Builder.new(@options.merge(mod: name, clean: false, quiet: true, include_stacks: :root_only))
71
+ include_stacks = @command == "down" ? :root_with_children : :root_only
72
+ builder = Terraspace::Builder.new(@options.merge(mod: name, clean: false, quiet: true, include_stacks: include_stacks))
72
73
  builder.build(modules: false)
73
74
  end
74
75
 
@@ -8,19 +8,18 @@ class Terraspace::Builder
8
8
  end
9
9
 
10
10
  def build
11
- dependencies = Terraspace::Dependency::Registry.data
12
11
  # Find out if current deploy stack contains dependency
13
- found = dependencies.find do |parent_child|
12
+ dependencies = Terraspace::Dependency::Registry.data
13
+ root = dependencies.find do |parent_child|
14
14
  parent, _ = parent_child.split(':')
15
15
  parent == @mod.name
16
16
  end
17
- return unless found
17
+ return unless root
18
18
 
19
- # Go down graph children, which are the dependencies to build a queue
20
- parent, _ = found.split(':')
21
- node = Terraspace::Dependency::Node.find_by(name: parent)
19
+ # Go down dependency graph to build a queue for processing
20
+ name, _ = root.split(':')
21
+ node = Terraspace::Dependency::Node.find_by(name: name)
22
22
  build_queue(node)
23
-
24
23
  logger.debug "Terraspace::Builder::Children @queue #{@queue}"
25
24
 
26
25
  # Process queue in reverse order to build leaf nodes first
@@ -6,9 +6,15 @@ module Terraspace
6
6
 
7
7
  # @include_stacks can be 3 values: root_with_children, none, root_only
8
8
  #
9
+ # terraspace all:
10
+ #
9
11
  # none: dont build any stacks at all. used by `terraspace all up`
10
12
  # root_only: only build root stack. used by `terraspace all up`
11
- # root_with_children: build all parent stacks as well as the root stack. normal `terraspace up`
13
+ # root_with_children: build all children stacks as well as the root stack. normal `terraspace all down`
14
+ #
15
+ # terraspace up:
16
+ #
17
+ # root_with_children: build all children stacks as well as the root stack. normal `terraspace up`
12
18
  #
13
19
  def initialize(options={})
14
20
  super
@@ -1,3 +1,3 @@
1
1
  module Terraspace
2
- VERSION = "1.1.6"
2
+ VERSION = "1.1.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: terraspace
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.6
4
+ version: 1.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-02-21 00:00:00.000000000 Z
11
+ date: 2022-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -341,6 +341,10 @@ extensions: []
341
341
  extra_rdoc_files: []
342
342
  files:
343
343
  - ".cody/README.md"
344
+ - ".cody/all/bin/build.sh"
345
+ - ".cody/all/buildspec.yml"
346
+ - ".cody/all/project.rb"
347
+ - ".cody/all/role.rb"
344
348
  - ".cody/aws/bin/build.sh"
345
349
  - ".cody/aws/buildspec.yml"
346
350
  - ".cody/aws/project.rb"