terrenv 0.0.4 → 0.0.6

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
  SHA1:
3
- metadata.gz: f17c1eb46a64dfbf9157d895ce162181e841307b
4
- data.tar.gz: d971c672544aaa3db862c9c54a08e2d988664d31
3
+ metadata.gz: e4df9b10d918baf62a9d26fec012ad432eeb5af6
4
+ data.tar.gz: 1bffaaddefcdce46b54766ec812571b89fb7ae3a
5
5
  SHA512:
6
- metadata.gz: b0f0bb004ab865141badc55d390ebd05f7ecfb14cdc50f2b5d602621e9c05c35f1e320beb787efa9e5ff329e3903c469c23cc087fb75ad513f2b3dce692941e4
7
- data.tar.gz: 68802e630f08cb8312adf2b3ba4438cee31546ed67db0edbc5d85ede438ec63a802d0420764bf7249308010d4113d15ecabaf48490cc17d3630adc2417c8c4ae
6
+ metadata.gz: 02a0d56bd141f04c563f092510837f98689683bc80692c66bf463f0fd9b4bb7d70e946a58dd80ab2391cd5df0ebde34a3b132d33bd42eba108d8a827e09f45a7
7
+ data.tar.gz: 9f9eb728b0702148066dd6ec3e1bc38ab8f47c7063454480f07500a716c3f0e29b25f0a29bbcb4708a1225ce400864207ce1c836ebd0d51c10f1afeb52868a8c
data/.gitignore CHANGED
@@ -4,3 +4,4 @@ vendor
4
4
  /Gemfile.lock
5
5
  /spec/reports/
6
6
  /tmp/
7
+ *.gem
data/README.md CHANGED
@@ -1,28 +1,48 @@
1
1
  # Terrenv
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/terrenv`. To experiment with that code, run `bin/console` for an interactive prompt.
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
- TODO: Delete this and the text above, and describe your gem
7
+ Terrenv is a simple tool that lets you switch environments seemlessly.
6
8
 
7
9
  ## Installation
8
10
 
9
- Add this line to your application's Gemfile:
11
+ Install it with:
10
12
 
11
- ```ruby
12
- gem 'terrenv'
13
- ```
13
+ $ gem install terrenv
14
14
 
15
- And then execute:
15
+ ## Usage
16
16
 
17
- $ bundle
17
+ Run
18
18
 
19
- Or install it yourself as:
19
+ $ terrenv init
20
20
 
21
- $ gem install terrenv
21
+ and follow the instructions to generate a TerraformFile
22
22
 
23
- ## Usage
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
- TODO: Write usage instructions here
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/[USERNAME]/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.
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
@@ -15,7 +15,12 @@ module Terrenv
15
15
  desc "apply", "Applies configuration from TerraformFile"
16
16
  def apply
17
17
  puts 'Creating environments'
18
- settings = YAML.load(File.read('TerraformFile'))
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)
@@ -1,3 +1,3 @@
1
1
  module Terrenv
2
- VERSION = '0.0.4'
2
+ VERSION = '0.0.6'
3
3
  end
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
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-06-28 00:00:00.000000000 Z
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.6.4
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