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 +4 -4
- data/Gemfile.lock +6 -6
- data/README.md +119 -19
- data/_config.yml +1 -0
- data/lib/roro/cli/base.rb +5 -10
- data/lib/roro/version.rb +1 -1
- data/roro.gemspec +3 -3
- metadata +15 -15
- data/lib/roro/cli/dockerize.rb +0 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 639ba3036903d8a486608ec5b07f79bf4330e05823b21d7eab7f9f3fde803c62
|
4
|
+
data.tar.gz: 06bb7ab5697e76eba09a77586b21eb213352df9fd971662ee893c211ed364ae1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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
|
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
|
-
|
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
|
-
|
7
|
+
```bash
|
8
|
+
$ gem install roro
|
9
|
+
```
|
10
|
+
|
11
|
+
## Usage
|
10
12
|
|
11
|
-
|
12
|
-
|
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
|
-
|
28
|
+
## Installing Docker and Docker Compose
|
16
29
|
|
17
|
-
|
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
|
-
|
32
|
+
```bash
|
33
|
+
$ docker -v
|
34
|
+
Docker version 18.03.1-ce, build 9ee9f40
|
35
|
+
```
|
20
36
|
|
21
|
-
|
37
|
+
Instructions for installing [Docker](https://docs.docker.com/install/). To see if Docker Compose is installed:
|
22
38
|
|
23
|
-
|
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
|
-
|
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
|
-
|
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
|
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
|
-
|
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
|
-
|
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
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
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
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.
|
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-
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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
|
data/lib/roro/cli/dockerize.rb
DELETED
@@ -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
|