orchestration 0.7.6 → 0.7.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +6 -0
- data/lib/orchestration/install_generator.rb +15 -4
- data/lib/orchestration/make/orchestration.mk +8 -8
- data/lib/orchestration/terminal.rb +2 -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: a7f2c48f8cea2252de2052ebe5f7f5a668b1fc61163cc08e299f14c0029dce8e
|
4
|
+
data.tar.gz: b886c269f560b78e6123285b476dd30ceee7c234a530e5ba6bbfc5eeb83b9e2a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d4e59b7abdeabc3b354b6826a5d3fcceb8f4dcdfd7ce76008e765a6a94e334a335589374ee5dca2da7ee762ffc615c9d789ad469149cdadca25408c958c986e
|
7
|
+
data.tar.gz: b17ebc5095a553993b64df89d56671cc61852d136e1dcc8c1a0217d74a4cd355d9d513401259e59143158ce91c220a765ad17083c66c596a190b10fb4904fd14
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -60,6 +60,12 @@ To rebuild all build-out at any time, pass `force=yes` to the above install comm
|
|
60
60
|
|
61
61
|
You will be prompted to enter values for your _Docker_ organisation and repository name. For example, the _organisation_ and _repository_ for https://hub.docker.com/r/rubyorchestration/sampleapp are `rubyorchestration` and `sampleapp` respectively. If you are unsure of these values, they can be modified later by editing `.orchestration.yml` in the root of your project directory.
|
62
62
|
|
63
|
+
Override these values from the command line by passing `project` and `organization` variables:
|
64
|
+
|
65
|
+
```bash
|
66
|
+
rake orchestration:install project=myapp organization=myorg
|
67
|
+
```
|
68
|
+
|
63
69
|
#### Configuration files
|
64
70
|
|
65
71
|
_Orchestration_ generates the following files where appropriate. Backups are created if a file is replaced.
|
@@ -17,10 +17,8 @@ module Orchestration
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def orchestration_configuration
|
20
|
-
|
21
|
-
@
|
22
|
-
@terminal.ask_setting('docker.repository', @env.default_app_name)
|
23
|
-
relpath = relative_path(path)
|
20
|
+
configure_orchestration_settings
|
21
|
+
relpath = relative_path(@env.orchestration_configuration_path)
|
24
22
|
return @terminal.write(:create, relpath) unless @settings.exist? || force?
|
25
23
|
return @terminal.write(:update, relpath) if @settings.dirty?
|
26
24
|
|
@@ -155,6 +153,19 @@ module Orchestration
|
|
155
153
|
healthcheck: DockerCompose::AppService.healthcheck
|
156
154
|
)
|
157
155
|
end
|
156
|
+
|
157
|
+
def configure_orchestration_settings
|
158
|
+
@terminal.ask_setting(
|
159
|
+
'docker.organization',
|
160
|
+
override: ENV.fetch('organization', nil)
|
161
|
+
)
|
162
|
+
|
163
|
+
@terminal.ask_setting(
|
164
|
+
'docker.repository',
|
165
|
+
default: @env.default_app_name,
|
166
|
+
override: ENV.fetch('project', nil)
|
167
|
+
)
|
168
|
+
end
|
158
169
|
end
|
159
170
|
# rubocop:enable Metrics/ClassLength
|
160
171
|
end
|
@@ -53,14 +53,14 @@ println=$(call print,$1'\n')
|
|
53
53
|
printraw=printf $1
|
54
54
|
stdout=${pwd}/log/orchestration.stdout.log
|
55
55
|
stderr=${pwd}/log/orchestration.stderr.log
|
56
|
-
log_path_length
|
56
|
+
log_path_length:=$(shell echo "${stdout}" | wc -c)
|
57
57
|
ifndef verbose
|
58
58
|
log_tee:= 2>&1 | tee -a ${stdout}
|
59
59
|
log:= >>${stdout} 2>>${stderr}
|
60
60
|
progress_point:=perl -e 'printf("[${magenta}busy${reset}] "); while( my $$line = <STDIN> ) { printf("."); select()->flush(); }'
|
61
61
|
log_progress:= > >(tee -ai ${stdout} >&1 | ${progress_point}) 2> >(tee -ai ${stderr} 2>&1 | ${progress_point})
|
62
62
|
endif
|
63
|
-
hr
|
63
|
+
hr:=$(call println,"$1$(shell head -c ${log_path_length} < /dev/zero | tr '\0' '=')${reset}")
|
64
64
|
managed_env_tag:=\# -|- ORCHESTRATION
|
65
65
|
standard_env_path:=${pwd}/.env
|
66
66
|
backup_env_path:=${pwd}/.env.orchestration.backup
|
@@ -190,7 +190,7 @@ else
|
|
190
190
|
compose_project_name = ${project_base}
|
191
191
|
endif
|
192
192
|
|
193
|
-
compose_base
|
193
|
+
compose_base:=env -i \
|
194
194
|
PATH=$(PATH) \
|
195
195
|
HOST_UID=$(shell id -u) \
|
196
196
|
DOCKER_ORGANIZATION="${docker_organization}" \
|
@@ -200,14 +200,14 @@ compose_base=env -i \
|
|
200
200
|
docker-compose \
|
201
201
|
-f ${orchestration_dir}/docker-compose.${env}.yml
|
202
202
|
|
203
|
-
git_branch
|
203
|
+
git_branch := $(if $(branch),$(branch),$(shell git rev-parse --abbrev-ref HEAD 2>/dev/null || echo no-branch))
|
204
204
|
ifndef dev
|
205
|
-
git_version
|
205
|
+
git_version := $(shell git rev-parse --short --verify ${git_branch} 2>/dev/null || echo no-version)
|
206
206
|
else
|
207
|
-
git_version
|
207
|
+
git_version := dev
|
208
208
|
endif
|
209
209
|
|
210
|
-
docker_image
|
210
|
+
docker_image:=${docker_organization}/${docker_repository}:${git_version}
|
211
211
|
|
212
212
|
compose=${compose_base}
|
213
213
|
compose_human=docker-compose -f ${orchestration_dir_name}/docker-compose.${env}.yml
|
@@ -315,7 +315,7 @@ db-console:
|
|
315
315
|
|
316
316
|
.PHONY: setup
|
317
317
|
ifneq (,$(wildcard config/database.yml))
|
318
|
-
setup: url
|
318
|
+
setup: url := $(shell ${rake} orchestration:db:url RAILS_ENV=${env} 2>/dev/null)
|
319
319
|
endif
|
320
320
|
setup: _log-notify
|
321
321
|
@$(call echo,Setting up ${env_human} environment)
|
@@ -39,8 +39,9 @@ module Orchestration
|
|
39
39
|
result
|
40
40
|
end
|
41
41
|
|
42
|
-
def ask_setting(setting, default
|
42
|
+
def ask_setting(setting, default: nil, override: nil)
|
43
43
|
return unless @settings.get(setting).nil?
|
44
|
+
return @settings.set(setting, override) unless override.nil?
|
44
45
|
|
45
46
|
write(:setup, t("settings.#{setting}.description"))
|
46
47
|
prompt = t("settings.#{setting}.prompt")
|
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.7.
|
4
|
+
version: 0.7.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bob Farrell
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-04-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: database_url
|