terraspace 0.1.0 → 0.1.1

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: 070bb2bfae32308ff7f0f89386f22ed6c7db04782d0e8c112876d13ee4f68109
4
- data.tar.gz: d799fa36b32bff54f9b3771a546b6bff064248d3a7043f83927b93931ba234ad
3
+ metadata.gz: aaf22ae87af9bb9007e2a7c7a7b2b79f15c9f8303fe47257fc869219c4cb0feb
4
+ data.tar.gz: f632c63f5fed2f8b8483cdfd04ef7f50a1fe912a2595b5325c7aef7ed9ac944a
5
5
  SHA512:
6
- metadata.gz: e5a2df72ea02495f06c4a03062a97e9dc52d255d530330769af055422503a2930b259831ab956a7a16a372a64ed37487ed4dfe78b80bdda29392f1607b76374b
7
- data.tar.gz: 248a43fedde2e707743b9cc01bb8ca275d094768cc9e33cbd9ede32a47cd7ecf6c0795f36910b05ec4d46ef837170c5c94ec632b8711dd40679824f4235d07f0
6
+ metadata.gz: 0463d2d835a44d3c0a2e607f3903856e018881ebac0c96d06324e0387b3908ae7202216f0bdc71b79d2e739e7c1cdf5c600853397418ea7525f9437fce4814d6
7
+ data.tar.gz: f2017f4f70d426a3f5e4449c788301ab82e287caa35f453244c019580c8b628d4bdd8fc040e078cb8b50cd924dbe3a6b97e63821a59384787d173f751cffbee3
@@ -3,5 +3,8 @@
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.1.1]
7
+ - #32 terraspace summary --short option
8
+
6
9
  ## [0.1.0]
7
10
  - Initial release
data/README.md CHANGED
@@ -10,14 +10,16 @@ Official Docs Site: [terraspace.cloud](https://terraspace.cloud)
10
10
 
11
11
  ## Quick Start
12
12
 
13
- The commands creates s3 bucket:
13
+ Here are commands to get started:
14
14
 
15
15
  terraspace new project infra --plugin aws --examples
16
16
  cd infra
17
17
  terraspace up demo
18
18
  terraspace down demo
19
19
 
20
- The last `down` command cleans up and deletes the bucket.
20
+ * The `new` command generates a starter project.
21
+ * The `up` command creates an s3 bucket.
22
+ * The `down` command cleans up and deletes the bucket.
21
23
 
22
24
  The default plugin is aws. Other plugins also supported are: google and azurerm.
23
25
 
@@ -26,7 +28,7 @@ The default plugin is aws. Other plugins also supported are: google and azurerm.
26
28
  Create infrastructure:
27
29
 
28
30
  $ terraspace up demo -y
29
- Materializing .terraspace-cache/dev/stacks/demo
31
+ Building .terraspace-cache/dev/stacks/demo
30
32
  Current directory: .terraspace-cache/dev/stacks/demo
31
33
  => terraform init -get > /dev/null
32
34
  Built in .terraspace-cache/dev/stacks/demo
@@ -46,7 +48,7 @@ Create infrastructure:
46
48
  Destroy infrastructure:
47
49
 
48
50
  $ terraspace down demo -y
49
- Materializing .terraspace-cache/dev/stacks/demo
51
+ Building .terraspace-cache/dev/stacks/demo
50
52
  Current directory: .terraspace-cache/dev/stacks/demo
51
53
  => terraform init -get > /dev/null
52
54
  Built in .terraspace-cache/dev/stacks/demo
@@ -119,6 +119,7 @@ module Terraspace
119
119
  long_desc Help.text(:clean)
120
120
  option :mod, desc: "Module to build to generate a backend file for discovery. By default the last module is used. Usually, it wont matter."
121
121
  init_option.call
122
+ option :short, aliases: %w[s], type: :boolean, desc: "Only show statefiles"
122
123
  def summary
123
124
  Summary.new(options).run
124
125
  end
@@ -11,7 +11,7 @@ class Terraspace::CLI::New
11
11
  [:force, type: :boolean, desc: "Bypass overwrite are you sure prompt for existing files"],
12
12
  [:lang, default: "hcl", desc: "Language to use: HCL/ERB or Ruby DSL"],
13
13
  [:plugin, aliases: %w[p], default: "aws", desc: "Cloud Plugin. Supports: aws, google"],
14
- [:test, default: !!ENV['TS_NEW_TEST'], type: :boolean, desc: "Whether or not to generate tests"],
14
+ [:test, type: :boolean, desc: "Whether or not to generate tests"],
15
15
  [:plugin_gem, desc: "Use if provider gem name doesnt follow terraspace_plugin_XXX naming convention. Must specify both --plugin and --plugin-name option"],
16
16
  ]
17
17
  end
@@ -43,7 +43,7 @@ class Terraspace::CLI
43
43
 
44
44
  info = backend.values.first # structure within the s3 or gcs key
45
45
  klass = summary_class(name)
46
- summary = klass.new(info)
46
+ summary = klass.new(info, @options)
47
47
  summary.call
48
48
  end
49
49
 
@@ -3,14 +3,13 @@
3
3
  # key_field: if need to override default key
4
4
  # bucket_field: if need to override default bucket
5
5
  # download
6
- # statefile_expr: needed for azurerm
7
6
  #
8
7
  # If need more customization, then override and implement the call method.
9
8
  #
10
9
  module Terraspace::Plugin::Summary
11
10
  module Interface
12
- def initialize(info)
13
- @info = info
11
+ def initialize(info, options={})
12
+ @info, @options = info, options
14
13
  end
15
14
 
16
15
  # 1. download state files to temp area
@@ -72,11 +71,12 @@ module Terraspace::Plugin::Summary
72
71
  pretty_path = path.sub(Regexp.new(".*#{@bucket}/#{@folder}"), '')
73
72
  logger.info pretty_path.color(:green)
74
73
  resources.each do |r|
74
+ @has_shown_resources = true # flag to note some resources there were shown
75
75
  identifier = r['instances'].map do |i|
76
76
  i['attributes']['name'] || i['attributes']['id']
77
77
  end.join(',')
78
+ return if @options[:short]
78
79
  logger.info " #{r['type']} #{r['name']}: #{identifier}"
79
- @has_shown_resources = true # flag to note some resources there were shown
80
80
  end
81
81
  end
82
82
 
@@ -1,3 +1,3 @@
1
1
  module Terraspace
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
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.1.0
4
+ version: 0.1.1
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-07-24 00:00:00.000000000 Z
11
+ date: 2020-07-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport