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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fc7eacf2b940c9efa131b58a489ef55808504675
4
- data.tar.gz: 70297ae4fed6d8e0ab3a623ebbbadbe0aa05819d
3
+ metadata.gz: c72e980bbffa17149e6be7837ad3ad9e5976067c
4
+ data.tar.gz: e145e199cc0618a45a819a788be3f48b06e88874
5
5
  SHA512:
6
- metadata.gz: 48bdbc3d7ba5c002c5c9d602d2557b5785bc738426c6171420a30c421e54ccadbbc2f65e1158ac965590b56c6c0410c6fb71353e6f28d139c58bf466ebc1226b
7
- data.tar.gz: b10ce8a52d5966d0bb28bdadf0c8d74115671b9bbaa748230cc218ab0beb1ce2d0139ac5cc4b154f28cafeb7b02205fc6dcc3aa4f4a285bb88e68c79ff50a4a4
6
+ metadata.gz: dd315865d0ad824d4cf554fddb8840d562ff14f21bea436c7678db68b532d9bb5c0da77b9b83e4c2b3cc289c5edf702f6bbe89d144f53f89d4b1a1eb4cc265bb
7
+ data.tar.gz: 404f6a4b47a30caa5abe10f67cd5835eab88a3e567a860906a139d343105e9df0ab172d9469e798d85b60bf6d937ade496ed17e410692d246d21205377fa666c
@@ -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
- run("docker-compose up --build --remove-orphans #{options[:service]}")
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|
@@ -1,3 +1,3 @@
1
1
  module StackCar
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
@@ -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.1
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-24 00:00:00.000000000 Z
11
+ date: 2017-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler