terraspace 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bb1f738f3830420427da3a1ac7ba6b2bcf946da8cce8348d28ba67f7eb692cf3
4
- data.tar.gz: c88c1ce153617f68acc92d89b8fc1d82e193fa2271d701b658737069511a0c2c
3
+ metadata.gz: bfffe08e9ea588c9c01b6e6bfb0c3399047391acf17eac9d74c8d4643ba4722b
4
+ data.tar.gz: f887084702cab528ef80c786bbacf5ce5e7e7f56938b96bce2cc4c85da8d0549
5
5
  SHA512:
6
- metadata.gz: '097c4a70ac24ecfdf0e6a87b844688adf82bc6f41699a903877af054136a00bf9614ace775cb2c431dbbafc92b981218ece247e691b4db079191b080133032eb'
7
- data.tar.gz: fb0e6162ebb0f48f3e46f441163d94cf93e0186a6a32917071f9cbf5b1f27cec679ac582c39f35a9e61000373ba1bbd074797d7fdf941a2887b6d36463dc2e5d
6
+ metadata.gz: fe9ec67940c66eaf3f091b2e9dc7eaec2252ad8e1b134c11faaf4fc03befdb840c2e5222cf6204d879d6b5f0221f506457245910c236785c0caee8c58528352d
7
+ data.tar.gz: 725d3091bad4ea62ccb7e9fbb49dcb124c235e5ec810278b301fa859ba3c9721f8b616528cb777dd5e17a233b66bc6804ecef605b922364e8634b3e16a4204c9
@@ -3,6 +3,9 @@
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
+ ## [0.2.3]
7
+ * #37 config.clean_cache option
8
+
6
9
  ## [0.2.2]
7
10
  * #36 cloud.relative_root setting
8
11
 
data/README.md CHANGED
@@ -1,3 +1,7 @@
1
+ <div align="center">
2
+ <a href="https://terraspace.cloud"><img src="https://img.boltops.com/boltops/logos/terraspace-dark-v2.png" /></a>
3
+ </div>
4
+
1
5
  # Terraspace
2
6
 
3
7
  [![Gem Version](https://badge.fury.io/rb/terraspace.png)](http://badge.fury.io/rb/terraspace)
@@ -8,6 +12,10 @@ The Terraform Framework.
8
12
 
9
13
  Official Docs Site: [terraspace.cloud](https://terraspace.cloud)
10
14
 
15
+ Introduction Video:
16
+
17
+ [![Watch the video](https://img.boltops.com/boltops/tools/terraspace/terraspace-youtube.png)](https://www.youtube.com/watch?v=O87t5q22YNc)
18
+
11
19
  ## Quick Start
12
20
 
13
21
  Here are commands to get started:
@@ -17,8 +25,8 @@ Here are commands to get started:
17
25
  terraspace up demo
18
26
  terraspace down demo
19
27
 
20
- * The `new` command generates a starter project.
21
- * The `up` command creates an s3 bucket.
28
+ * The `new` command generates a starter project.
29
+ * The `up` command creates an s3 bucket.
22
30
  * The `down` command cleans up and deletes the bucket.
23
31
 
24
32
  The default plugin is aws. Other plugins also supported are: google and azurerm.
@@ -28,10 +36,10 @@ The default plugin is aws. Other plugins also supported are: google and azurerm.
28
36
  Create infrastructure:
29
37
 
30
38
  $ terraspace up demo -y
31
- Building .terraspace-cache/dev/stacks/demo
32
- Current directory: .terraspace-cache/dev/stacks/demo
33
- => terraform init -get > /dev/null
34
- Built in .terraspace-cache/dev/stacks/demo
39
+ Building .terraspace-cache/us-west-2/dev/stacks/demo
40
+ Current directory: .terraspace-cache/us-west-2/dev/stacks/demo
41
+ => terraform init -get > /tmp/terraspace/out/terraform-init20200824-21379-bkfvnh.out
42
+ Built in .terraspace-cache/us-west-2/dev/stacks/demo
35
43
  => terraform apply -auto-approve
36
44
  random_pet.bucket: Creating...
37
45
  random_pet.bucket: Creation complete after 0s [id=amusing-mouse]
@@ -48,10 +56,10 @@ Create infrastructure:
48
56
  Destroy infrastructure:
49
57
 
50
58
  $ terraspace down demo -y
51
- Building .terraspace-cache/dev/stacks/demo
52
- Current directory: .terraspace-cache/dev/stacks/demo
53
- => terraform init -get > /dev/null
54
- Built in .terraspace-cache/dev/stacks/demo
59
+ Building .terraspace-cache/us-west-2/dev/stacks/demo
60
+ Current directory: .terraspace-cache/us-west-2/dev/stacks/demo
61
+ => terraform init -get > /tmp/terraspace/out/terraform-init20200824-21379-bkfvnh.out
62
+ Built in .terraspace-cache/us-west-2/dev/stacks/demo
55
63
  => terraform destroy -auto-approve
56
64
  random_pet.bucket: Refreshing state... [id=amusing-mouse]
57
65
  module.bucket.aws_s3_bucket.this: Refreshing state... [id=bucket-amusing-mouse]
@@ -67,9 +75,9 @@ Destroy infrastructure:
67
75
 
68
76
  * [Config Structure](https://terraspace.cloud/docs/config/): A common config structure that gets materializes with the deployed module. Configs can be dynamically controlled to keep your code DRY. You can override the settings if needed, like for using existing backends. See: [Existing Backends](https://terraspace.cloud/docs/state/existing/).
69
77
  * [Generators](https://terraspace.cloud/docs/generators/): Built-in generators to quickly create the starter module. Focus on code instead of boilerplate structure.
70
- * [Tfvars](https://terraspace.cloud/docs/tfvars/): Use the same code with different tfvars to create multiple environments. Terraspace conventionally loads tfvars from the `tfvars` folder.
71
- * [Layering](https://terraspace.cloud/docs/tfvars/layering/): Rich layering support. This allows you to build different environments like dev and prod with the same code.
78
+ * [Tfvars](https://terraspace.cloud/docs/tfvars/) & [Layering](https://terraspace.cloud/docs/tfvars/layering/): Use the same code with different tfvars to create multiple environments. Terraspace conventionally loads tfvars from the `tfvars` folder. Rich layering support allows you to build different environments like dev and prod with the same code. Examples are in [Full Layering](https://terraspace.cloud/docs/tfvars/full-layering/).
72
79
  * [Testing](https://terraspace.cloud/docs/testing/): A testing framework that allows you to create test harnesses, deploy real-resources, and have higher confidence that your code works.
73
80
  * [Configurable CLI](https://terraspace.cloud/docs/cli/): Configurable [CLI Hooks](https://terraspace.cloud/docs/cli/hooks/) and [CLI Args](https://terraspace.cloud/docs/cli/args/) allow you to adjust the underlying terraform command.
81
+ * [Terraform Cloud and Terraform Enterprise Support](https://terraspace.cloud/docs/cloud/): TFC and TFE are both supported. Terraspace adds additional conveniences to make working with Terraform Cloud Workspaces easier.
74
82
 
75
83
  For more info: [terraspace.cloud](https://terraspace.cloud)
@@ -21,6 +21,7 @@ module Terraspace
21
21
  config.build = ActiveSupport::OrderedOptions.new
22
22
  config.build.cache_root = nil # defaults to /full/path/to/.terraspace-cache
23
23
  config.build.cache_dir = ":CACHE_ROOT/:REGION/:ENV/:BUILD_DIR"
24
+ config.build.clean_cache = nil # defaults to /full/path/to/.terraspace-cache
24
25
  config
25
26
  end
26
27
 
@@ -3,7 +3,7 @@ module Terraspace
3
3
  def run
4
4
  Terraspace::CLI::CheckSetup.check!
5
5
  @mod.root_module = true
6
- Compiler::Cleaner.new(@mod, @options).clean
6
+ Compiler::Cleaner.new(@mod, @options).clean if clean?
7
7
  build_dir = Util.pretty_path(@mod.cache_dir)
8
8
  logger.info "Building #{build_dir}"
9
9
 
@@ -39,5 +39,10 @@ module Terraspace
39
39
  def dirs(path)
40
40
  Dir.glob("#{Terraspace.root}/#{path}")
41
41
  end
42
+
43
+ def clean?
44
+ clean_cache = Terraspace.config.build.clean_cache
45
+ clean_cache.nil? ? true : clean_cache
46
+ end
42
47
  end
43
48
  end
@@ -8,14 +8,14 @@ class Terraspace::CLI
8
8
  Workspace.new(options).list
9
9
  end
10
10
 
11
- desc "destroy", "Destroy workspace"
11
+ desc "destroy STACK", "Destroy workspace"
12
12
  long_desc Help.text("cloud:destroy")
13
13
  option :yes, aliases: :y, type: :boolean, desc: "bypass are you sure prompt"
14
14
  def destroy(mod)
15
15
  Workspace.new(options.merge(mod: mod)).destroy
16
16
  end
17
17
 
18
- desc "setup", "Setup workspace"
18
+ desc "setup STACK", "Setup workspace"
19
19
  long_desc Help.text("cloud:setup")
20
20
  def setup(mod)
21
21
  Workspace.new(options.merge(mod: mod)).setup
@@ -1,3 +1,3 @@
1
1
  module Terraspace
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
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: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-08-22 00:00:00.000000000 Z
11
+ date: 2020-09-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport