ruby-terraform 0.22.0 → 0.23.0.pre.pre.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +18 -0
- data/lib/ruby_terraform/commands/workspace.rb +21 -0
- data/lib/ruby_terraform/commands.rb +1 -0
- data/lib/ruby_terraform/version.rb +1 -1
- data/lib/ruby_terraform.rb +4 -0
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ab2a3343990bfdf0092451fc18070295d18c1e54202a17e2e3c2fbcfd2280ef
|
4
|
+
data.tar.gz: 0ef36155929128298489b15a0df71592e0ab208b319bc18ced6a9823d95ebfa0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63e004f756910b354b3c04c22bfcaa59918b282318839d8bf8662e957131925c8c6b5d6e24245eada9c5b228371ca61160e4684fd5d1a3796b3e0af919a69359
|
7
|
+
data.tar.gz: ed9db5b688020427984dc559b21bfa4905fc4bb43cf2f5f35025369b7794a774ae057af85235007ad07f4bd81b7dfcb59b0bc1c4a8229e851d4702cc625f6642
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -46,6 +46,7 @@ Currently, there is partial support for the following commands:
|
|
46
46
|
* `RubyTerraform::Commands::Destroy`: executes `terraform destroy`
|
47
47
|
* `RubyTerraform::Commands::Output`: executes `terraform output`
|
48
48
|
* `RubyTerraform::Commands::RemoteConfig`: executes `terraform remote config`
|
49
|
+
* `RubyTerraform::Commands::Workspace`: executes `terraform workspace`
|
49
50
|
|
50
51
|
### RubyTerraform::Commands::Clean
|
51
52
|
|
@@ -264,6 +265,23 @@ arguments:
|
|
264
265
|
* `no_color`: whether or not the output from the command should be in color;
|
265
266
|
defaults to `false`.
|
266
267
|
|
268
|
+
### RubyTerraform::Commands::Workspace
|
269
|
+
|
270
|
+
The `workspace` command configures [Terraform Workspaces](https://www.terraform.io/docs/state/workspaces.html#using-workspaces). It can be used as follows:
|
271
|
+
|
272
|
+
```ruby
|
273
|
+
RubyTerraform.workspace(operation: 'list') # terraform workspace list
|
274
|
+
RubyTerraform.workspace(operation: 'new', workspace: 'staging') # terraform workspace new staging
|
275
|
+
RubyTerraform.workspace(operation: 'select', workspace: 'staging') # terraform workspace select staging
|
276
|
+
RubyTerraform.workspace(operation: 'list') # terraform workspace list
|
277
|
+
RubyTerraform.workspace(operation: 'select', workspace: 'default') # terraform workspace select default
|
278
|
+
RubyTerraform.workspace(operation: 'delete', workspace: 'staging') # terraform workspace delete staging
|
279
|
+
```
|
280
|
+
|
281
|
+
The workspace command supports the following options passed as keyword arguments:
|
282
|
+
* `directory`: the directory containing terraform configuration, the default is the current path.
|
283
|
+
* `operation`: `list`, `select`, `new` or `delete`. default `list`.
|
284
|
+
* `workspace`: Workspace name.
|
267
285
|
|
268
286
|
## Development
|
269
287
|
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'lino'
|
2
|
+
require_relative 'base'
|
3
|
+
|
4
|
+
module RubyTerraform
|
5
|
+
module Commands
|
6
|
+
class Workspace < Base
|
7
|
+
def configure_command(builder, opts)
|
8
|
+
directory = opts[:directory] || nil
|
9
|
+
operation = opts[:operation] || 'list'
|
10
|
+
workspace = opts[:workspace] || nil
|
11
|
+
|
12
|
+
builder = builder
|
13
|
+
.with_subcommand('workspace')
|
14
|
+
.with_subcommand(operation)
|
15
|
+
|
16
|
+
builder = builder.with_subcommand(workspace) if workspace && operation != 'list'
|
17
|
+
builder = builder.with_argument(directory)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
data/lib/ruby_terraform.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-terraform
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.23.0.pre.pre.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Toby Clemson
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-05-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lino
|
@@ -130,6 +130,7 @@ files:
|
|
130
130
|
- lib/ruby_terraform/commands/remote_config.rb
|
131
131
|
- lib/ruby_terraform/commands/show.rb
|
132
132
|
- lib/ruby_terraform/commands/validate.rb
|
133
|
+
- lib/ruby_terraform/commands/workspace.rb
|
133
134
|
- lib/ruby_terraform/version.rb
|
134
135
|
- ruby_terraform.gemspec
|
135
136
|
- scripts/ci/common/configure-git.sh
|
@@ -154,9 +155,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
154
155
|
version: '0'
|
155
156
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
156
157
|
requirements:
|
157
|
-
- - "
|
158
|
+
- - ">"
|
158
159
|
- !ruby/object:Gem::Version
|
159
|
-
version:
|
160
|
+
version: 1.3.1
|
160
161
|
requirements: []
|
161
162
|
rubyforge_project:
|
162
163
|
rubygems_version: 2.7.7
|