terrenv 0.0.4 → 0.0.6
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 +4 -4
- data/.gitignore +1 -0
- data/README.md +37 -13
- data/lib/terrenv/cli.rb +6 -1
- data/lib/terrenv/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e4df9b10d918baf62a9d26fec012ad432eeb5af6
|
4
|
+
data.tar.gz: 1bffaaddefcdce46b54766ec812571b89fb7ae3a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 02a0d56bd141f04c563f092510837f98689683bc80692c66bf463f0fd9b4bb7d70e946a58dd80ab2391cd5df0ebde34a3b132d33bd42eba108d8a827e09f45a7
|
7
|
+
data.tar.gz: 9f9eb728b0702148066dd6ec3e1bc38ab8f47c7063454480f07500a716c3f0e29b25f0a29bbcb4708a1225ce400864207ce1c836ebd0d51c10f1afeb52868a8c
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -1,28 +1,48 @@
|
|
1
1
|
# Terrenv
|
2
2
|
|
3
|
-
|
3
|
+
Terraform has an assumption that your infrastructure would only be deployed
|
4
|
+
once. But what if you wanted a staging or testing environment? You would have
|
5
|
+
to manage state files and variable files yourself in different directories.
|
4
6
|
|
5
|
-
|
7
|
+
Terrenv is a simple tool that lets you switch environments seemlessly.
|
6
8
|
|
7
9
|
## Installation
|
8
10
|
|
9
|
-
|
11
|
+
Install it with:
|
10
12
|
|
11
|
-
|
12
|
-
gem 'terrenv'
|
13
|
-
```
|
13
|
+
$ gem install terrenv
|
14
14
|
|
15
|
-
|
15
|
+
## Usage
|
16
16
|
|
17
|
-
|
17
|
+
Run
|
18
18
|
|
19
|
-
|
19
|
+
$ terrenv init
|
20
20
|
|
21
|
-
|
21
|
+
and follow the instructions to generate a TerraformFile
|
22
22
|
|
23
|
-
##
|
23
|
+
## Commands
|
24
|
+
```
|
25
|
+
$ terrenv init
|
26
|
+
```
|
27
|
+
will ask you some questions to setup your TerraformFile. You will need to run
|
28
|
+
`terrenv apply` inorder to apply the settings.
|
24
29
|
|
25
|
-
|
30
|
+
```
|
31
|
+
$ terrenv apply
|
32
|
+
```
|
33
|
+
|
34
|
+
will take the configuration in the TerraformFile does a few steps for setup
|
35
|
+
|
36
|
+
1. Create directories for each environment labeled `terraform-<environment>`.
|
37
|
+
2. Setup your remote state-file configurations and pull down the state files from
|
38
|
+
the S3 bucket and placed inside `terraform-<environment>`
|
39
|
+
3. Sets up your environment to the last environment specified on the TerraformFile
|
40
|
+
|
41
|
+
```
|
42
|
+
$ terrenv use <environment>
|
43
|
+
```
|
44
|
+
|
45
|
+
will switch the symlinks to point to the environment specified.
|
26
46
|
|
27
47
|
## Development
|
28
48
|
|
@@ -32,10 +52,14 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
32
52
|
|
33
53
|
## Contributing
|
34
54
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
55
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/kkwoker/terrenv. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
36
56
|
|
37
57
|
|
38
58
|
## License
|
39
59
|
|
40
60
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
41
61
|
|
62
|
+
|
63
|
+
## TODO:
|
64
|
+
|
65
|
+
Fix tests by using mocks
|
data/lib/terrenv/cli.rb
CHANGED
@@ -15,7 +15,12 @@ module Terrenv
|
|
15
15
|
desc "apply", "Applies configuration from TerraformFile"
|
16
16
|
def apply
|
17
17
|
puts 'Creating environments'
|
18
|
-
|
18
|
+
begin
|
19
|
+
settings = YAML.load(File.read('TerraformFile'))
|
20
|
+
rescue
|
21
|
+
puts "Couldn't find TerraformFile, did you initialize it?"
|
22
|
+
exit 1
|
23
|
+
end
|
19
24
|
# TODO Delete environments not specified
|
20
25
|
settings['environments'].each do |env|
|
21
26
|
create(env)
|
data/lib/terrenv/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: terrenv
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kinnan Kwok
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -124,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
124
124
|
version: '0'
|
125
125
|
requirements: []
|
126
126
|
rubyforge_project:
|
127
|
-
rubygems_version: 2.
|
127
|
+
rubygems_version: 2.5.1
|
128
128
|
signing_key:
|
129
129
|
specification_version: 4
|
130
130
|
summary: Terrenv allows you to host separate environments of your terraform infrastructure
|