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 +4 -4
- data/.gitignore +1 -0
- data/NEWS.md +5 -0
- data/dockerfile +14 -2
- data/lib/bulldozer/app_builder.rb +5 -0
- data/lib/bulldozer/generators/app_generator.rb +5 -0
- data/lib/bulldozer/version.rb +1 -1
- data/spec/features/new_project_spec.rb +12 -0
- data/templates/docker-compose.yml +54 -0
- data/templates/dockerfile.erb +20 -0
- data/templates/dotfiles/.env +3 -0
- data/templates/postgresql_database.yml.erb +3 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d56bb23f62c053e4d3e1bc9a1029576227bf967426d9475efd370ec00a9c66de
|
4
|
+
data.tar.gz: db2959e3ee675ce694f9f5b275249733fdd8e70c50b98227266fc53a9b2d2db6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 43a1783ea9fcf8622dd55cf42cc3e21f2320f15328d62509bc066b3830677fbd4ec5f7952f9d7ca3dbc8b29345df2355af985189e80369209d98c8c23403ee21
|
7
|
+
data.tar.gz: dd6c1a11652eb8bde9dbdde0c219d565f0566c2c0277d99d70271cb9757c88469c8a8051ff5d8ad55385a310a0cd705ffa533b7fecf7746d40c2b4211dc12e10
|
data/.gitignore
CHANGED
data/NEWS.md
CHANGED
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
|
data/lib/bulldozer/version.rb
CHANGED
@@ -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
|
data/templates/dotfiles/.env
CHANGED
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.
|
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
|