orchestration 0.4.1 → 0.4.3

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: 7cd01f40026116b804917069fba7d1e5c44d8aeee5a544b45e0815fb62f69ed5
4
- data.tar.gz: cc69537b606cb64b5fa681af09f629cac90c7e2d4c2d98bcf173c3306b214588
3
+ metadata.gz: 0cb5ae60827d78174136105aa5d569442403e0c66fbd91b52dc1fa960d54b901
4
+ data.tar.gz: ebc464ac7f85474af8cd888571583f863d2a0ffe6629190e8a6d412e6abc20dd
5
5
  SHA512:
6
- metadata.gz: 9ac9f6b9d04f74ed0cdea5e653296b300f9e1c04184340ede3dbb4a1e726ab4c32e2b3f6bc4e3bdddfc79315d2eaa8cb0ab1fe8877a3131f55179ca787268d86
7
- data.tar.gz: a66c75b212e0992130b1e289781d516fe5b4be7bd5176c1a9a91c86bf927a9853ee8da7ed26192ecbf307d6cb66aa16dd579b5dd370bdd8e4f598df1b4d7ec38
6
+ metadata.gz: 20653aa7ed7ee911d562cab05df0184525655af43a156082840a2052ed687575cd46c8a34fc975721fb97eaea0899c4b7e9d0244e6af67531905f91f6fdef569
7
+ data.tar.gz: 9aa560232ac183ba7368c23109e17d382f6483c1f125fbf155f3f8a58eddf25f1cf626ac85581ca1dbe0b8e0dfb3110774b3ca549890a816c7e90e0c17423617
data/.gitignore CHANGED
@@ -30,3 +30,5 @@ TODO
30
30
 
31
31
  docker/.build/
32
32
  docker/.context.tar
33
+
34
+ .DS_Store
data/README.md CHANGED
@@ -29,7 +29,7 @@ The below screenshot demonstrates _Orchestration_ being installed in a brand new
29
29
  Add _Orchestration_ to your Gemfile:
30
30
 
31
31
  ```ruby
32
- gem 'orchestration', '~> 0.4.0'
32
+ gem 'orchestration', '~> 0.4.3'
33
33
  ```
34
34
 
35
35
  Install:
@@ -237,9 +237,9 @@ See related documentation:
237
237
 
238
238
  | Variable | Meaning | Default Value |
239
239
  |-|-|-|
240
- | `WEB_HOST` | Host to reach application (relevant to application container) | `localhost` |
241
- | `WEB_PORT` | Port to reach application (relevant to application container) | `8080` |
242
- | `WEB_HEALTHCHECK_PATH` | Path of expected successful response | `/` |
240
+ | `WEB_HOST` | Host to reach application (from inside application container) | `localhost` |
241
+ | `WEB_PORT` | Port to reach application (from inside application container) | `8080` |
242
+ | `WEB_HEALTHCHECK_PATH` | Path expected to return a successful response | `/` |
243
243
  | `WEB_HEALTHCHECK_READ_TIMEOUT` | Number of seconds to wait for data before failing healthcheck | `10` |
244
244
  | `WEB_HEALTHCHECK_OPEN_TIMEOUT` | Number of seconds to wait for connection before failing healthcheck | `10` |
245
245
  | `WEB_HEALTHCHECK_SUCCESS_CODES` | Comma-separated list of HTTP status codes that will be deemed a success | `200,202,204` |
@@ -271,14 +271,27 @@ An [entrypoint](https://docs.docker.com/engine/reference/builder/#entrypoint) sc
271
271
  <a name="rabbitmq-configuration"></a>
272
272
  ## RabbitMQ Configuration
273
273
 
274
- The [Bunny](https://github.com/ruby-amqp/bunny) _RabbitMQ_ gem does not recognise `config/rabbitmq.yml`. If your application uses _RabbitMQ_ then you must manually update your code to reference this file, e.g.:
274
+ The [Bunny](https://github.com/ruby-amqp/bunny) _RabbitMQ_ gem does not recognise `config/rabbitmq.yml` or `RABBITMQ_URL`. If your application uses _RabbitMQ_ then you must manually update your code to reference this file, e.g.:
275
275
 
276
276
  ```ruby
277
277
  connection = Bunny.new(config_for(:rabbit_mq)['url'])
278
278
  connection.start
279
279
  ```
280
280
 
281
- The environment variable `RABBITMQ_URL` can be used to configure _Bunny_ in production (similar to `DATABASE_URL` and `MONGO_URL`).
281
+ _Orchestration_ generates the following `config/rabbitmq.yml`:
282
+
283
+ ```
284
+ development:
285
+ url: amqp://127.0.0.1:51070
286
+
287
+ test:
288
+ url: amqp://127.0.0.1:51068
289
+
290
+ production:
291
+ url: <%= ENV['RABBITMQ_URL'] %>
292
+ ```
293
+
294
+ Using this approach, the environment variable `RABBITMQ_URL` can be used to configure _Bunny_ in production (similar to `DATABASE_URL` and `MONGO_URL`).
282
295
 
283
296
  This is a convention of the _Orchestration_ gem intended to make _RabbitMQ_ configuration consistent with other services.
284
297
 
@@ -60,10 +60,9 @@ module Orchestration
60
60
  return @terminal.write(:skip, relative_path(path))
61
61
  end
62
62
 
63
+ backup(path, previous_content) if options.fetch(:backup, false)
63
64
  File.write(path, content)
64
65
  @terminal.write(:update, relative_path(path))
65
-
66
- backup(path, previous_content) if options.fetch(:backup, false)
67
66
  end
68
67
 
69
68
  def skip?(present, content, previous_content, options)
@@ -75,6 +74,8 @@ module Orchestration
75
74
  end
76
75
 
77
76
  def backup(path, previous_content)
77
+ return if previous_content.nil?
78
+
78
79
  backup_path = Pathname.new("#{path}.bak")
79
80
  File.write(backup_path, previous_content)
80
81
  @terminal.write(:backup, relative_path(backup_path))
@@ -32,7 +32,8 @@ else
32
32
  endif
33
33
 
34
34
  ifneq (,$(wildcard ${env_file}))
35
- rake=. ${env_file} && ${rake}
35
+ rake_cmd:=${rake}
36
+ rake=. ${env_file} && ${rake_cmd}
36
37
  endif
37
38
 
38
39
  docker_organization=$(shell bash ${orchestration_dir}/yaml.bash docker_organization)
@@ -201,11 +202,11 @@ endif
201
202
 
202
203
  .PHONY: deploy
203
204
  ifndef manager
204
- @$(call println_error,'Missing `manager` parameter: `make deploy manager=swarm-manager.example.cor`')
205
+ @$(call println_error,'Missing `manager` parameter: `make deploy manager=swarm-manager.example.com`')
205
206
  endif
206
207
  deploy: env := production
207
208
  deploy: project_name = ${docker_repository}_${env}
208
- deploy: path = $(shell mktemp -d)
209
+ deploy: path := $(shell mktemp -d)
209
210
  deploy: RAILS_ENV = ${env}
210
211
  deploy: RACK_ENV = ${env}
211
212
  deploy: DOCKER_TAG = ${git_version}
@@ -215,7 +216,7 @@ deploy:
215
216
  $(call make,_verify_compose env_file=${env_file} env=${env}) && \
216
217
  $(call make,bundle path='${path}/bundle.tar') ${log} && \
217
218
  cd '${path}' ${log} && \
218
- tar xf './bundle.tar' ${log} && \
219
+ tar xf 'bundle.tar' ${log} && \
219
220
  cd '${docker_repository}' ${log} && \
220
221
  ( [ -z '${env_file}' ] || cp '${env_file}' './.env' ${log} ) && \
221
222
  $(call println,'${yellow}Deployment environment${reset}:') && \
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Orchestration
4
- VERSION = '0.4.1'
4
+ VERSION = '0.4.3'
5
5
  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.4.1
4
+ version: 0.4.3
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-05-26 00:00:00.000000000 Z
11
+ date: 2019-05-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: database_url