stack_car 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -1
- data/.gitlab-ci.yml +17 -0
- data/README.md +28 -26
- data/lib/stack_car/cli.rb +4 -4
- data/lib/stack_car/version.rb +1 -1
- data/public/.gitkeep +0 -0
- data/public/logo.jpg +0 -0
- data/public/logo.pxm +0 -0
- data/stack_car.gemspec +2 -1
- data/templates/.env.erb +5 -6
- data/templates/Dockerfile.erb +1 -3
- data/templates/docker-compose.yml.erb +45 -53
- metadata +34 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 814456b5afb8f8bffaa719ca737e7e754b74e73d
|
4
|
+
data.tar.gz: 3d7f8ff357806976c305fcbde53d82f1867f7ecf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5720260df738401459e6e8831398d6262fc16bfc3346dbc53b86e80680db01a957091e9a0f2eb6bbe04ac92bfb700cb431b5ab54ba98a63140039c7c4880c173
|
7
|
+
data.tar.gz: 3ca69f9ea7a3bbd39f6366b475d7272590398b02f6f8f2ea44821f977d63d810abe849b7f63645fa1ba8c1f78be4ba8f0ba76d47556957a2363326aa424159d8
|
data/.gitignore
CHANGED
data/.gitlab-ci.yml
ADDED
data/README.md
CHANGED
@@ -1,39 +1,35 @@
|
|
1
1
|
# StackCar
|
2
2
|
|
3
|
-
|
4
|
-
Implement UP
|
5
|
-
Implement build
|
6
|
-
Fill out readme
|
7
|
-
Work on docs
|
8
|
-
Implement deploy
|
9
|
-
Implement deploy templates
|
10
|
-
Implement database dump and restore
|
11
|
-
Implement secret sync
|
12
|
-
Convox live code reload?
|
3
|
+
![logo](logo.jpg)
|
13
4
|
|
14
|
-
|
5
|
+
Stack Car is an opinionated set of tools around Docker and Rails. It provides convenent methods to start and stop docker-compose, to deploy with rancher and a set of templates to get a new Rails app in to docker as quickly as possible.
|
15
6
|
|
16
|
-
TODO: Delete this and the text above, and describe your gem
|
17
7
|
|
18
8
|
## Installation
|
19
9
|
|
20
|
-
|
10
|
+
Because stack_car will be used to run your application in side of Docker, you want to install stack car in to your system Ruby instead of putting in your applications Gemfile
|
11
|
+
u
|
21
12
|
|
22
|
-
```
|
23
|
-
gem
|
13
|
+
```bash
|
14
|
+
gem install stack_car
|
24
15
|
```
|
25
16
|
|
26
|
-
|
27
|
-
|
28
|
-
$ bundle
|
17
|
+
## Usage
|
29
18
|
|
30
|
-
Or install it yourself as:
|
31
19
|
|
32
|
-
|
20
|
+
Commands are accesible via the "sc" short cut. Note: this will need to be in your command path in front of the spreadsheet command (sc), which is a fairly archaiac unix spreadsheet tool. We're guessing you don't edit a lot of spreadsheets in your terminal, but if you do, we also figure you can override your path order pretty easily.
|
33
21
|
|
34
|
-
|
35
|
-
|
36
|
-
|
22
|
+
```ruby
|
23
|
+
Commands:
|
24
|
+
stack_car bundle_exec ARGS # wraps docker-compose exec web bundle exec unless --service is used to specify
|
25
|
+
stack_car console ARGS # shortcut to start rails console
|
26
|
+
stack_car dockerize DIR # Will copy the docker tempates in to your project, see options for supported dependencies
|
27
|
+
stack_car exec ARGS # wraps docker-compose exec web unless --service is used to specify
|
28
|
+
stack_car help [COMMAND] # Describe available commands or one specific command
|
29
|
+
stack_car stop # starts docker-compose with rebuild and orphan removal, defaults to all
|
30
|
+
stack_car up # starts docker-compose with rebuild and orphan removal, defaults to web
|
31
|
+
stack_car walk ARGS # wraps docker-compose run web unless --service is used to specify
|
32
|
+
```
|
37
33
|
|
38
34
|
## Development
|
39
35
|
|
@@ -43,8 +39,14 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
43
39
|
|
44
40
|
## Contributing
|
45
41
|
|
46
|
-
Bug reports and pull requests are welcome on
|
42
|
+
Bug reports and pull requests are welcome on Gitlab at https://gitlab.com/notch8/stack_car.
|
47
43
|
|
48
44
|
## TODO
|
49
|
-
|
50
|
-
|
45
|
+
|
46
|
+
- Implement build
|
47
|
+
- Fill out readme
|
48
|
+
- Implement deploy
|
49
|
+
- Implement deploy templates
|
50
|
+
- Implement database dump and restore
|
51
|
+
- Implement secret sync
|
52
|
+
- Specs
|
data/lib/stack_car/cli.rb
CHANGED
@@ -18,14 +18,14 @@ module StackCar
|
|
18
18
|
|
19
19
|
method_option :service, default: 'web', type: :string, aliases: '-s'
|
20
20
|
desc "walk ARGS", "wraps docker-compose run web unless --service is used to specify"
|
21
|
-
def walk(args)
|
22
|
-
run("docker-compose run #{options[:service]} #{args}")
|
21
|
+
def walk(*args)
|
22
|
+
run("docker-compose run #{options[:service]} #{args.join(' ')}")
|
23
23
|
end
|
24
24
|
|
25
25
|
method_option :service, default: 'web', type: :string, aliases: '-s'
|
26
26
|
desc "exec ARGS", "wraps docker-compose exec web unless --service is used to specify"
|
27
|
-
def exec(args)
|
28
|
-
run("docker-compose exec #{options[:service]} #{args}")
|
27
|
+
def exec(*args)
|
28
|
+
run("docker-compose exec #{options[:service]} #{args.join(' ')}")
|
29
29
|
end
|
30
30
|
map ex: :exec
|
31
31
|
|
data/lib/stack_car/version.rb
CHANGED
data/public/.gitkeep
ADDED
File without changes
|
data/public/logo.jpg
ADDED
Binary file
|
data/public/logo.pxm
ADDED
Binary file
|
data/stack_car.gemspec
CHANGED
@@ -22,6 +22,7 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.add_development_dependency "bundler", "~> 1.13"
|
23
23
|
spec.add_development_dependency "rake", "~> 10.0"
|
24
24
|
spec.add_development_dependency "rspec", "~> 3.0"
|
25
|
-
|
25
|
+
spec.add_development_dependency "yard"
|
26
|
+
spec.add_development_dependency "yard-thor"
|
26
27
|
spec.add_dependency 'thor'
|
27
28
|
end
|
data/templates/.env.erb
CHANGED
@@ -1,10 +1,9 @@
|
|
1
1
|
<% if options[:postgres] -%>
|
2
|
-
|
3
|
-
|
4
|
-
|
2
|
+
POSTGRES_DB=<%= project_name %>
|
3
|
+
POSTGRES_USER=postgres
|
4
|
+
POSTGRES_PASSWORD=DatabaseFTW
|
5
5
|
<% end -%>
|
6
|
-
|
7
6
|
<% if options[:mysql] -%>
|
8
|
-
|
9
|
-
|
7
|
+
MYSQL_DATABASE=<%= project_name %>
|
8
|
+
MYSQL_ROOT_PASSWORD=DatabaseFTW
|
10
9
|
<% end -%>
|
data/templates/Dockerfile.erb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
FROM ruby:2.3.0
|
2
2
|
|
3
|
-
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs mysql-client pv libsasl2-dev
|
3
|
+
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs postgresql-client mysql-client pv libsasl2-dev
|
4
4
|
|
5
5
|
ENV APP_HOME /app
|
6
6
|
|
@@ -13,6 +13,4 @@ ENV BUNDLE_GEMFILE=$APP_HOME/Gemfile \
|
|
13
13
|
ADD Gemfile* $APP_HOME/
|
14
14
|
RUN bundle install
|
15
15
|
|
16
|
-
RUN npm install -g bower
|
17
|
-
RUN rake bower:install
|
18
16
|
|
@@ -1,30 +1,35 @@
|
|
1
1
|
version: '2'
|
2
2
|
services:
|
3
|
-
|
3
|
+
<% if options[:postgres] -%>
|
4
4
|
postgres:
|
5
5
|
image: postgres
|
6
|
-
|
7
|
-
|
8
|
-
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}"
|
9
|
-
POSTGRES_USER: "${POSTGRES_USER}"
|
6
|
+
env_file:
|
7
|
+
- .env
|
10
8
|
ports:
|
11
9
|
- "5432"
|
12
10
|
volumes:
|
13
11
|
- 'postgres:/var/lib/postgresql/data'
|
14
|
-
|
15
|
-
|
12
|
+
<% end -%>
|
13
|
+
<% if options[:mysql] -%>
|
16
14
|
mysql:
|
17
15
|
image: mysql
|
18
|
-
|
19
|
-
|
20
|
-
MYSQL_ROOT_PASSWORD: "${MYSQL_ROOT_PASSWORD}"
|
16
|
+
env_file:
|
17
|
+
- .env
|
21
18
|
ports:
|
22
19
|
- '3306'
|
23
20
|
volumes:
|
24
21
|
- 'mysql:/var/lib/mysql'
|
25
|
-
|
26
|
-
|
27
|
-
|
22
|
+
<% end -%>
|
23
|
+
<% if options[:elasticsearchi] -%>
|
24
|
+
elasticsearch:
|
25
|
+
image: elasticsearch:1.7.1
|
26
|
+
ports:
|
27
|
+
- "9200"
|
28
|
+
- "9300"
|
29
|
+
volumes:
|
30
|
+
- 'elasticsearch:/usr/share/elasticsearch/data'
|
31
|
+
<% end -%>
|
32
|
+
<% if options[:solr] %>
|
28
33
|
solr:
|
29
34
|
image: solr:latest
|
30
35
|
ports:
|
@@ -36,19 +41,8 @@ services:
|
|
36
41
|
- solr-precreate
|
37
42
|
- mycore
|
38
43
|
# docker-compose exec --user=solr solr bin/solr create_core -c CORENAME
|
39
|
-
|
40
|
-
|
41
|
-
<% if options[:elasticsearchi] -%>
|
42
|
-
elasticsearch:
|
43
|
-
image: elasticsearch:1.7.1
|
44
|
-
ports:
|
45
|
-
- "9200"
|
46
|
-
- "9300"
|
47
|
-
volumes:
|
48
|
-
- 'elasticsearch:/usr/share/elasticsearch/data'
|
49
|
-
<% end -%>
|
50
|
-
|
51
|
-
<% if options[:redis] -%>
|
44
|
+
<% end -%>
|
45
|
+
<% if options[:redis] -%>
|
52
46
|
redis:
|
53
47
|
image: 'redis:3.2-alpine'
|
54
48
|
command: redis-server
|
@@ -56,8 +50,7 @@ services:
|
|
56
50
|
- '6379'
|
57
51
|
volumes:
|
58
52
|
- 'redis:/var/lib/redis/data'
|
59
|
-
|
60
|
-
|
53
|
+
<% end -%>
|
61
54
|
web:
|
62
55
|
build: .
|
63
56
|
image: <%= project_name %>:latest
|
@@ -67,40 +60,39 @@ services:
|
|
67
60
|
- 'bundle:/bundle'
|
68
61
|
ports:
|
69
62
|
- "3000:3000"
|
70
|
-
|
71
|
-
-
|
72
|
-
- RACK_ENV=development
|
63
|
+
env_file:
|
64
|
+
- .env
|
73
65
|
depends_on:
|
74
|
-
|
66
|
+
<% if options[:postgres] -%>
|
75
67
|
- postgres
|
76
|
-
|
77
|
-
|
68
|
+
<% end -%>
|
69
|
+
<% if options[:mysql] -%>
|
78
70
|
- mysql
|
79
|
-
|
80
|
-
|
81
|
-
- redis
|
82
|
-
<% end -%>
|
83
|
-
<% if options[:elasticsearch] -%>
|
71
|
+
<% end -%>
|
72
|
+
<% if options[:elasticsearch] -%>
|
84
73
|
- elasticsearch
|
85
|
-
|
86
|
-
|
74
|
+
<% end -%>
|
75
|
+
<% if options[:solr] -%>
|
87
76
|
- solr
|
88
|
-
|
77
|
+
<% end -%>
|
78
|
+
<% if options[:redis] -%>
|
79
|
+
- redis
|
80
|
+
<% end -%>
|
89
81
|
|
90
82
|
volumes:
|
91
83
|
bundle:
|
92
|
-
|
84
|
+
<% if options[:postgres] -%>
|
93
85
|
postgres:
|
94
|
-
|
95
|
-
|
86
|
+
<% end -%>
|
87
|
+
<% if options[:mysql] -%>
|
96
88
|
mysql:
|
97
|
-
|
98
|
-
|
99
|
-
redis:
|
100
|
-
<% end -%>
|
101
|
-
<% if options[:elasticsearch] -%>
|
89
|
+
<% end -%>
|
90
|
+
<% if options[:elasticsearch] -%>
|
102
91
|
elasticsearch:
|
103
|
-
|
104
|
-
|
92
|
+
<% end -%>
|
93
|
+
<% if options[:solr] -%>
|
105
94
|
solr:
|
106
|
-
|
95
|
+
<% end -%>
|
96
|
+
<% if options[:redis] -%>
|
97
|
+
redis:
|
98
|
+
<% end -%>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stack_car
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rob Kaufman
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -52,6 +52,34 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '3.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: yard
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: yard-thor
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
55
83
|
- !ruby/object:Gem::Dependency
|
56
84
|
name: thor
|
57
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -76,6 +104,7 @@ extensions: []
|
|
76
104
|
extra_rdoc_files: []
|
77
105
|
files:
|
78
106
|
- ".gitignore"
|
107
|
+
- ".gitlab-ci.yml"
|
79
108
|
- ".rspec"
|
80
109
|
- ".travis.yml"
|
81
110
|
- Gemfile
|
@@ -88,6 +117,9 @@ files:
|
|
88
117
|
- lib/stack_car.rb
|
89
118
|
- lib/stack_car/cli.rb
|
90
119
|
- lib/stack_car/version.rb
|
120
|
+
- public/.gitkeep
|
121
|
+
- public/logo.jpg
|
122
|
+
- public/logo.pxm
|
91
123
|
- stack_car.gemspec
|
92
124
|
- templates/.dockerignore.erb
|
93
125
|
- templates/.env.erb
|