bulldozer 1.6.0 → 1.6.1

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: 454d52670ea7c516c49d5202447deaab249dd3e6df59d5c257525b1b34a5f4af
4
- data.tar.gz: dcf1e6219f32673b3fa9fda7464ad8a9f02b945ac67890aa28a3eb0d5903bfcf
3
+ metadata.gz: d56bb23f62c053e4d3e1bc9a1029576227bf967426d9475efd370ec00a9c66de
4
+ data.tar.gz: db2959e3ee675ce694f9f5b275249733fdd8e70c50b98227266fc53a9b2d2db6
5
5
  SHA512:
6
- metadata.gz: b21054a99e8b21b6cee1e55a2811b576fbc46be89db5072be8a62202eb46d1eb4bd394cdcc4f5f18d88263cad36304706e3712e81ad31f2f9d0c92d99db0a26e
7
- data.tar.gz: e77f8076dd8ce0c640e01758cd425fd7fc12829b1ab1337eb6a0c6b24780147744ce47d54e90de95d13dcbe57811868dee34dada3d12d644a74839e106437288
6
+ metadata.gz: 43a1783ea9fcf8622dd55cf42cc3e21f2320f15328d62509bc066b3830677fbd4ec5f7952f9d7ca3dbc8b29345df2355af985189e80369209d98c8c23403ee21
7
+ data.tar.gz: dd6c1a11652eb8bde9dbdde0c219d565f0566c2c0277d99d70271cb9757c88469c8a8051ff5d8ad55385a310a0cd705ffa533b7fecf7746d40c2b4211dc12e10
data/.gitignore CHANGED
@@ -3,3 +3,4 @@
3
3
  Gemfile.lock
4
4
  /.bundle
5
5
  /tmp
6
+ bulldozer-*
data/NEWS.md CHANGED
@@ -1,5 +1,10 @@
1
1
  1.6.0 (March 01, 2019)
2
2
 
3
+ * Add docker support on the Gem
4
+ * Add docker files to the created project by default
5
+
6
+ 1.6.0 (March 01, 2019)
7
+
3
8
  * Rename Project to bulldozer
4
9
  * All commands now will change from `suspenders` to `bulldozer`
5
10
 
data/dockerfile CHANGED
@@ -3,9 +3,21 @@ FROM ruby:2.5.3
3
3
  RUN apt-get update && apt-get install -y vim
4
4
  ENV EDITOR="vim"
5
5
  # Install container dependencies
6
- RUN apt-get update && apt-get install -y libc-ares2 libv8-3.14.5 --no-install-recommends && rm -rf /var/lib/apt/lists/*
6
+ RUN apt-get update && apt-get install -y libc-ares2 libv8-3.14.5 postgresql-client nodejs --no-install-recommends && rm -rf /var/lib/apt/lists/*
7
+ # Install Chrome to use with Capybara JavaScript specs
8
+ RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
9
+ && echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list
10
+ RUN apt-get update && apt-get -y install google-chrome-stable
7
11
  # Set the work directory inside container
8
12
  RUN mkdir /app
9
13
  WORKDIR /app
14
+ # Copy the Gemfile inside the container
15
+ COPY bulldozer.gemspec /app/
16
+ COPY Gemfile* /app/
10
17
  # Copy all the rest inside work directory
11
- COPY . /app
18
+ COPY . /app
19
+ # Go inside the /app folder, without this you have problems with relative paths
20
+ RUN cd /app
21
+ # Install dependencies
22
+ RUN gem install bundler
23
+ RUN bundle install --jobs 32 --retry 4
@@ -29,6 +29,11 @@ module Bulldozer
29
29
  template "Gemfile.erb", "Gemfile"
30
30
  end
31
31
 
32
+ def copy_dockerfiles
33
+ template "dockerfile.erb", "dockerfile"
34
+ copy_file "docker-compose.yml", "docker-compose.yml"
35
+ end
36
+
32
37
  def setup_rack_mini_profiler
33
38
  copy_file(
34
39
  "rack_mini_profiler.rb",
@@ -49,6 +49,7 @@ module Bulldozer
49
49
  invoke :copy_miscellaneous_files
50
50
  invoke :customize_error_pages
51
51
  invoke :setup_dotfiles
52
+ invoke :setup_docker
52
53
  invoke :setup_database
53
54
  invoke :create_github_repo
54
55
  invoke :setup_bundler_audit
@@ -136,6 +137,10 @@ module Bulldozer
136
137
  def setup_dotfiles
137
138
  build :copy_dotfiles
138
139
  end
140
+
141
+ def setup_docker
142
+ build :copy_dockerfiles
143
+ end
139
144
 
140
145
  def setup_default_directories
141
146
  build :setup_default_directories
@@ -4,5 +4,5 @@ module Bulldozer
4
4
  read("#{File.dirname(__FILE__)}/../../.ruby-version").
5
5
  strip.
6
6
  freeze
7
- VERSION = "1.6.0".freeze
7
+ VERSION = "1.6.1".freeze
8
8
  end
@@ -21,6 +21,18 @@ RSpec.describe "Suspend a new project with default configuration" do
21
21
  )
22
22
  end
23
23
 
24
+ it "creates docker files" do
25
+ dockerfile = IO.read("#{project_path}/dockerfile")
26
+ docker_compose = IO.read("#{project_path}/docker-compose.yml")
27
+
28
+ expect(dockerfile).to match(
29
+ /^FROM ruby:"#{Bulldozer::RUBY_VERSION}"$/,
30
+ )
31
+ expect(docker_compose).to match(
32
+ /^ruby bin\/rails s -p 3000 -b "0.0.0.0"$/,
33
+ )
34
+ end
35
+
24
36
  it "ensures project specs pass" do
25
37
  Dir.chdir(project_path) do
26
38
  Bundler.with_clean_env do
@@ -0,0 +1,54 @@
1
+ version: '3'
2
+
3
+ services:
4
+ rails:
5
+ build: .
6
+ env_file:
7
+ - .env
8
+ command: ruby bin/rails s -p 3000 -b '0.0.0.0'
9
+ volumes:
10
+ - .:/app
11
+ links:
12
+ - redis
13
+ - postgres
14
+ ports:
15
+ - "3000:3000"
16
+ expose:
17
+ - "3000"
18
+
19
+ postgres:
20
+ image: postgres:10.4
21
+ env_file:
22
+ - .env
23
+ volumes:
24
+ - ".:/app"
25
+ ports:
26
+ - "5432:5432"
27
+ expose:
28
+ - "5432"
29
+
30
+ redis:
31
+ image: redis:alpine
32
+ env_file:
33
+ - .env
34
+ command: redis-server
35
+ volumes:
36
+ - ".:/app"
37
+ ports:
38
+ - "6379:6379"
39
+ expose:
40
+ - "6379"
41
+
42
+ sidekiq:
43
+ build: .
44
+ env_file:
45
+ - .env
46
+ environment:
47
+ - RAILS_URL=http://rails:3000 # overwrite to match docker
48
+ command: bundle exec sidekiq -C config/sidekiq.yml
49
+ volumes:
50
+ - ".:/app"
51
+ links:
52
+ - redis
53
+ - rails
54
+ - postgres
@@ -0,0 +1,20 @@
1
+ FROM ruby:#{Bulldozer::RUBY_VERSION}
2
+ # Install VIM to edit credentials.yml.enc file
3
+ RUN apt-get update && apt-get install -y vim
4
+ ENV EDITOR="vim"
5
+ # Install container dependencies
6
+ RUN apt-get update && apt-get install -y libc-ares2 libv8-3.14.5 postgresql-client nodejs --no-install-recommends && rm -rf /var/lib/apt/lists/*
7
+ # Install Chrome to use with Capybara JavaScript specs
8
+ RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
9
+ && echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list
10
+ RUN apt-get update && apt-get -y install google-chrome-stable
11
+ # Set the work directory inside container
12
+ RUN mkdir /app
13
+ WORKDIR /app
14
+ # Copy the Gemfile inside the container
15
+ COPY Gemfile* /app/
16
+ # Install dependencies
17
+ RUN gem install bundler
18
+ RUN bundle install --jobs 32 --retry 4
19
+ # Copy all the rest inside work directory
20
+ COPY . /app
@@ -1,4 +1,7 @@
1
1
  # https://github.com/ddollar/forego
2
+ POSTGRES_HOST=localhost
3
+ POSTGRES_USER=postgres
4
+ POSTGRES_PASSWORD=postgres
2
5
  ASSET_HOST=localhost:3000
3
6
  APPLICATION_HOST=localhost:3000
4
7
  PORT=3000
@@ -1,4 +1,7 @@
1
1
  development: &default
2
+ host: <%= ENV.fetch("POSTGRES_HOST") { nil } %>
3
+ username: <%= ENV.fetch("POSTGRES_USER") { nil } %>
4
+ password: <%= ENV.fetch("POSTGRES_PASSWORD") { nil } %>
2
5
  adapter: postgresql
3
6
  database: <%= app_name %>_development
4
7
  encoding: utf8
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bulldozer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - mpatrick
@@ -152,6 +152,8 @@ files:
152
152
  - templates/circle.yml.erb
153
153
  - templates/config_locales_en.yml.erb
154
154
  - templates/dev.rake
155
+ - templates/docker-compose.yml
156
+ - templates/dockerfile.erb
155
157
  - templates/dotfiles/.ctags
156
158
  - templates/dotfiles/.env
157
159
  - templates/email.rb