orchestration 0.4.4 → 0.4.5
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: 04b4a99bc763cd0a467762c2299d15ba5ce96f16e2f6a49b0f084457b64ae79f
|
4
|
+
data.tar.gz: 5f1ddcbef2c012e7b6f2016e54c05e111df88b91e6983635991880b7f9b18cbd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50f67324c925ff8339fe43efe4d81ffa091a4e15c5cab207c1abf55ce8546f32cea14644ac04f4852d3a8ee3cb1606d21d4e8fb8ac4c4d3ff61a2bf98a1c48e4
|
7
|
+
data.tar.gz: af6f8845919db0b4d8f6c0ad980879357bd2946e8c34fcbeef479fd2b4e92dc1e25a238af98961ea68cc9325f0d2958ee1fae4b695488a0ed32f19ac436d7913
|
data/README.md
CHANGED
@@ -1,5 +1,11 @@
|
|
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
|
+
|
3
9
|
## Overview
|
4
10
|
|
5
11
|
_Orchestration_ aims to provide a convenient and consistent process for working with _Rails_ and _Docker_ without obscuring underlying components.
|
@@ -29,7 +35,7 @@ The below screenshot demonstrates _Orchestration_ being installed in a brand new
|
|
29
35
|
Add _Orchestration_ to your Gemfile:
|
30
36
|
|
31
37
|
```ruby
|
32
|
-
gem 'orchestration', '~> 0.4.
|
38
|
+
gem 'orchestration', '~> 0.4.5'
|
33
39
|
```
|
34
40
|
|
35
41
|
Install:
|
@@ -176,6 +182,8 @@ make test
|
|
176
182
|
|
177
183
|
Note that _Orchestration_ will wait for all services to become fully available (i.e. running and providing valid responses) before attempting to run tests. This is specifically intended to facilitate testing in continuous integration environments.
|
178
184
|
|
185
|
+
_(See [sidecar containers](#sidecar-containers) if you are running your test/development server inside _Docker_)_.
|
186
|
+
|
179
187
|
### Deployment to Docker Swarm
|
180
188
|
|
181
189
|
To deploy your application to a local _Docker Swarm_ use:
|
@@ -286,6 +294,17 @@ An [entrypoint](https://docs.docker.com/engine/reference/builder/#entrypoint) sc
|
|
286
294
|
* Adds a route `host.docker.internal` to the host machine running the container (mimicking the same route provided by _Docker_ itself on _Windows_ and _OS
|
287
295
|
X_).
|
288
296
|
|
297
|
+
<a name="sidecar-containers"></a>
|
298
|
+
## Sidecar Containers
|
299
|
+
|
300
|
+
If you need to start dependency services (databases, etc.) and connect to them from a _Docker_ container (an example use case of this would be running tests in _Jenkins_ using its _Docker_ agent) then the container that runs your tests must join the same _Docker_ network as your dependency services.
|
301
|
+
|
302
|
+
To do this automatically, pass the `sidecar` parameter to the `start` or `test` targets:
|
303
|
+
|
304
|
+
```bash
|
305
|
+
make test sidecar=1
|
306
|
+
```
|
307
|
+
|
289
308
|
<a name="rabbitmq-configuration"></a>
|
290
309
|
## RabbitMQ Configuration
|
291
310
|
|
@@ -1,8 +1,9 @@
|
|
1
1
|
FROM ruby:<%= ruby_version %>
|
2
2
|
ARG BUNDLE_BITBUCKET__ORG
|
3
3
|
ARG BUNDLE_GITHUB__COM
|
4
|
-
RUN
|
5
|
-
&& apt-get
|
4
|
+
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - \
|
5
|
+
&& apt-get update \
|
6
|
+
&& apt-get install -y nodejs gosu sendmail \
|
6
7
|
&& rm -rf /var/lib/apt/lists/* \
|
7
8
|
&& gem install bundler \
|
8
9
|
&& mkdir /app<%if defined?(Webpacker) %> \
|
@@ -62,17 +62,20 @@ all: build
|
|
62
62
|
### Container management commands ###
|
63
63
|
|
64
64
|
.PHONY: start
|
65
|
+
ifndef network
|
66
|
+
start: network := ${docker_repository}_${env}_default
|
67
|
+
endif
|
65
68
|
start: _clean-logs
|
66
69
|
@$(call print,'${yellow}Starting containers${reset} ...')
|
67
70
|
ifeq (${env},$(filter ${env},test development))
|
68
71
|
@${compose} up -d --force-recreate ${services} ${log} || ${fail}
|
69
|
-
@[ '${
|
72
|
+
@[ -n '${sidecar}' ] && \
|
70
73
|
( \
|
71
74
|
docker network connect '${network}' '$(shell hostname)' ${log} \
|
72
75
|
|| \
|
73
76
|
$(call println,'${yellow}Warning${reset}: Unable to join network: "${yellow}${network}${reset}". Container will not be able to connect to dependency services.') \
|
74
77
|
) \
|
75
|
-
|| ( [ '${
|
78
|
+
|| ( [ -z '${sidecar}' ] || ${fail} )
|
76
79
|
else
|
77
80
|
@${compose} up -d --scale app=$${instances:-1} ${services} ${log} || ${fail}
|
78
81
|
endif
|
@@ -278,7 +281,7 @@ build:
|
|
278
281
|
<% if defined?(Webpacker) %> @git show ${git_branch}:./package.json > ${orchestration_dir}/.build/package.json 2>${stderr} || ${fail}<% end %>
|
279
282
|
<% if defined?(Webpacker) %> @git show ${git_branch}:./yarn.lock > ${orchestration_dir}/.build/yarn.lock 2>${stderr} || ${fail}<% end %>
|
280
283
|
@git archive --format 'tar' -o '${context}' '${git_branch}' ${log} || ${fail}
|
281
|
-
@temp=$$(mktemp -d) ; ( cd "$${temp}" &&
|
284
|
+
@temp=$$(mktemp -d) ; ( cd "$${temp}" && tar -uvf '${context}' . ) ${log} || ${fail}
|
282
285
|
@$(call printrawln,'${green}complete.${reset} ${tick}')
|
283
286
|
@$(call print,'${yellow}Building image${reset} ...')
|
284
287
|
@docker build \
|
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.
|
4
|
+
version: 0.4.5
|
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-06-
|
11
|
+
date: 2019-06-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: database_url
|