orchestration 0.5.7 → 0.5.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +13 -4
- data/lib/orchestration/docker_compose/configuration.rb +1 -0
- data/lib/orchestration/docker_compose/install_generator.rb +1 -7
- data/lib/orchestration/services/database/configuration.rb +11 -17
- data/lib/orchestration/templates/env.erb +0 -2
- data/lib/orchestration/templates/orchestration.mk.erb +4 -4
- data/lib/orchestration/templates/puma.rb.erb +1 -1
- data/lib/orchestration/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 80872dc0b6d1fe6a0e4223915a047c9ed6b3461540b64842613b4d8a0ba72f3d
|
4
|
+
data.tar.gz: b33f4a5c305fd48f952a92a4f98748d1dae64eae62d5b222b4831f80cc2dbe9f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d83d6166ce64feb661d3952431d4b26569c96568308008f0070960343cb7959847ae5217cf30e780fa0228387cdb4e4404091ac6934996492cda355eec9b932
|
7
|
+
data.tar.gz: 6c78278a30cd2489e229900560c583731e29e4f88f4309530d6ff09095d59e426d6a500896d20dadcb03eca8dfdd3786b0c68d43c7b675209d7cdf4f374acbf1
|
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.
|
30
|
+
gem 'orchestration', '~> 0.5.12'
|
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
|
-
|
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.
|
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
|
'version' => compose_config(environment).version,
|
43
43
|
'services' => services(environment),
|
44
44
|
'volumes' => volumes(environment),
|
45
|
-
'networks' =>
|
45
|
+
'networks' => compose_config(environment).networks
|
46
46
|
}
|
47
47
|
end
|
48
48
|
|
@@ -56,12 +56,6 @@ module Orchestration
|
|
56
56
|
compose_config(environment).volumes
|
57
57
|
end
|
58
58
|
|
59
|
-
def networks(environment)
|
60
|
-
return {} unless environment == :production
|
61
|
-
|
62
|
-
compose_config(environment).networks
|
63
|
-
end
|
64
|
-
|
65
59
|
def compose_config(environment)
|
66
60
|
DockerCompose::Configuration.new(
|
67
61
|
@env,
|
@@ -82,37 +82,31 @@ module Orchestration
|
|
82
82
|
end
|
83
83
|
|
84
84
|
def host
|
85
|
-
|
85
|
+
chained_config('host') || super
|
86
86
|
end
|
87
87
|
|
88
88
|
def port
|
89
89
|
return nil if sqlite?
|
90
90
|
|
91
|
-
|
91
|
+
chained_config('port') || super
|
92
92
|
end
|
93
93
|
|
94
94
|
def username
|
95
|
-
(
|
96
|
-
url_config['username'] ||
|
97
|
-
file_config['username'] ||
|
98
|
-
(adapter && adapter.credentials['username'])
|
99
|
-
)
|
95
|
+
chained_config('username') || (adapter && adapter.credentials['username'])
|
100
96
|
end
|
101
97
|
|
102
98
|
def password
|
103
|
-
(
|
104
|
-
url_config['password'] ||
|
105
|
-
file_config['password'] ||
|
106
|
-
(adapter && adapter.credentials['password'])
|
107
|
-
)
|
99
|
+
chained_config('password') || (adapter && adapter.credentials['password'])
|
108
100
|
end
|
109
101
|
|
110
102
|
def database
|
111
|
-
(
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
103
|
+
chained_config('database') || (adapter && adapter.credentials['database'])
|
104
|
+
end
|
105
|
+
|
106
|
+
def chained_config(key)
|
107
|
+
return url_config[key] || file_config[key] if @env.environment == 'test'
|
108
|
+
|
109
|
+
file_config[key] || url_config[key]
|
116
110
|
end
|
117
111
|
|
118
112
|
def adapter_by_name(name)
|
@@ -112,7 +112,7 @@ all: build
|
|
112
112
|
|
113
113
|
.PHONY: start
|
114
114
|
ifndef network
|
115
|
-
start: network := ${compose_project_name}
|
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} ...')
|
@@ -144,7 +144,7 @@ start-<%= service %>:
|
|
144
144
|
<% end %>
|
145
145
|
|
146
146
|
.PHONY: stop
|
147
|
-
stop: network := ${compose_project_name}
|
147
|
+
stop: network := ${compose_project_name}
|
148
148
|
stop:
|
149
149
|
@$(call print,'${yellow}Stopping ${cyan}${env}${yellow} containers${reset} ...')
|
150
150
|
@if docker ps --format "{{.ID}}" | grep -q $(shell hostname) ; \
|
@@ -264,7 +264,7 @@ deploy: RAILS_ENV := ${env}
|
|
264
264
|
deploy: RACK_ENV := ${env}
|
265
265
|
deploy: DOCKER_TAG = ${git_version}
|
266
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
|
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
268
|
deploy: compose_config := ${compose_deploy} config
|
269
269
|
deploy: deploy_cmd := echo "$${config}" | ssh "${manager}" "/bin/bash -lc 'cat | docker stack deploy --prune --with-registry-auth -c - ${project_base}'"
|
270
270
|
deploy: out_of_sequence_error := rpc error: code = Unknown desc = update out of sequence
|
@@ -282,7 +282,7 @@ endif
|
|
282
282
|
export config="$$(${compose_config} 2>${stderr})" ; \
|
283
283
|
config_exit_code=$$? ; \
|
284
284
|
if [[ "$${config_exit_code}" != "0" ]]; then exit ${config_exit_code}; fi ; \
|
285
|
-
output="$$(${deploy_cmd} | tee
|
285
|
+
output="$$(${deploy_cmd} | tee)" ; \
|
286
286
|
deploy_exit_code=$$? ; \
|
287
287
|
if [[ "$${deploy_exit_code}" == 0 ]] ; then exit 0 ; fi ; \
|
288
288
|
if ! echo "$${output}" | grep -q '${out_of_sequence_error}' ; then exit ${deploy_exit_code} ; fi ; \
|
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.
|
4
|
+
version: 0.5.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bob Farrell
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-01
|
11
|
+
date: 2021-02-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: database_url
|