orchestration 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2186d476519af97c595c422ec2e8e85244de7a21ba38ac57a9dac6078508147e
4
- data.tar.gz: d62c7ae58f1c20eb34e94cf0120d1ccd2dafbfa5820a4f9cdde0a36e51a4942d
3
+ metadata.gz: 7cd01f40026116b804917069fba7d1e5c44d8aeee5a544b45e0815fb62f69ed5
4
+ data.tar.gz: cc69537b606cb64b5fa681af09f629cac90c7e2d4c2d98bcf173c3306b214588
5
5
  SHA512:
6
- metadata.gz: 3c04057ada42ee20e573629778b56c4b35fc160325e1314e5055e30931b4e21c6948b1cdde40b6d0aff56e5076e708fd07af8ef55322d812f9b555f6ee7dbb03
7
- data.tar.gz: 60a0c33ee614f8fb71a5feaae10e5788bd9f5cd8b45fbeb2a39b7cdcad0aa870bb5d61464a06c5478229a7ebf1f96a1a226ed0ff4ef0dc69280e0a617731310c
6
+ metadata.gz: 9ac9f6b9d04f74ed0cdea5e653296b300f9e1c04184340ede3dbb4a1e726ab4c32e2b3f6bc4e3bdddfc79315d2eaa8cb0ab1fe8877a3131f55179ca787268d86
7
+ data.tar.gz: a66c75b212e0992130b1e289781d516fe5b4be7bd5176c1a9a91c86bf927a9853ee8da7ed26192ecbf307d6cb66aa16dd579b5dd370bdd8e4f598df1b4d7ec38
data/.gitignore CHANGED
@@ -2,7 +2,6 @@
2
2
  /.yardoc
3
3
  /_yardoc/
4
4
  /coverage/
5
- /doc/
6
5
  /pkg/
7
6
  /spec/reports/
8
7
  /tmp/
data/MANIFEST CHANGED
@@ -15,6 +15,7 @@ bin/rubocop
15
15
  bin/setup
16
16
  bin/strong_versions
17
17
  config/locales/en.yml
18
+ doc/images/example.png
18
19
  lib/Rakefile
19
20
  lib/orchestration.rb
20
21
  lib/orchestration/docker_compose.rb
data/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  _Orchestration_ aims to provide a convenient and consistent process for working with _Rails_ and _Docker_ without obscuring underlying components.
6
6
 
7
- At its core _Orchestration_ is just 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.
7
+ 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.
8
8
 
9
9
  A typical _Rails_ application can be tested, built, pushed to _Docker Hub_, and deployed to _Docker Swarm_ with the following commands:
10
10
 
@@ -13,6 +13,13 @@ make test build push
13
13
  make deploy manager=user@swarm.example.com env_file=/var/configs/myapp.env
14
14
  ```
15
15
 
16
+ _Orchestration_ has been successfully used to build continuous delivery pipelines for numerous production applications with a wide range or requirements.
17
+
18
+ ## Example
19
+
20
+ The below screenshot demonstrates _Orchestration_ being installed in a brand new _Rails_ application with support for _PostgreSQL_ (via the _PG_ gem) and _RabbitMQ_ (via the _Bunny_ gem):
21
+ ![example](doc/images/example.png "https://hub.docker.com/r/rubyorchestration/sampleapp/tags")
22
+
16
23
  ## Getting Started
17
24
 
18
25
  [_Docker_](https://www.docker.com/get-started) and [_Docker Compose_](https://docs.docker.com/compose/install/) must be installed on your system.
@@ -43,7 +50,7 @@ rake orchestration:install server=unicorn # (or 'puma' [default], etc.)
43
50
 
44
51
  To rebuild all build-out at any time, pass `force=yes` to the above install command.
45
52
 
46
- 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/redislabs/redis/ are `redislabs` and `redis` respectively. If you are unsure of these values, they can be modified later by editing `.orchestration.yml` in the root of your project directory.
53
+ 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.
47
54
 
48
55
  #### Configuration files
49
56
 
@@ -51,7 +58,7 @@ _Orchestration_ generates the following files where appropriate. Backups are cre
51
58
 
52
59
  * `config/database.yml`
53
60
  * `config/mongoid.yml`
54
- * `config/rabbitmq.yml` (see [RabbitMQ Configuration](#markdown-header-rabbitmq-configuration) for more details)
61
+ * `config/rabbitmq.yml` (see [RabbitMQ Configuration](#rabbitmq-configuration) for more details)
55
62
  * `config/unicorn.rb`
56
63
  * `config/puma.rb`
57
64
 
@@ -125,7 +132,7 @@ Note that `git archive` is used to generate the build context. Any uncommitted c
125
132
  make build
126
133
  ```
127
134
 
128
- See [build environment](#markdown-header-build-environment) for more details.
135
+ See [build environment](#build-environment) for more details.
129
136
 
130
137
  #### Push latest image
131
138
 
@@ -191,8 +198,23 @@ CONTAINER_PORT=3000
191
198
  REPLICAS=5
192
199
  ```
193
200
 
194
- It is also recommended to set `SECRET_KEY_BASE` etc. in this file.
201
+ It is also recommended to set `SECRET_KEY_BASE`, `DATABASE_URL` etc. in this file.
202
+
203
+ ## Logs
204
+
205
+ The output from most underlying components is hidden in an effort to make continuous integration pipelines clear and concise. All output is retained in `log/orchestration.stdout.log` and `log/orchestration.stderr.log`. i.e. to view all output during a build:
206
+
207
+ ```bash
208
+ tail -f log/orchestration*.log
209
+ ```
195
210
 
211
+ A convenience `Makefile` target `dump` is provided which will output all consumed _stdout_ and _stderr_:
212
+
213
+ ```bash
214
+ make dump
215
+ ```
216
+
217
+ <a name="build-environment"></a>
196
218
  ## Build Environment
197
219
 
198
220
  The following environment variables will be passed as `ARG` variables when building images:
@@ -231,6 +253,12 @@ get '/healthcheck', to: proc { [200, { 'Content-Type' => 'text/html' }, ['']] }
231
253
 
232
254
  In this case, `WEB_HEALTHCHECK_PATH` must be set to `/healthcheck`.
233
255
 
256
+ ## Dockerfile
257
+
258
+ A `Dockerfile` is automatically generated based on detected dependencies, required build steps, _Ruby_ version, etc.
259
+
260
+ Real-world applications will inevitably need to make changes to this file. As with all _Orchestration_ build-out, the provided `Dockerfile` should be treated as a starting point and customisations should be applied as needed.
261
+
234
262
  ## Entrypoint
235
263
 
236
264
  An [entrypoint](https://docs.docker.com/engine/reference/builder/#entrypoint) script for your application is provided which does the following:
@@ -240,6 +268,7 @@ An [entrypoint](https://docs.docker.com/engine/reference/builder/#entrypoint) sc
240
268
  * 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
241
269
  X_).
242
270
 
271
+ <a name="rabbitmq-configuration"></a>
243
272
  ## RabbitMQ Configuration
244
273
 
245
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.:
Binary file
@@ -5,6 +5,3 @@ CONTAINER_PORT=3000
5
5
  # Use this setting to control the number of replicas to create for your
6
6
  # application service:
7
7
  REPLICAS=1
8
-
9
- # Development database:
10
- DATABASE_URL=<%= env.database_url %>
@@ -64,7 +64,7 @@ all: build
64
64
  start: _clean-logs
65
65
  @$(call print,'${yellow}Starting containers${reset} ...')
66
66
  ifeq (${env},$(filter ${env},test development))
67
- @${compose} up -d --force-recreate ${services} ${log_progress} || ${fail}
67
+ @${compose} up -d --force-recreate ${services} ${log} || ${fail}
68
68
  @[ '${is_container}' == '1' ] && \
69
69
  ( \
70
70
  docker network connect '${network}' '$(shell hostname)' ${log} \
@@ -73,7 +73,7 @@ ifeq (${env},$(filter ${env},test development))
73
73
  ) \
74
74
  || ( [ '${is_container}' == '0' ] || ${fail} )
75
75
  else
76
- @${compose} up -d --scale app=$${instances:-1} ${services} ${log_progress} || ${fail}
76
+ @${compose} up -d --scale app=$${instances:-1} ${services} ${log} || ${fail}
77
77
  endif
78
78
  @$(call printrawln,' ${green}started${reset} ${tick}')
79
79
  @$(call println,'${yellow}Waiting for services to become available${reset} ...')
@@ -95,11 +95,11 @@ stop: _clean-logs
95
95
  @$(call print,'${yellow}Stopping containers${reset} ...')
96
96
  @if docker ps --format "{{.ID}}" | grep -q $(shell hostname) ; \
97
97
  then \
98
- ( ${compose} down ${log_progress} || ${fail} ) \
98
+ ( ${compose} down ${log} || ${fail} ) \
99
99
  && \
100
100
  ( docker network connect ${docker_repository}_${env}_default $(shell hostname) ${log} || : ) ; \
101
101
  else \
102
- ${compose} down ${log_progress} || ${fail} ; \
102
+ ${compose} down ${log} || ${fail} ; \
103
103
  fi
104
104
  @$(call printrawln,' ${green}stopped${reset}. ${tick}')
105
105
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Orchestration
4
- VERSION = '0.4.0'
4
+ VERSION = '0.4.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: orchestration
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bob Farrell
@@ -333,6 +333,7 @@ files:
333
333
  - bin/setup
334
334
  - bin/strong_versions
335
335
  - config/locales/en.yml
336
+ - doc/images/example.png
336
337
  - lib/Rakefile
337
338
  - lib/orchestration.rb
338
339
  - lib/orchestration/docker_compose.rb