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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 470669e083d290081cb6a41cefa575a4e29d7f4e
4
- data.tar.gz: 1f8e0470a96ab3176e5f3ec02bff0f7c0ee734f8
3
+ metadata.gz: 814456b5afb8f8bffaa719ca737e7e754b74e73d
4
+ data.tar.gz: 3d7f8ff357806976c305fcbde53d82f1867f7ecf
5
5
  SHA512:
6
- metadata.gz: 1fffe6ec701e1d733cc9ad6ccf17cac646db5c27305b09799ba31195a853c90387daa87e0299532524f097a84fbfadab7f0c5b993c95b7f609c6e7d319b375d2
7
- data.tar.gz: 8dba8042f726329bd1406335b3483052fe76c65b7b2fbf9d0942bba5f9a3fe5dc6dda5f50c64510d242aa014f41e6200a36051d7aa1a20fd8a6cf106530c8ca0
6
+ metadata.gz: 5720260df738401459e6e8831398d6262fc16bfc3346dbc53b86e80680db01a957091e9a0f2eb6bbe04ac92bfb700cb431b5ab54ba98a63140039c7c4880c173
7
+ data.tar.gz: 3ca69f9ea7a3bbd39f6366b475d7272590398b02f6f8f2ea44821f977d63d810abe849b7f63645fa1ba8c1f78be4ba8f0ba76d47556957a2363326aa424159d8
data/.gitignore CHANGED
@@ -7,4 +7,5 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
- **/.#*
10
+ **/.#*
11
+ /public/*
data/.gitlab-ci.yml ADDED
@@ -0,0 +1,17 @@
1
+ image: ruby:2.3
2
+
3
+ before_script:
4
+ bundle
5
+
6
+ pages:
7
+ script:
8
+ - bundle exec yardoc --plugin yard-thor -o public - templates/.* templates/*
9
+ artifacts:
10
+ paths:
11
+ - public
12
+ only:
13
+ - master
14
+
15
+ test:
16
+ script:
17
+ bundle exec rake
data/README.md CHANGED
@@ -1,39 +1,35 @@
1
1
  # StackCar
2
2
 
3
- ## TODO
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
- 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/stack_car`. To experiment with that code, run `bin/console` for an interactive prompt.
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
- Add this line to your application's Gemfile:
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
- ```ruby
23
- gem 'stack_car'
13
+ ```bash
14
+ gem install stack_car
24
15
  ```
25
16
 
26
- And then execute:
27
-
28
- $ bundle
17
+ ## Usage
29
18
 
30
- Or install it yourself as:
31
19
 
32
- $ gem install stack_car
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
- ## Usage
35
-
36
- TODO: Write usage instructions here
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 GitHub at https://github.com/[USERNAME]/stack_car.
42
+ Bug reports and pull requests are welcome on Gitlab at https://gitlab.com/notch8/stack_car.
47
43
 
48
44
  ## TODO
49
- pull down db dumps
50
- push up db dumps
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
 
@@ -1,3 +1,3 @@
1
1
  module StackCar
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
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
- POSTGRES_DB=<%= project_name %>
3
- POSTGRES_USER=postgres
4
- POSTGRES_PASSWORD=DatabaseFTW
2
+ POSTGRES_DB=<%= project_name %>
3
+ POSTGRES_USER=postgres
4
+ POSTGRES_PASSWORD=DatabaseFTW
5
5
  <% end -%>
6
-
7
6
  <% if options[:mysql] -%>
8
- MYSQL_DATABASE=<%= project_name %>
9
- MYSQL_ROOT_PASSWORD=DatabaseFTW
7
+ MYSQL_DATABASE=<%= project_name %>
8
+ MYSQL_ROOT_PASSWORD=DatabaseFTW
10
9
  <% end -%>
@@ -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
- <% if options[:postgres] -%>
3
+ <% if options[:postgres] -%>
4
4
  postgres:
5
5
  image: postgres
6
- environment:
7
- POSTGRES_DB: "${POSTGRES_DB}"
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
- <% end -%>
15
- <% if options[:mysql] -%>
12
+ <% end -%>
13
+ <% if options[:mysql] -%>
16
14
  mysql:
17
15
  image: mysql
18
- environment:
19
- MYSQL_DATABASE: "${MYSQL_DATABASE}"
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
- <% end -%>
26
-
27
- <% if options[:solr] %>
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
- <% end -%>
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
- <% end -%>
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
- environment:
71
- - RAILS_ENV=development
72
- - RACK_ENV=development
63
+ env_file:
64
+ - .env
73
65
  depends_on:
74
- <% if options[:postgres] -%>
66
+ <% if options[:postgres] -%>
75
67
  - postgres
76
- <% end -%>
77
- <% if options[:mysql] -%>
68
+ <% end -%>
69
+ <% if options[:mysql] -%>
78
70
  - mysql
79
- <% end -%>
80
- <% if options[:redis] -%>
81
- - redis
82
- <% end -%>
83
- <% if options[:elasticsearch] -%>
71
+ <% end -%>
72
+ <% if options[:elasticsearch] -%>
84
73
  - elasticsearch
85
- <% end -%>
86
- <% if options[:solr] -%>
74
+ <% end -%>
75
+ <% if options[:solr] -%>
87
76
  - solr
88
- <% end -%>
77
+ <% end -%>
78
+ <% if options[:redis] -%>
79
+ - redis
80
+ <% end -%>
89
81
 
90
82
  volumes:
91
83
  bundle:
92
- <% if options[:postgres] -%>
84
+ <% if options[:postgres] -%>
93
85
  postgres:
94
- <% end -%>
95
- <% if options[:mysql] -%>
86
+ <% end -%>
87
+ <% if options[:mysql] -%>
96
88
  mysql:
97
- <% end -%>
98
- <% if options[:redis] -%>
99
- redis:
100
- <% end -%>
101
- <% if options[:elasticsearch] -%>
89
+ <% end -%>
90
+ <% if options[:elasticsearch] -%>
102
91
  elasticsearch:
103
- <% end -%>
104
- <% if options[:solr] -%>
92
+ <% end -%>
93
+ <% if options[:solr] -%>
105
94
  solr:
106
- <% end -%>
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.5
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: 2016-12-29 00:00:00.000000000 Z
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