orchestration 0.3.7 → 0.3.8

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: 9afb24c9efeefd9ccd9799fa399c7ff62f4f0f6cc242e62363503138c7403784
4
- data.tar.gz: e1da14692011a5ef18572265418050273ea8013a572a1f225afbc09f7f7f40b1
3
+ metadata.gz: 8569b93a7b22313b5633bb0d396a31c8a718f24eaa09f7968a8facd20a749934
4
+ data.tar.gz: 14c9f928ebb9e19d4d5d437aa6e72c65d7c1cc3bfa56ff69ab42a81e23ce71c4
5
5
  SHA512:
6
- metadata.gz: e2694f7b030351f1e02483c80d071cd070cf626bcfc8787580c058f96a5f5cf9c42bb0c82e09cb8d1e9bd32aba249f4874699f126f1593e2335f794e7d472bf5
7
- data.tar.gz: 1d9fe30e7fd4b3320fb90dd05bd34456c45ed82dfe9ab21a2f176aa78141d97d3f94012bb19407c848c4b45876e03bd564bccaffe9d2364bbca9cfc5417f263c
6
+ metadata.gz: 9297540aa796b86d44bb62f4e34c94a44bc24463f66dd01d2f744e016eb0598085a80cf5393c7c4932293918db9e3f6110cfa6150eb989432c01d5cf907df72a
7
+ data.tar.gz: affd54e64411b8f4f3be7096fc0525f25c50a1b46b4b3f01ae1588032cfe4c7e640fdc2c49890b1b63979da4fd3a8be5ed832af37760dbb5b774e0c28a994460
data/README.md CHANGED
@@ -11,7 +11,7 @@ _Orchestration_ is a toolkit for testing, building, and deploying _Ruby_ (includ
11
11
  Add _Orchestration_ to your Gemfile:
12
12
 
13
13
  ```ruby
14
- gem 'orchestration', '~> 0.3.7'
14
+ gem 'orchestration', '~> 0.3.8'
15
15
  ```
16
16
 
17
17
  Install:
@@ -48,7 +48,8 @@ module Orchestration
48
48
  def configuration_class
49
49
  # Find the relevant `Configuration` class for whatever `Healthcheck`
50
50
  # class we happen to be included in.
51
- self.class.parent.const_get(:Configuration)
51
+ instance_eval(self.class.name.rpartition('::').first)
52
+ .const_get(:Configuration)
52
53
  end
53
54
 
54
55
  def devnull
@@ -19,6 +19,6 @@ RUN . /root/.bashrc && yarn install
19
19
  <% end %>
20
20
  COPY entrypoint.sh /
21
21
  ADD .build/context.tar.gz .
22
- <% if defined?(Webpacker) %>RUN . /root/.bashrc && yarn install && bundle exec rake assets:precompile<% elsif Rake::Task.tasks.map(&:name).include?('assets:precompile') %>RUN bundle exec rake assets:precompile<% end %>
22
+ <% if defined?(Webpacker) %>RUN . /root/.bashrc && NODE_ENV=production RAILS_ENV=production yarn install && NODE_ENV=production RAILS_ENV=production bundle exec rake assets:precompile<% elsif Rake::Task.tasks.map(&:name).include?('assets:precompile') %>RUN NODE_ENV=production RAILS_ENV=production bundle exec rake assets:precompile<% end %>
23
23
  ENTRYPOINT ["/entrypoint.sh"]
24
24
  CMD ["bundle", "exec", "unicorn", "-c", "/app/config/unicorn.rb"]
@@ -1,20 +1,30 @@
1
1
  -include .env
2
2
  export
3
3
 
4
+ ifneq (,$(RAILS_ENV))
5
+ env:=$(RAILS_ENV)
6
+ else ifneq (,$(RACK_ENV))
7
+ env:=$(RACK_ENV)
8
+ endif
9
+
4
10
  verify-environment:
5
11
  ifndef VIRTUAL_HOST
6
- @$(error VIRTUAL_HOST must be defined in environment)
12
+ @$(error `VIRTUAL_HOST` must be defined in environment)
7
13
  endif
8
14
 
9
15
  ifndef LISTEN_PORT
10
- @$(error LISTEN_PORT must be defined in environment)
16
+ @$(error `LISTEN_PORT` must be defined in environment)
17
+ endif
18
+
19
+ ifndef env
20
+ @$(error Either `env`, `RACK_ENV` or `RAILS_ENV` must be defined in environment)
11
21
  endif
12
22
 
13
23
  compose_base:=env HOST_UID=$(shell id -u) \
14
24
  DOCKER_ORGANIZATION=%%ORGANIZATION%% \
15
25
  DOCKER_REPOSITORY=%%REPOSITORY%%:%%VERSION%% \
16
26
  docker-compose \
17
- -p %%REPOSITORY%% \
27
+ -p %%REPOSITORY%%_${env} \
18
28
  -f docker-compose.yml
19
29
 
20
30
  compose:=${compose_base} -f docker-compose.production.yml -f docker-compose.override.yml
@@ -22,7 +32,7 @@ compose:=${compose_base} -f docker-compose.production.yml -f docker-compose.over
22
32
  .PHONY: deploy
23
33
  deploy:
24
34
  @echo "Deploying application to Docker swarm..."
25
- @${compose} config | docker stack deploy -c - %%REPOSITORY%%
35
+ @${compose} config | docker stack deploy -c - %%REPOSITORY%%_${env}
26
36
 
27
37
  .PHONY: stop
28
38
  stop:
@@ -2,7 +2,7 @@
2
2
  set -u
3
3
  id owner >/dev/null 2>&1 || useradd -u ${HOST_UID} -m -o owner
4
4
  mkdir -p /app/tmp/pids
5
- chown -R owner:owner /app/tmp /app/log /app/db
5
+ chown -Rf owner:owner /app/tmp /app/log /app/db
6
6
  rm -f /app/tmp/pids/unicorn.pid
7
7
  mkdir -p /var/www/public/
8
8
  ln -nfs /app/public/* /var/www/public/
@@ -26,7 +26,7 @@ compose_base:=env HOST_UID=$(shell id -u) \
26
26
  DOCKER_ORGANIZATION=${docker_organization} \
27
27
  DOCKER_REPOSITORY=${docker_repository} \
28
28
  docker-compose \
29
- -p ${docker_repository} \
29
+ -p ${docker_repository}_${env} \
30
30
  -f <%= env.orchestration_dir_name %>/docker-compose.yml
31
31
 
32
32
  git_branch:=$(if $(branch),$(branch),$(shell git rev-parse --abbrev-ref HEAD))
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Orchestration
4
- VERSION = '0.3.7'
4
+ VERSION = '0.3.8'
5
5
  end
data/lib/orchestration.rb CHANGED
@@ -3,7 +3,11 @@
3
3
  require 'colorize'
4
4
  require 'erubis'
5
5
  require 'i18n'
6
- require 'rails'
6
+ begin
7
+ require 'rails'
8
+ rescue LoadError
9
+ STDERR.puts('Rails not detected; continuing without Rails support.')
10
+ end
7
11
 
8
12
  I18n.load_path += Dir[File.join(File.expand_path('..', __dir__),
9
13
  'config', 'locales', '**', '*.yml')]
@@ -14,7 +18,7 @@ require 'orchestration/docker_compose'
14
18
  require 'orchestration/environment'
15
19
  require 'orchestration/errors'
16
20
  require 'orchestration/install_generator'
17
- require 'orchestration/railtie'
21
+ require 'orchestration/railtie' if defined?(Rails)
18
22
  require 'orchestration/service_check'
19
23
  require 'orchestration/services'
20
24
  require 'orchestration/settings'
@@ -27,6 +27,7 @@ Gem::Specification.new do |spec|
27
27
  spec.add_runtime_dependency 'colorize', '~> 0.8.1'
28
28
  spec.add_runtime_dependency 'erubis', '~> 2.7'
29
29
  spec.add_runtime_dependency 'i18n', '>= 0.5'
30
+ spec.add_runtime_dependency 'thor', '~> 0.20.0'
30
31
  spec.add_runtime_dependency 'unicorn', '~> 5.4'
31
32
 
32
33
  spec.add_development_dependency 'activerecord', '~> 5.2'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: orchestration
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.7
4
+ version: 0.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bob Farrell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-12 00:00:00.000000000 Z
11
+ date: 2019-01-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0.5'
55
+ - !ruby/object:Gem::Dependency
56
+ name: thor
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 0.20.0
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 0.20.0
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: unicorn
57
71
  requirement: !ruby/object:Gem::Requirement