roro 0.2.2 → 0.2.4

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: 542ed0fa8900bd48c2a6e083bc03bfc04ea2790a9450931d4ac758f34dc6b207
4
- data.tar.gz: 2ccbeffc388e66f8cd16e6d1a126700ead483e8fb0bc55165447728deb690977
3
+ metadata.gz: 639ba3036903d8a486608ec5b07f79bf4330e05823b21d7eab7f9f3fde803c62
4
+ data.tar.gz: 06bb7ab5697e76eba09a77586b21eb213352df9fd971662ee893c211ed364ae1
5
5
  SHA512:
6
- metadata.gz: 7c84d257097d23ca51b699aedd4bccae407c3e7616498db693e65e68c8159931dadc9c9ffbcc03ef5338e0996a7a3a1c7624c98bfe0bf0f744436512a8435b18
7
- data.tar.gz: fb68201335f823da29658242942057aaf32e736d12d25ea32eba66d6f1c1f47ca97679e7c9b7d6c623251f46b80429f7fb15701d2051e40aa19af7f6b4ec8400
6
+ metadata.gz: 72b53d0e0cd9cf98914a9dc00921106fbfd68b2ab5452608722a3ee090bc384e74b8e275f5034480fa9f99667fac10912ae4e6c6a2004be28bcf317ddd5f5809
7
+ data.tar.gz: 7afa2da9a34364e493457d239ddff73b9791ad519993237fcc779140d90f21d6edd31c91de6878af66896df6a8907bf160bc8104d082ab4e937558c7bdb014ae
data/Gemfile.lock CHANGED
@@ -1,11 +1,11 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- roro (0.2.0)
4
+ roro (0.2.3)
5
5
  handsome_fencer-crypto (= 0.1.6)
6
- os
7
- sshkit
8
- thor
6
+ os (= 1.0.0)
7
+ sshkit (= 1.18.2)
8
+ thor (= 0.20.3)
9
9
 
10
10
  GEM
11
11
  remote: https://rubygems.org/
@@ -156,8 +156,8 @@ PLATFORMS
156
156
  ruby
157
157
 
158
158
  DEPENDENCIES
159
- bundler (~> 1.17)
160
- handsome_fencer-test
159
+ bundler
160
+ handsome_fencer-test (= 0.1.1)
161
161
  rake (~> 10.0)
162
162
  roro!
163
163
 
data/README.md CHANGED
@@ -1,43 +1,143 @@
1
1
  # Roro
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/roro`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
3
+ Roro gives developers a handsome way to create, test, integrate, and deploy Ruby on Rails applications using Guard, CircleCI, Docker, Docker Compose.
6
4
 
7
5
  ## Installation
8
6
 
9
- Add this line to your application's Gemfile:
7
+ ```bash
8
+ $ gem install roro
9
+ ```
10
+
11
+ ## Usage
10
12
 
11
- ```ruby
12
- gem 'roro'
13
+ Once installed, Roro provides a CLI:
14
+
15
+ ```bash
16
+ $ roro --help
17
+ Commands:
18
+ roro expose # Expose encrypted files
19
+ roro generate_key # Generate a key for each environment
20
+ roro generate_keys # Generates keys for all environments. If you have .en...
21
+ roro greenfield # Greenfield a brand new rails app using Docker's inst...
22
+ roro help [COMMAND] # Describe available commands or one specific command
23
+ roro obfuscate # obfuscates any files matching the pattern ./docker/*...
24
+ roro rollon # Generates files necessary to greenfield a new app wi...
25
+ roro ruby_gem # Generate files for containerized gem testing, Circle...
13
26
  ```
14
27
 
15
- And then execute:
28
+ ## Installing Docker and Docker Compose
16
29
 
17
- $ bundle
30
+ Before using Roro's 'greenfield' and 'rollon' commands, you'll need Docker and Docker Compose. To see if Docker is installed:
18
31
 
19
- Or install it yourself as:
32
+ ```bash
33
+ $ docker -v
34
+ Docker version 18.03.1-ce, build 9ee9f40
35
+ ```
20
36
 
21
- $ gem install roro
37
+ Instructions for installing [Docker](https://docs.docker.com/install/). To see if Docker Compose is installed:
22
38
 
23
- ## Usage
39
+ ```bash
40
+ $ docker-compose -v
41
+ docker-compose version 1.21.0, build 5920eb0
42
+ ```
43
+
44
+ Instructions for installing [Docker Compose](https://docs.docker.com/compose/install/).
45
+
46
+ ## Greenfielding a dockerized app:
47
+
48
+ ```bash
49
+ $ mkdir -p handsome_app
50
+ $ cd handsome_app
51
+ $ roro greenfield
52
+ $ docker-compose up
53
+ ```
54
+
55
+ You should now be able to see the Rails welcome screen upon clicking [http://localhost:3000/](http://localhost:3000/).
24
56
 
25
- TODO: Write usage instructions here
57
+ If you're on a linux machine and run into issues, please see the
58
+ [linux notes](#linux-notes).
26
59
 
27
- ## Development
28
60
 
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
61
+ ### Rolling onto an existing app:
62
+
63
+ Using your own app or one generated using the 'greenfield' instructions above:
64
+
65
+ ```bash
66
+ $ docker-compose down
67
+ $ roro rollon
68
+ $ docker-compose up
69
+ ```
70
+
71
+ You should now be able to see the Rails welcome screen upon clicking [http://localhost:3000/](http://localhost:3000/).
72
+
73
+ ## Securing environment files
74
+
75
+ Roro gives provides conventions for securing your environment files. To store a variable for use in your development environment, create a file with that variable, name it "development.env," and store it in docker/env_files like so:
76
+
77
+ ```bash
78
+ $ echo "export export EXplace to put environment files for use in dockerized environments. AMPLE_KEY=example_value" > docker/env_files/development.env
79
+ $ roro generate_key development
80
+ $ roro obfuscate development
81
+ ```
82
+
83
+ You should now see an environment file and its encrypted counterpart in docker/env_files:
84
+
85
+ ```bash
86
+ $ ls docker/env_files
87
+ development.env development.env.enc
88
+ ```
30
89
 
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
90
+ To expose a previously obfuscated file:
91
+
92
+ ```bash
93
+ $ mv docker/env_files/development.env docker/env_files/backup.env
94
+ $ roro expose development
95
+ ```
96
+
97
+ To verify the newly decrypted file contents match its backup:
98
+
99
+ ```bash
100
+ $ diff docker/env_files/development.env docker/env_files/backup.env
101
+ ```
102
+
103
+ ## Linux notes
104
+
105
+ If you're on a linux machine, you may need to change ownership of the newly created files:
106
+
107
+ ```bash
108
+ $ sudo chown <username><user group> -R .
109
+ ```
110
+
111
+ If that doesn't work, Docker's [documentation](https://docs.docker.com/install/linux/linux-postinstall/#manage-docker-as-a-non-root-user) should get you pointed in the right direction.
112
+
113
+ ## Troubleshooting
114
+
115
+ Sometimes the port is in use. This could be because you have a server running on your host machine, or because Docker is running a server and piping it to the host. To shut down a server running in Docker, do:
116
+
117
+ ```
118
+ $ docker-compose down
119
+ ```
120
+
121
+ Sometimes shutting down all servers doesn't work, because Rails still thinks a server is already running, which is usuall because there's a .pid file somewhere.
122
+
123
+ $ rm /tmp/pids/server.pid
124
+
125
+ Sometimes you just need a fresh start. To remove all images, containers, and volumes from your system:
126
+
127
+ $ docker system prune -af --volumes
32
128
 
33
129
  ## Contributing
34
130
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/roro. 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.
131
+ This gem and the associated practices are just a way of deploying your application, not the canonical or best way. If you have suggestions on how to make it easier, more secure, quicker or better, please share them. If you have specific ideas, please fork the repo, make your changes, write your tests, and send me a pull request.
36
132
 
37
133
  ## License
38
-
39
134
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
40
135
 
41
- ## Code of Conduct
42
136
 
43
- Everyone interacting in the Roro project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/roro/blob/master/CODE_OF_CONDUCT.md).
137
+ should get you pointed in the right direction. , you may need to prepend 'sudo' to the above command, or chown newly created files:
138
+
139
+ ```bash
140
+ $ sudo chown <username><user group> -R .
141
+ ```
142
+
143
+ If that doesn't work, Docker's [documentation](https://docs.docker.com/install/linux/linux-postinstall/#manage-docker-as-a-non-root-user) should get you pointed in the right direction.
data/_config.yml ADDED
@@ -0,0 +1 @@
1
+ theme: jekyll-theme-dinky
data/lib/roro/cli/base.rb CHANGED
@@ -14,12 +14,11 @@ module Roro
14
14
  end
15
15
 
16
16
  def own_if_required
17
- # case
18
- # when ENV['CIRCLECI']
19
- # return
20
- # when OS.linux?
21
- system 'sudo chown -R $USER .'
22
- # end
17
+ system 'sudo chown -R $USER .'
18
+ end
19
+
20
+ def comment_out_ruby_in_gemfile
21
+
23
22
  end
24
23
 
25
24
 
@@ -109,10 +108,6 @@ module Roro
109
108
 
110
109
  def copy_ruby_gem_files
111
110
  copy_file 'ruby_gem/config.yml', '.circleci/config.yml'
112
- # copy_file 'greenfield/Gemfile.lock', 'Gemfile.lock'
113
- # copy_file 'greenfield/docker-compose.yml', 'docker-compose.yml'
114
- # copy_file 'greenfield/Dockerfile', 'Dockerfile'
115
- # copy_file 'greenfield/config/database.yml.example', 'config/database.yml.example'
116
111
  end
117
112
  end
118
113
 
data/lib/roro/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Roro
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.4"
3
3
  end
data/roro.gemspec CHANGED
@@ -37,9 +37,9 @@ Gem::Specification.new do |spec|
37
37
  # spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
38
38
  spec.require_paths = ["lib"]
39
39
 
40
- spec.add_dependency "thor"
41
- spec.add_dependency "os"
42
- spec.add_dependency "sshkit"
40
+ spec.add_dependency "thor", "0.20.3"
41
+ spec.add_dependency "os", "1.0.0"
42
+ spec.add_dependency "sshkit", "1.18.2"
43
43
  spec.add_dependency "handsome_fencer-crypto", "0.1.6"
44
44
  spec.add_development_dependency "bundler"
45
45
  spec.add_development_dependency "rake", "~> 10.0"
metadata CHANGED
@@ -1,57 +1,57 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roro
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - schadenfred
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-15 00:00:00.000000000 Z
11
+ date: 2019-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: 0.20.3
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: 0.20.3
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: os
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: 1.0.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: 1.0.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: sshkit
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: 1.18.2
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: 1.18.2
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: handsome_fencer-crypto
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -131,6 +131,7 @@ files:
131
131
  - LICENSE.txt
132
132
  - README.md
133
133
  - Rakefile
134
+ - _config.yml
134
135
  - bin/console
135
136
  - bin/roro
136
137
  - bin/setup
@@ -144,7 +145,6 @@ files:
144
145
  - lib/roro.rb
145
146
  - lib/roro/cli.rb
146
147
  - lib/roro/cli/base.rb
147
- - lib/roro/cli/dockerize.rb
148
148
  - lib/roro/cli/expose.rb
149
149
  - lib/roro/cli/generate_keys.rb
150
150
  - lib/roro/cli/greenfield.rb
@@ -1,30 +0,0 @@
1
- # module Roro
2
- #
3
- # class CLI < Thor
4
- #
5
- # desc "dockerize", "Generates files necessary to dockerize your existing Rails project, along with a set of files for continuous deployment using CircleCI and deployment ussing sshkit."
6
- #
7
- # def dockerize
8
- # configurate
9
- # copy_base_files
10
- # append_to_existing_files
11
- # end
12
- #
13
- # desc "greenfield", "Generates files necessary to greenfield a new app within a dockerized rails container, along with a set of files necessary for continuous deployment using CircleCI"
14
- # method_option :interactive, desc: "Set up your environment variables as you go."
15
- # method_option :env_vars, type: :hash, default: {}, desc: "Pass a list of environment variables like so: env:var", banner: "key1:value1 key2:value2"
16
- #
17
- # def greenfield(app=nil)
18
- # configurate
19
- # self.destination_root = self.destination_root + "/#{app}" unless app.nil?
20
- # if app.nil? && !Dir.empty?('.')
21
- # raise Roro::Error.new("Oops -- Roro can't greenfield unless the current directory is empty.")
22
- # end
23
- # copy_base_files
24
- # copy_file "gitignore", ".gitignore"
25
- # copy_file "Gemfile"
26
- # copy_file "Gemfile.lock"
27
- # append_to_existing_files
28
- # end
29
- # end
30
- # end