stack_car 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/stack_car/cli.rb +17 -3
- data/lib/stack_car/version.rb +1 -1
- data/templates/Dockerfile.erb +2 -1
- data/templates/docker-compose-prod.yml.erb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c72e980bbffa17149e6be7837ad3ad9e5976067c
|
4
|
+
data.tar.gz: e145e199cc0618a45a819a788be3f48b06e88874
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd315865d0ad824d4cf554fddb8840d562ff14f21bea436c7678db68b532d9bb5c0da77b9b83e4c2b3cc289c5edf702f6bbe89d144f53f89d4b1a1eb4cc265bb
|
7
|
+
data.tar.gz: 404f6a4b47a30caa5abe10f67cd5835eab88a3e567a860906a139d343105e9df0ab172d9469e798d85b60bf6d937ade496ed17e410692d246d21205377fa666c
|
data/lib/stack_car/cli.rb
CHANGED
@@ -11,17 +11,31 @@ module StackCar
|
|
11
11
|
end
|
12
12
|
|
13
13
|
method_option :service, default: 'web', type: :string, aliases: '-s'
|
14
|
+
method_option :build, default: true, type: :boolean, aliases: '-b'
|
14
15
|
desc "up", "starts docker-compose with rebuild and orphan removal, defaults to web"
|
15
16
|
def up
|
16
|
-
|
17
|
+
args = ['--remove-orphans']
|
18
|
+
args << '--build' if options[:build]
|
19
|
+
run("rm -rf tmp/pids/server.pid")
|
20
|
+
run("docker-compose up #{args.join(' ')} #{options[:service]}")
|
17
21
|
end
|
18
22
|
|
19
23
|
method_option :service, default: '', type: :string, aliases: '-s'
|
20
24
|
desc "stop", "starts docker-compose with rebuild and orphan removal, defaults to all"
|
21
25
|
def stop
|
22
26
|
run("docker-compose stop #{options[:service]}")
|
27
|
+
run("rm -rf tmp/pids/server.pid")
|
23
28
|
end
|
24
29
|
|
30
|
+
method_option :service, default: 'web', type: :string, aliases: '-s'
|
31
|
+
desc "build", "build the services, defaults to web"
|
32
|
+
def build
|
33
|
+
@project_name = File.basename(File.expand_path('.'))
|
34
|
+
run("docker-compose build #{options[:service]}")
|
35
|
+
run("docker cp #{@project_name}_#{options[:service]}_1:/bundle .")
|
36
|
+
end
|
37
|
+
|
38
|
+
|
25
39
|
method_option :service, default: 'web', type: :string, aliases: '-s'
|
26
40
|
desc "walk ARGS", "wraps docker-compose run web unless --service is used to specify"
|
27
41
|
def walk(*args)
|
@@ -51,7 +65,7 @@ module StackCar
|
|
51
65
|
|
52
66
|
desc "release ENVIRONTMENT", "tag and push and image to the registry"
|
53
67
|
def release(environment)
|
54
|
-
registry = "ENV['REGISTRY_HOST']ENV['REGISTRY_URI']"
|
68
|
+
registry = "#{ENV['REGISTRY_HOST']}#{ENV['REGISTRY_URI']}"
|
55
69
|
run("docker login #{ENV['REGISTRY_HOST']}")
|
56
70
|
run("docker tag #{registry} #{registry}:#{environment}-#{Time.now.strftime("%Y%m%d%I%M%S")}")
|
57
71
|
run("docker push #{registry}:#{environment}-#{Time.now.strftime("%Y%m%d%I%M%S")}")
|
@@ -103,7 +117,7 @@ module StackCar
|
|
103
117
|
['.dockerignore', 'Dockerfile', 'docker-compose.yml', 'docker-compose-prod.yml', '.gitlab-ci.yml', '.env'].each do |template_file|
|
104
118
|
template("#{template_file}.erb", template_file)
|
105
119
|
end
|
106
|
-
|
120
|
+
empty_directory('bundle')
|
107
121
|
if options[:deploy] || options[:rancher]
|
108
122
|
directory('ops')
|
109
123
|
['hosts'].each do |template_file|
|
data/lib/stack_car/version.rb
CHANGED
data/templates/Dockerfile.erb
CHANGED
@@ -17,11 +17,12 @@ ENV APP_HOME /app
|
|
17
17
|
RUN mkdir $APP_HOME
|
18
18
|
WORKDIR $APP_HOME
|
19
19
|
|
20
|
+
COPY ./bundle /bundle
|
20
21
|
ENV BUNDLE_GEMFILE=$APP_HOME/Gemfile \
|
21
22
|
BUNDLE_JOBS=2 \
|
22
23
|
BUNDLE_PATH=/bundle
|
23
24
|
|
24
25
|
ADD Gemfile* $APP_HOME/
|
25
|
-
RUN bundle install
|
26
|
+
RUN bundle check || bundle install
|
26
27
|
|
27
28
|
COPY . $APP_HOME
|
@@ -2,7 +2,7 @@ version: '2'
|
|
2
2
|
services:
|
3
3
|
web:
|
4
4
|
image: <%= @project_name %>:latest
|
5
|
-
command: bundle exec rake assets:precompile && bundle exec rails s -p 3000 -b '0.0.0.0'
|
5
|
+
command: bash -c "bundle exec rake assets:precompile db:migrate && bundle exec rails s -p 3000 -b '0.0.0.0'"
|
6
6
|
environment:
|
7
7
|
- RAILS_ENV=production
|
8
8
|
- RACK_ENV=production
|
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.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rob Kaufman
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-01-
|
11
|
+
date: 2017-01-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|