orchestration 0.5.5 → 0.5.10

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
  SHA256:
3
- metadata.gz: e312ede29eb601b4e9413df1b711881997f81629b6f208c0ea7e62102d4a6b44
4
- data.tar.gz: 4483fd3532b1bf27bb9a6b76e38c996a02f046164ed23ce85d5df5720e933ff3
3
+ metadata.gz: 150c7f4fbfb486398d0b26e7362b1d913463525d2e3b5d2fd5d3778fa728cc64
4
+ data.tar.gz: 4c91a0705f955b13aed805b8fa6ce2e4a78177ad81a98177e7ab4a970233a1ff
5
5
  SHA512:
6
- metadata.gz: 6539ea72eabd6683691749179cb4bd08c9f9e3f334ced7348236058a2926a6e25f6a09176c47efb1f40a0b22f57f96c9d1fb9ba4274c25036a4cd03e3d3f6ead
7
- data.tar.gz: caed0598c1dc565457e0437943a0c031b78c3bef1ab99d5ae313368af6a4e0a84e7451bc46560e454457a5fa5c8e83c5ff6019fc114c3fd22e0a0dfac00d9c61
6
+ metadata.gz: 52541a298cbfbbd1f4361370543c428c60fc411e9000a4223dbb865aa02d13931fcf3bce2a3d2b2017b7ffaf12493e6a95b4c333b7352e0476edcd3929d02c93
7
+ data.tar.gz: 7a617a4b2c7eca3a8b830bb96597934252361be208e1bd545fe4f79067759c709582a59486067c3e7498ac779fa8e6f8c7107725410fabfe80e5d569c42a6ac3
@@ -13,6 +13,7 @@ Metrics/ModuleLength:
13
13
  - 'lib/orchestration/file_helpers.rb'
14
14
 
15
15
  AllCops:
16
+ NewCops: enable
16
17
  Exclude:
17
18
  - 'bin/**/*'
18
19
  - 'db/schema.rb'
data/README.md CHANGED
@@ -27,7 +27,7 @@ The below screenshot demonstrates _Orchestration_ being installed in a brand new
27
27
  Add _Orchestration_ to your Gemfile:
28
28
 
29
29
  ```ruby
30
- gem 'orchestration', '~> 0.5.5'
30
+ gem 'orchestration', '~> 0.5.10'
31
31
  ```
32
32
 
33
33
  Install:
@@ -191,12 +191,20 @@ make serve server='-p 3001 -b 192.168.0.1'
191
191
  A default `test` target is provided in your application's main `Makefile`. You are encouraged to modify this target to suit your application's requirements.
192
192
 
193
193
  To launch all dependency containers, run database migrations, and run tests:
194
- ```
194
+ ```bash
195
195
  make test
196
196
  ```
197
197
 
198
- If you prefer to run tests manually (e.g. if you want to run tests for a specific file) then the `test-setup` target can be used:
198
+ The default `test` command can (and should) be extended. This command is defined in the root `Makefile` in the project and, by defaults, runs `rspec` and `rubocop`.
199
+
200
+ To run only the `test` command, without test setup (i.e. without restarting containers etc.), pass the `light` option:
201
+
202
+ ```bash
203
+ make test light=1
199
204
  ```
205
+
206
+ If you prefer to run tests manually (e.g. if you want to run tests for a specific file) then the `test-setup` target can be used:
207
+ ```bash
200
208
  make test-setup
201
209
  bundle exec rspec spec/my_class_spec.rb
202
210
  ```
@@ -227,7 +235,7 @@ To connect via _SSH_ to a remote swarm and deploy, pass the `manager` parameter:
227
235
  make deploy manager=user@manager.swarm.example.com
228
236
  ```
229
237
 
230
- The file `orchestration/docker-compose.production.yml` is created automatically. If your `RAILS_ENV` is set to something other than `production` then another file will need to be created (e.g. `orchestration/docker-compose.staging.yml`). In most cases this file can be a _symlink_ to the original `production` configuration and environment variables can be used to customise the content.
238
+ The file `orchestration/docker-compose.production.yml` is created automatically. This file will always be used for deployment, regardless of _Rails_ environment. Other environments should be configured using a separate [`.env` file](#env-file) for each environment.
231
239
 
232
240
  #### Roll back a deployment
233
241
 
@@ -262,6 +270,7 @@ networks:
262
270
  ```
263
271
 
264
272
  #### Use a custom `.env` file
273
+ <a name="env-file"></a>
265
274
 
266
275
  Specify a path to a local `.env` file (see [Docker Compose documentation](https://docs.docker.com/compose/environment-variables/#the-env-file)):
267
276
  ```
@@ -42,7 +42,7 @@ module Orchestration
42
42
 
43
43
  def self.error(key, options = {})
44
44
  warn('# Orchestration Error')
45
- warn('# ' + I18n.t("orchestration.#{key}", options))
45
+ warn("# #{I18n.t("orchestration.#{key}", options)}")
46
46
  end
47
47
 
48
48
  def self.random_local_port
@@ -64,7 +64,8 @@ module Orchestration
64
64
  'environment' => environment,
65
65
  'ports' => ports,
66
66
  'deploy' => deploy,
67
- 'logging' => logging
67
+ 'logging' => logging,
68
+ 'networks' => networks
68
69
  }
69
70
  end
70
71
 
@@ -75,10 +76,7 @@ module Orchestration
75
76
  end
76
77
 
77
78
  def deploy
78
- {
79
- 'mode' => 'replicated',
80
- 'replicas' => '${REPLICAS}'
81
- }
79
+ { 'mode' => 'replicated', 'replicas' => '${REPLICAS:-3}' }
82
80
  end
83
81
 
84
82
  def logging
@@ -91,25 +89,30 @@ module Orchestration
91
89
  }
92
90
  end
93
91
 
92
+ def networks
93
+ { 'local' => {} }
94
+ end
95
+
94
96
  def environment
95
97
  {
96
98
  'RAILS_LOG_TO_STDOUT' => '1',
97
99
  'RAILS_SERVE_STATIC_FILES' => '1',
98
100
  'WEB_PRELOAD_APP' => '1',
99
- 'WEB_HEALTHCHECK_PATH' => '/'
101
+ 'WEB_HEALTHCHECK_PATH' => '/',
102
+ 'DATABASE_URL' => database_url
100
103
  }.merge(Hash[inherited_environment.map { |key| [key, nil] }])
101
104
  end
102
105
 
106
+ def database_url
107
+ {
108
+ 'postgresql' => 'postgresql://postgres:password@database-local:5432/production',
109
+ 'mysql2' => 'mysql2://root:password@database-local:3306/production',
110
+ 'sqlite3' => 'sqlite3:db/production.sqlite3'
111
+ }.fetch(DockerCompose::ComposeConfiguration.database_adapter_name)
112
+ end
113
+
103
114
  def inherited_environment
104
- %w[
105
- DATABASE_URL
106
- HOST_UID
107
- RAILS_ENV
108
- SECRET_KEY_BASE
109
- WEB_CONCURRENCY
110
- WEB_TIMEOUT
111
- WEB_WORKER_PROCESSES
112
- ]
115
+ %w[HOST_UID RAILS_ENV SECRET_KEY_BASE WEB_CONCURRENCY WEB_TIMEOUT WEB_WORKER_PROCESSES]
113
116
  end
114
117
 
115
118
  def ports
@@ -21,6 +21,10 @@ module Orchestration
21
21
  {}.merge(database_volume).merge(mongo_volume)
22
22
  end
23
23
 
24
+ def networks
25
+ { 'local' => { 'name' => '${COMPOSE_PROJECT_NAME}' } }
26
+ end
27
+
24
28
  private
25
29
 
26
30
  def services_available
@@ -58,6 +62,7 @@ module Orchestration
58
62
  .fetch(service)
59
63
  .new(config, @environment)
60
64
  .definition
65
+ &.tap { |definition| definition['networks'] ||= { 'local' => {} } }
61
66
  end
62
67
  end
63
68
  end
@@ -16,7 +16,8 @@ module Orchestration
16
16
 
17
17
  {
18
18
  'image' => adapter.image,
19
- 'environment' => adapter.environment
19
+ 'environment' => adapter.environment,
20
+ 'networks' => networks
20
21
  }.merge(ports).merge(volumes)
21
22
  end
22
23
 
@@ -32,6 +33,12 @@ module Orchestration
32
33
  adapter.default_port
33
34
  end
34
35
 
36
+ def networks
37
+ return {} unless @environment == :production
38
+
39
+ { 'local' => { 'aliases' => ['database-local'] } }
40
+ end
41
+
35
42
  def ports
36
43
  return {} unless %i[development test].include?(@environment)
37
44
 
@@ -41,7 +41,8 @@ module Orchestration
41
41
  {
42
42
  'version' => compose_config(environment).version,
43
43
  'services' => services(environment),
44
- 'volumes' => volumes(environment)
44
+ 'volumes' => volumes(environment),
45
+ 'networks' => compose_config(environment).networks
45
46
  }
46
47
  end
47
48
 
@@ -35,7 +35,7 @@ module Orchestration
35
35
  client.open_timeout = ENV.fetch('WEB_HEALTHCHECK_OPEN_TIMEOUT', '10').to_i
36
36
 
37
37
  client.start do |request|
38
- request.get(ENV.fetch('WEB_HEALTHCHECK_PATH') { '/' })
38
+ request.get(ENV.fetch('WEB_HEALTHCHECK_PATH', '/'))
39
39
  end
40
40
  end
41
41
 
@@ -18,9 +18,7 @@ module Orchestration
18
18
 
19
19
  def inject_if_missing(path, content, index = 0)
20
20
  lines = File.exist?(path) ? File.readlines(path).map(&:chomp) : []
21
- if lines.any? { |line| line == content }
22
- return @terminal.write(:skip, relative_path(path))
23
- end
21
+ return @terminal.write(:skip, relative_path(path)) if lines.any? { |line| line == content }
24
22
 
25
23
  lines.insert(index, content)
26
24
  update_file(path, lines.join("\n"))
@@ -56,9 +54,7 @@ module Orchestration
56
54
  return create_file(path, content) unless present
57
55
 
58
56
  previous_content = File.read(path) if present
59
- if skip?(present, content, previous_content, options)
60
- return @terminal.write(:skip, relative_path(path))
61
- end
57
+ return @terminal.write(:skip, relative_path(path)) if skip?(present, content, previous_content, options)
62
58
 
63
59
  backup(path, previous_content) if options.fetch(:backup, false)
64
60
  File.write(path, content)
@@ -27,7 +27,7 @@ module Orchestration
27
27
  @terminal.write(:skip, relpath)
28
28
  end
29
29
 
30
- def verify_makefile(skip = true)
30
+ def verify_makefile(skip: true)
31
31
  # Only run when called explicitly [from Rake tasks].
32
32
  # (I know this is hacky).
33
33
  return if skip
@@ -127,10 +127,6 @@ module Orchestration
127
127
  ensure_lines_in_file(path, lines)
128
128
  end
129
129
 
130
- def deploy_mk
131
- simple_copy('deploy.mk')
132
- end
133
-
134
130
  private
135
131
 
136
132
  def t(key)
@@ -18,11 +18,9 @@ module Orchestration
18
18
  def run
19
19
  return unless @service.configuration.configured?
20
20
 
21
- @service.modify_environment
22
21
  echo_start
23
22
  success = attempt_connection
24
23
  echo_ready if success
25
- @service.unmodify_environment
26
24
  success
27
25
  end
28
26
 
@@ -19,18 +19,6 @@ module Orchestration
19
19
  [ActiveRecord::ConnectionNotEstablished].concat(adapter_errors)
20
20
  end
21
21
 
22
- def modify_environment
23
- @database_url = ENV.delete('DATABASE_URL')
24
- @development_database_url = ENV.delete('DEVELOPMENT_DATABASE_URL')
25
- @test_database_url = ENV.delete('TEST_DATABASE_URL')
26
- end
27
-
28
- def unmodify_environment
29
- ENV['DATABASE_URL'] = @database_url
30
- ENV['DEVELOPMENT_DATABASE_URL'] = @development_database_url
31
- ENV['TEST_DATABASE_URL'] = @test_database_url
32
- end
33
-
34
22
  private
35
23
 
36
24
  def adapter_errors
@@ -26,10 +26,6 @@ module Orchestration
26
26
  @dependencies = args
27
27
  end
28
28
 
29
- def modify_environment; end
30
-
31
- def unmodify_environment; end
32
-
33
29
  private
34
30
 
35
31
  def load_dependencies
@@ -42,9 +42,7 @@ module Orchestration
42
42
 
43
43
  def url_config
44
44
  uri = URI.parse(@env.mongo_url)
45
- unless uri.scheme == 'mongodb'
46
- raise ArgumentError, 'MONGO_URL protocol must be mongodb://'
47
- end
45
+ raise ArgumentError, 'MONGO_URL protocol must be mongodb://' unless uri.scheme == 'mongodb'
48
46
 
49
47
  url_config_structure(uri)
50
48
  end
@@ -13,7 +13,9 @@ RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - \
13
13
  && mkdir /app<%if defined?(Webpacker) %> \
14
14
  && curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash \
15
15
  && . /root/.bashrc \
16
- && nvm install 10.11.0 \
16
+ && nvm install 10.13.0 \
17
+ && npm config set user 0 \
18
+ && npm config set unsafe-perm true \
17
19
  && npm install -g yarn<% end %>
18
20
  WORKDIR /app
19
21
  COPY .build/Gemfile .build/Gemfile.lock ./
@@ -31,6 +31,7 @@ stdout=${pwd}/log/orchestration.stdout.log
31
31
  stderr=${pwd}/log/orchestration.stderr.log
32
32
  log_path_length=$(shell echo "${stdout}" | wc -c)
33
33
  ifndef verbose
34
+ log_tee:= 2>&1 | tee -a ${stdout}
34
35
  log:= >>${stdout} 2>>${stderr}
35
36
  progress_point:=perl -e 'while( my $$line = <STDIN> ) { printf("."); select()->flush(); }'
36
37
  log_progress:= > >(tee -ai ${stdout} >&1 | ${progress_point}) 2> >(tee -ai ${stderr} 2>&1 | ${progress_point})
@@ -41,7 +41,7 @@ endif
41
41
  ifeq (,$(findstring serve,$(MAKECMDGOALS)))
42
42
  ifeq (,$(findstring console,$(MAKECMDGOALS)))
43
43
  ifeq (,$(findstring test,$(MAKECMDGOALS)))
44
- docker_config:=$(shell ${rake} orchestration:config)
44
+ docker_config:=$(shell RAILS_ENV=development bundle exec rake orchestration:config)
45
45
  docker_organization=$(word 1,$(docker_config))
46
46
  docker_repository=$(word 2,$(docker_config))
47
47
  endif
@@ -112,7 +112,7 @@ all: build
112
112
 
113
113
  .PHONY: start
114
114
  ifndef network
115
- start: network := ${compose_project_name}_default
115
+ start: network := ${compose_project_name}
116
116
  endif
117
117
  start: _create-log-directory _clean-logs
118
118
  @$(call print,'${yellow}Starting ${cyan}${env}${yellow} containers${reset} ...')
@@ -238,6 +238,7 @@ ifndef verbose
238
238
  $(call hr,${red}) ; \
239
239
  )
240
240
  endif
241
+ ifneq (,$(findstring deploy,$(MAKECMDGOALS)))
241
242
  @echo ; \
242
243
  $(call hr,${yellow}) ; \
243
244
  $(call println,'${gray}docker-compose logs${reset}') ; \
@@ -246,6 +247,8 @@ endif
246
247
  @${compose} logs
247
248
  @echo ; \
248
249
  $(call hr,${yellow})
250
+ endif
251
+ @$(NOOP)
249
252
 
250
253
  .PHONY: image
251
254
  image:
@@ -253,45 +256,40 @@ image:
253
256
 
254
257
  ### Deployment utility commands ###
255
258
 
256
- .PHONY: bundle
257
- bundle:
258
- ifndef path
259
- @$(warning Missing `path` parameter; using `./bundle.tar`. Set a custom path with `make bundle path=/tmp/bundle.tar`)
260
- endif
261
- @rm -rf ${orchestration_dir}/.deploy/
262
- @mkdir -p ${orchestration_dir}/.deploy/${docker_repository}/
263
- @sed -e "s/%%VERSION%%/${git_version}/g" \
264
- -e "s/%%REPOSITORY%%/${docker_repository}/g" \
265
- -e "s/%%ORGANIZATION%%/${docker_organization}/g" \
266
- ${orchestration_dir}/deploy.mk > \
267
- ${orchestration_dir}/.deploy/${docker_repository}/Makefile
268
- @bundle_path="${path}" ; tar -C '${orchestration_dir}/.deploy' -cf "$${bundle_path:-./bundle.tar}" ./${docker_repository}
269
-
270
259
  .PHONY: deploy
271
- deploy: path := $(shell mktemp -d)
260
+ ifdef env_file
261
+ deploy: env_file_option = --env-file ${env_file}
262
+ endif
272
263
  deploy: RAILS_ENV := ${env}
273
264
  deploy: RACK_ENV := ${env}
274
265
  deploy: DOCKER_TAG = ${git_version}
266
+ deploy: base_vars = DOCKER_ORGANIZATION=${docker_organization} DOCKER_REPOSITORY=${docker_repository} DOCKER_TAG=${git_version}
267
+ deploy: compose_deploy := ${base_vars} COMPOSE_PROJECT_NAME=${project_base} HOST_UID=$(shell id -u) docker-compose ${env_file_option} --project-name ${project_base} -f orchestration/docker-compose.production.yml
268
+ deploy: compose_config := ${compose_deploy} config
269
+ deploy: deploy_cmd := echo "$${config}" | ssh "${manager}" "/bin/bash -lc 'cat | docker stack deploy --prune --with-registry-auth -c - ${project_base}'"
270
+ deploy: out_of_sequence_error := rpc error: code = Unknown desc = update out of sequence
271
+ deploy: retry_message := ${yellow}Detected Docker RPC error: ${red}${out_of_sequence_error}${yellow}. Retrying in
275
272
  deploy:
276
273
  ifndef manager
277
274
  @$(call println_error,'Missing `manager` parameter: `make deploy manager=swarm-manager.example.com`') ; exit 1
278
275
  endif
279
- @$(call println,'${yellow}Deploying ${green}${env}${reset} stack via${reset} ${green}${manager}${reset} ...') && \
276
+ @$(call println,'${yellow}Deploying ${green}${env} ${yellow}stack via ${green}${manager} ${yellow}as ${green}${project_base}${reset} ...') && \
280
277
  ( \
281
- $(call make,bundle path='${path}/bundle.tar') ${log} && \
282
- cd '${path}' ${log} && \
283
- tar xf 'bundle.tar' ${log} && \
284
- cd '${docker_repository}' ${log} && \
285
- ( [ -z '${env_file}' ] || cp '${env_file}' './.env' ${log} ) && \
286
- $(call println,'${yellow}Deployment environment${reset}:') && \
287
- ( test -f '.env' && cat '.env' | ${format_env} || : ) && \
288
- echo 'DOCKER_ORGANIZATION=${docker_organization}' >> './.env' && \
289
- echo 'DOCKER_REPOSITORY=${docker_repository}' >> './.env' && \
290
- echo 'DOCKER_TAG=${git_version}' >> ./.env && \
291
- $(call println,'') && \
292
- $(call println,'${yellow}Application image${reset}: ${cyan}${docker_image}${reset}') && \
293
- ${compose} config 2>${stderr} | ssh "${manager}" 'docker stack deploy --prune --with-registry-auth -c - "${project_base}"' ${log} && \
294
- ( [ -z "${path}" ] || rm -rf "${path}" ${log} ) \
278
+ $(call println,'${yellow}Deployment environment${reset}:') && \
279
+ ( test -f '${env_file}' && cat '${env_file}' | ${format_env} || : ) && \
280
+ $(call println,'') && \
281
+ $(call println,'${yellow}Application image${reset}: ${cyan}${docker_image}${reset}') && \
282
+ export config="$$(${compose_config} 2>${stderr})" ; \
283
+ config_exit_code=$$? ; \
284
+ if [[ "$${config_exit_code}" != "0" ]]; then exit ${config_exit_code}; fi ; \
285
+ output="$$(${deploy_cmd} | tee)" ; \
286
+ deploy_exit_code=$$? ; \
287
+ if [[ "$${deploy_exit_code}" == 0 ]] ; then exit 0 ; fi ; \
288
+ if ! echo "$${output}" | grep -q '${out_of_sequence_error}' ; then exit ${deploy_exit_code} ; fi ; \
289
+ retry_in="$$(( 10 + RANDOM % 50 ))" ; \
290
+ echo "${retry_message} ${green}$${retry_in} ${yellow}seconds.${reset}" ; \
291
+ sleep "$${retry_in}" ; \
292
+ ${deploy_cmd} \
295
293
  ) \
296
294
  || ${fail}
297
295
 
@@ -20,15 +20,15 @@ module Orchestration
20
20
  @settings = settings
21
21
  end
22
22
 
23
- def write(desc, message, color_name = nil, newline = true)
23
+ def write(desc, message, color_name = nil, newline: true)
24
24
  output = newline ? "#{message}\n" : message.to_s
25
- STDOUT.print colorize(desc, output, color_name)
26
- STDOUT.flush
25
+ $stdout.print colorize(desc, output, color_name)
26
+ $stdout.flush
27
27
  end
28
28
 
29
29
  def read(message, default = nil)
30
- write(:input, prompt(message, default), nil, false)
31
- result = STDIN.gets.chomp.strip
30
+ write(:input, prompt(message, default), nil, newline: false)
31
+ result = $stdin.gets.chomp.strip
32
32
  return default if result.empty?
33
33
 
34
34
  result
@@ -57,7 +57,7 @@ module Orchestration
57
57
  COLOR_MAP.fetch(color_name)
58
58
  end
59
59
 
60
- Paint[desc.to_s.rjust(15), *color] + ' ' + message
60
+ "#{Paint[desc.to_s.rjust(15), *color]} #{message}"
61
61
  end
62
62
 
63
63
  def t(key)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Orchestration
4
- VERSION = '0.5.5'
4
+ VERSION = '0.5.10'
5
5
  end
@@ -28,7 +28,7 @@ namespace :orchestration do
28
28
 
29
29
  desc I18n.t('orchestration.rake.wait')
30
30
  task :wait do
31
- Orchestration::InstallGenerator.new.verify_makefile(false)
31
+ Orchestration::InstallGenerator.new.verify_makefile(skip: false)
32
32
  env = Orchestration::Environment.new
33
33
  services = Orchestration::Services
34
34
  env.docker_compose_config['services'].each do |name, _service|
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
9
9
  spec.name = 'orchestration'
10
10
  spec.version = Orchestration::VERSION
11
11
  spec.authors = ['Bob Farrell']
12
- spec.email = ['robertanthonyfarrell@gmail.com']
12
+ spec.email = ['git@bob.frl']
13
13
 
14
14
  spec.summary = 'Docker orchestration toolkit'
15
15
  spec.description = 'Tools to help launch apps in Docker'
@@ -21,6 +21,7 @@ Gem::Specification.new do |spec|
21
21
  end
22
22
  end
23
23
 
24
+ spec.required_ruby_version = '~> 2.6'
24
25
  spec.bindir = 'bin'
25
26
  spec.executables = []
26
27
  spec.require_paths = ['lib']
@@ -32,10 +33,9 @@ Gem::Specification.new do |spec|
32
33
  spec.add_runtime_dependency 'thor', '~> 1.0'
33
34
 
34
35
  spec.add_development_dependency 'activerecord', '~> 6.0'
35
- spec.add_development_dependency 'betterp', '~> 0.1.3'
36
36
  spec.add_development_dependency 'bundler', '~> 1.16'
37
37
  spec.add_development_dependency 'bunny', '~> 2.12'
38
- spec.add_development_dependency 'byebug', '~> 10.0'
38
+ spec.add_development_dependency 'devpack', '~> 0.3.0'
39
39
  spec.add_development_dependency 'mongoid', '~> 7.0'
40
40
  spec.add_development_dependency 'mysql2', '~> 0.5.2'
41
41
  spec.add_development_dependency 'pg', '~> 1.1'
@@ -43,8 +43,8 @@ Gem::Specification.new do |spec|
43
43
  spec.add_development_dependency 'rake', '~> 10.0'
44
44
  spec.add_development_dependency 'rspec', '~> 3.0'
45
45
  spec.add_development_dependency 'rspec-its', '~> 1.2'
46
- spec.add_development_dependency 'rubocop', '~> 0.77.0'
46
+ spec.add_development_dependency 'rubocop', '~> 0.90.0'
47
47
  spec.add_development_dependency 'sqlite3', '~> 1.3'
48
- spec.add_development_dependency 'strong_versions', '~> 0.3.1'
48
+ spec.add_development_dependency 'strong_versions', '~> 0.4.5'
49
49
  spec.add_development_dependency 'webmock', '~> 3.4'
50
50
  end
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.5.5
4
+ version: 0.5.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bob Farrell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-04 00:00:00.000000000 Z
11
+ date: 2021-01-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: database_url
@@ -94,20 +94,6 @@ dependencies:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: '6.0'
97
- - !ruby/object:Gem::Dependency
98
- name: betterp
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - "~>"
102
- - !ruby/object:Gem::Version
103
- version: 0.1.3
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - "~>"
109
- - !ruby/object:Gem::Version
110
- version: 0.1.3
111
97
  - !ruby/object:Gem::Dependency
112
98
  name: bundler
113
99
  requirement: !ruby/object:Gem::Requirement
@@ -137,19 +123,19 @@ dependencies:
137
123
  - !ruby/object:Gem::Version
138
124
  version: '2.12'
139
125
  - !ruby/object:Gem::Dependency
140
- name: byebug
126
+ name: devpack
141
127
  requirement: !ruby/object:Gem::Requirement
142
128
  requirements:
143
129
  - - "~>"
144
130
  - !ruby/object:Gem::Version
145
- version: '10.0'
131
+ version: 0.3.0
146
132
  type: :development
147
133
  prerelease: false
148
134
  version_requirements: !ruby/object:Gem::Requirement
149
135
  requirements:
150
136
  - - "~>"
151
137
  - !ruby/object:Gem::Version
152
- version: '10.0'
138
+ version: 0.3.0
153
139
  - !ruby/object:Gem::Dependency
154
140
  name: mongoid
155
141
  requirement: !ruby/object:Gem::Requirement
@@ -254,14 +240,14 @@ dependencies:
254
240
  requirements:
255
241
  - - "~>"
256
242
  - !ruby/object:Gem::Version
257
- version: 0.77.0
243
+ version: 0.90.0
258
244
  type: :development
259
245
  prerelease: false
260
246
  version_requirements: !ruby/object:Gem::Requirement
261
247
  requirements:
262
248
  - - "~>"
263
249
  - !ruby/object:Gem::Version
264
- version: 0.77.0
250
+ version: 0.90.0
265
251
  - !ruby/object:Gem::Dependency
266
252
  name: sqlite3
267
253
  requirement: !ruby/object:Gem::Requirement
@@ -282,14 +268,14 @@ dependencies:
282
268
  requirements:
283
269
  - - "~>"
284
270
  - !ruby/object:Gem::Version
285
- version: 0.3.1
271
+ version: 0.4.5
286
272
  type: :development
287
273
  prerelease: false
288
274
  version_requirements: !ruby/object:Gem::Requirement
289
275
  requirements:
290
276
  - - "~>"
291
277
  - !ruby/object:Gem::Version
292
- version: 0.3.1
278
+ version: 0.4.5
293
279
  - !ruby/object:Gem::Dependency
294
280
  name: webmock
295
281
  requirement: !ruby/object:Gem::Requirement
@@ -306,7 +292,7 @@ dependencies:
306
292
  version: '3.4'
307
293
  description: Tools to help launch apps in Docker
308
294
  email:
309
- - robertanthonyfarrell@gmail.com
295
+ - git@bob.frl
310
296
  executables: []
311
297
  extensions: []
312
298
  extra_rdoc_files: []
@@ -370,7 +356,6 @@ files:
370
356
  - lib/orchestration/templates/Dockerfile.erb
371
357
  - lib/orchestration/templates/application.mk.erb
372
358
  - lib/orchestration/templates/database.yml.erb
373
- - lib/orchestration/templates/deploy.mk.erb
374
359
  - lib/orchestration/templates/entrypoint.sh.erb
375
360
  - lib/orchestration/templates/env.erb
376
361
  - lib/orchestration/templates/makefile_macros.mk.erb
@@ -392,9 +377,9 @@ require_paths:
392
377
  - lib
393
378
  required_ruby_version: !ruby/object:Gem::Requirement
394
379
  requirements:
395
- - - ">="
380
+ - - "~>"
396
381
  - !ruby/object:Gem::Version
397
- version: '0'
382
+ version: '2.6'
398
383
  required_rubygems_version: !ruby/object:Gem::Requirement
399
384
  requirements:
400
385
  - - ">="
@@ -1,69 +0,0 @@
1
- -include .env
2
- export
3
-
4
- ifneq (,$(RAILS_ENV))
5
- env:=$(RAILS_ENV)
6
- else ifneq (,$(RACK_ENV))
7
- env:=$(RACK_ENV)
8
- endif
9
-
10
- verify-environment:
11
- ifndef PUBLISH_PORT
12
- @$(error `PUBLISH_PORT` must be defined in environment)
13
- endif
14
-
15
- ifndef env
16
- @$(error Either `env`, `RACK_ENV` or `RAILS_ENV` must be defined in environment)
17
- endif
18
-
19
- project_name:=%%REPOSITORY%%_${env}
20
- compose_base:=env HOST_UID=$(shell id -u) \
21
- DOCKER_ORGANIZATION=%%ORGANIZATION%% \
22
- DOCKER_REPOSITORY=%%REPOSITORY%%:%%VERSION%% \
23
- docker-compose \
24
- -p ${project_name} \
25
- -f docker-compose.production.yml
26
-
27
- .PHONY: deploy
28
- deploy:
29
- ifndef manager
30
- @$(error Missing `manager` parameter: `make deploy manager=swarm-manager.example.com`)
31
- else
32
- @tar -cf - . | ssh ${manager} 'cd $$(mktemp -d) ; chmod 0700 . ; cat - | tar -x ; make deploy-stack ; rm -r $$(pwd)'
33
- endif
34
-
35
- .PHONY: deploy-stack
36
- deploy-stack:
37
- ${compose} config | docker stack deploy --prune --with-registry-auth -c - ${project_name}
38
-
39
- .PHONY: console
40
- service := app
41
- command := /bin/bash
42
- console:
43
- @echo "Creating temporary container..."
44
- @${compose} run --rm ${service} ${command}
45
-
46
- .PHONY: config
47
- config:
48
- @${compose} config
49
-
50
- .PHONY: pull
51
- pull:
52
- @${compose} pull
53
-
54
- .PHONY: logs
55
- logs: service := app
56
- logs:
57
- ifndef manager
58
- @$(error Missing `manager` parameter: `make logs manager=swarm-manager.example.com`)
59
- else
60
- ssh ${manager} "docker service logs -f ${project_name}_${service}"
61
- endif
62
-
63
- .PHONY: migrate
64
- migrate:
65
- @${compose} run --rm app bundle exec rake db:migrate
66
-
67
- .PHONY: compose
68
- compose:
69
- @echo ${compose}