orchestration 0.5.2 → 0.5.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90d0d9e479a7b4797751a7a6b457c613813b2c8d2df9a6b17bb11c8b26c379ff
|
4
|
+
data.tar.gz: 7812364e32a9f3289fea6e86591b46d055cfe35ab13244932bf23b8597b2f0c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee3ebbeb61d6be44d819067fb0dfcc4db27ee3a4c5c14510ca5b7313838ce853568365aebe4b7593550738834fadf5f34564c6db5bc9404669aa5f9b2e3dc4b7
|
7
|
+
data.tar.gz: ec9cfbd34b8909e7ff72887301423739c02ec96d86e2e6bece4f25cc27738fe4de6d8486d28e02e72103fadfe408b7b1cc4e61fc8b2b45060352e1ac1a45137f
|
data/README.md
CHANGED
@@ -1,13 +1,5 @@
|
|
1
1
|
# Orchestration
|
2
2
|
|
3
|
-
```
|
4
|
-
I've got two tickets to the game
|
5
|
-
It'd be great if I could take you to it this Sunday
|
6
|
-
--Nickelback
|
7
|
-
```
|
8
|
-
|
9
|
-
## Overview
|
10
|
-
|
11
3
|
_Orchestration_ aims to provide a convenient and consistent process for working with _Rails_ and _Docker_ without obscuring underlying components.
|
12
4
|
|
13
5
|
At its core _Orchestration_ is simply a `Makefile` and a set of `docker-compose.yml` files with sensible, general-purpose default settings. Users are encouraged to tailor the generated build-out to suit their application; once the build-out has been generated it belongs to the application.
|
@@ -35,7 +27,7 @@ The below screenshot demonstrates _Orchestration_ being installed in a brand new
|
|
35
27
|
Add _Orchestration_ to your Gemfile:
|
36
28
|
|
37
29
|
```ruby
|
38
|
-
gem 'orchestration', '~> 0.5.
|
30
|
+
gem 'orchestration', '~> 0.5.3'
|
39
31
|
```
|
40
32
|
|
41
33
|
Install:
|
@@ -143,7 +135,20 @@ Note that `git archive` is used to generate the build context. Any uncommitted c
|
|
143
135
|
make build
|
144
136
|
```
|
145
137
|
|
146
|
-
|
138
|
+
The `include` option can also be passed to provide a manifest file. Any files listed in this file will also be built into the _Docker_ image. Files **must** be located within the project directory.
|
139
|
+
|
140
|
+
```bash
|
141
|
+
make build include=manifest.txt
|
142
|
+
```
|
143
|
+
|
144
|
+
```bash
|
145
|
+
# manifest.txt
|
146
|
+
doc/api/swagger.json
|
147
|
+
doc/api/soap.xml
|
148
|
+
doc/api/doc.html
|
149
|
+
```
|
150
|
+
|
151
|
+
See also [build environment](#build-environment) if you use gems hosted on private _GitHub_/_Bitbucket_ repositories.
|
147
152
|
|
148
153
|
#### Push latest image
|
149
154
|
|
@@ -16,7 +16,7 @@ module Orchestration
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def run
|
19
|
-
return
|
19
|
+
return unless @service.configuration.configured?
|
20
20
|
|
21
21
|
echo_start
|
22
22
|
success = attempt_connection
|
@@ -39,14 +39,6 @@ module Orchestration
|
|
39
39
|
false
|
40
40
|
end
|
41
41
|
|
42
|
-
def echo_missing
|
43
|
-
@terminal.write(
|
44
|
-
@service_name.to_sym,
|
45
|
-
"#{@service.configuration.error} (skipping)",
|
46
|
-
:error
|
47
|
-
)
|
48
|
-
end
|
49
|
-
|
50
42
|
def echo_start
|
51
43
|
@terminal.write(@service_name.to_sym, '', :status)
|
52
44
|
end
|
@@ -87,17 +87,19 @@ restore_env:=( \
|
|
87
87
|
|
88
88
|
key_chars:=[a-zA-Z0-9_]
|
89
89
|
censored:=**********
|
90
|
-
censor=
|
91
|
-
censor_urls:=
|
92
|
-
format_env
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
90
|
+
censor=s/\(^${key_chars}*$(1)${key_chars}*\)=\(.*\)$$/\1=${censored}/
|
91
|
+
censor_urls:=s|\([a-zA-Z0-9_+]\+://.*:\).*\(@.*\)$$|\1${censored}\2|
|
92
|
+
format_env:=sed '$(call censor,SECRET); \
|
93
|
+
$(call censor,TOKEN); \
|
94
|
+
$(call censor,PRIVATE); \
|
95
|
+
$(call censor,KEY); \
|
96
|
+
$(censor_urls); \
|
97
|
+
/^\s*$$/d; \
|
98
|
+
/^\s*\#/d; \
|
99
|
+
s/\(^[a-zA-Z0-9_]\+\)=/${blue}\1${reset}=/; \
|
100
|
+
s/^/ /; \
|
101
|
+
s/=\(.*\)$$/=${yellow}\1${reset}/' | \
|
102
|
+
sort
|
101
103
|
|
102
104
|
fail=( \
|
103
105
|
$(call printraw,' ${cross}') ; \
|
@@ -74,7 +74,9 @@ else
|
|
74
74
|
compose_project_name = ${project_base}
|
75
75
|
endif
|
76
76
|
|
77
|
-
compose_base=env
|
77
|
+
compose_base=env -i \
|
78
|
+
PATH=$(PATH) \
|
79
|
+
HOST_UID=$(shell id -u) \
|
78
80
|
DOCKER_ORGANIZATION="${docker_organization}" \
|
79
81
|
DOCKER_REPOSITORY="${docker_repository}" \
|
80
82
|
COMPOSE_PROJECT_NAME="${compose_project_name}" \
|
@@ -107,7 +109,7 @@ ifndef network
|
|
107
109
|
start: network := ${compose_project_name}_default
|
108
110
|
endif
|
109
111
|
start: _clean-logs
|
110
|
-
@$(call print,'${yellow}Starting containers${reset} ...')
|
112
|
+
@$(call print,'${yellow}Starting ${cyan}${env}${yellow} containers${reset} ...')
|
111
113
|
ifeq (${env},$(filter ${env},test development))
|
112
114
|
@${compose} up --detach --force-recreate --renew-anon-volumes --remove-orphans ${services} ${log} || ${fail}
|
113
115
|
@[ -n '${sidecar}' ] && \
|
@@ -138,7 +140,7 @@ start-<%= service %>:
|
|
138
140
|
.PHONY: stop
|
139
141
|
stop: network := ${compose_project_name}_default
|
140
142
|
stop:
|
141
|
-
@$(call print,'${yellow}Stopping containers${reset} ...')
|
143
|
+
@$(call print,'${yellow}Stopping ${cyan}${env}${yellow} containers${reset} ...')
|
142
144
|
@if docker ps --format "{{.ID}}" | grep -q $(shell hostname) ; \
|
143
145
|
then \
|
144
146
|
( docker network disconnect ${network} $(shell hostname) ${log} || : ) \
|
@@ -171,7 +173,7 @@ serve:
|
|
171
173
|
then ( \
|
172
174
|
$(call println,'${yellow}Environment${reset}: ${green}${env_file}${reset}') && \
|
173
175
|
cat '${env_file}' | ${format_env} && \
|
174
|
-
$(call
|
176
|
+
$(call printrawln,'') \
|
175
177
|
) ; \
|
176
178
|
fi
|
177
179
|
${rails}
|
@@ -184,7 +186,7 @@ console:
|
|
184
186
|
then ( \
|
185
187
|
$(call println,'${yellow}Environment${reset}: ${green}${env_file}${reset}') && \
|
186
188
|
cat '${env_file}' | ${format_env} && \
|
187
|
-
$(call
|
189
|
+
$(call printrawln,'') \
|
188
190
|
) ; \
|
189
191
|
fi
|
190
192
|
${rails} console
|
@@ -210,7 +212,7 @@ endif
|
|
210
212
|
dump:
|
211
213
|
ifndef verbose
|
212
214
|
@$(call println)
|
213
|
-
@$(call println,'${yellow}Captured${reset} ${green}stdout${reset} ${yellow}and${reset} ${red}stderr${reset} ${yellow}log data${reset}:')
|
215
|
+
@$(call println,'${yellow}Captured${reset} ${green}stdout${reset} ${yellow}and${reset} ${red}stderr${reset} ${yellow}log data [${cyan}${env}${yellow}]${reset}:')
|
214
216
|
@$(call println)
|
215
217
|
@echo
|
216
218
|
@test -f '${stdout}' && ( \
|
@@ -316,7 +318,8 @@ wait-listener:
|
|
316
318
|
### Docker build commands ###
|
317
319
|
|
318
320
|
.PHONY: build
|
319
|
-
build:
|
321
|
+
build: build_dir = ${orchestration_dir}/.build
|
322
|
+
build: context = ${build_dir}/context.tar
|
320
323
|
build: check-local-changes
|
321
324
|
@$(call print,'${yellow}Preparing build context from${reset} ${cyan}${git_branch}:${git_version}${reset} ... ')
|
322
325
|
@mkdir -p ${orchestration_dir}/.build ${log} || ${fail}
|
@@ -330,6 +333,16 @@ else
|
|
330
333
|
@tar -cvf '${context}' . ${log} || ${fail}
|
331
334
|
endif
|
332
335
|
@$(call printrawln,'${green}complete.${reset} ${tick}')
|
336
|
+
ifdef include
|
337
|
+
@$(call print,'${yellow}Including files from:${reset} ${cyan}${include}${reset} ...')
|
338
|
+
@(while read line; do \
|
339
|
+
export line; \
|
340
|
+
include_dir="${build_dir}/$$(dirname "$${line}")/" && \
|
341
|
+
mkdir -p "$${include_dir}" && cp "$${line}" "$${include_dir}" \
|
342
|
+
&& (cd '${orchestration_dir}/.build/' && tar rf 'context.tar' "$${line}"); \
|
343
|
+
done < '${include}') ${log} || ${fail}
|
344
|
+
@$(call printrawln,' ${green}complete.${reset} ${tick}')
|
345
|
+
endif
|
333
346
|
ifdef sidecar
|
334
347
|
# Assume we are in a line-buffered environment (e.g. Jenkins)
|
335
348
|
@$(call println,'${yellow}Building image${reset} ...')
|
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.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: 2020-
|
11
|
+
date: 2020-07-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: database_url
|