minke 0.16.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/.codeclimate.yml +7 -0
- data/.gitignore +1 -0
- data/.ruby-version +1 -1
- data/.travis.yml +4 -1
- data/Gemfile +5 -0
- data/Guardfile +70 -0
- data/README.md +12 -9
- data/bin/minke +48 -0
- data/examples/config_go.yml +44 -25
- data/lib/minke/config/config.rb +326 -0
- data/lib/minke/config/reader.rb +94 -0
- data/lib/minke/docker/docker_compose.rb +53 -0
- data/lib/minke/docker/docker_runner.rb +123 -0
- data/lib/minke/docker/service_discovery.rb +24 -0
- data/lib/minke/docker/system_runner.rb +16 -0
- data/lib/minke/generators/config.rb +106 -0
- data/lib/minke/generators/config_processor.rb +47 -0
- data/lib/minke/generators/config_variables.rb +23 -0
- data/lib/minke/generators/processor.rb +131 -0
- data/lib/minke/generators/register.rb +19 -0
- data/lib/minke/helpers/helper.rb +68 -0
- data/lib/minke/rake/app.rake +50 -198
- data/lib/minke/rake/config.rake +1 -5
- data/lib/minke/rake/docker.rake +7 -5
- data/lib/minke/tasks/build.rb +17 -0
- data/lib/minke/tasks/build_image.rb +13 -0
- data/lib/minke/tasks/cucumber.rb +34 -0
- data/lib/minke/tasks/fetch.rb +16 -0
- data/lib/minke/tasks/push.rb +22 -0
- data/lib/minke/tasks/run.rb +23 -0
- data/lib/minke/tasks/task.rb +107 -0
- data/lib/minke/tasks/test.rb +17 -0
- data/lib/minke/version.rb +1 -1
- data/lib/minke.rb +33 -9
- data/minke.gemspec +16 -11
- metadata +84 -9
- data/lib/minke/commands/go.rb +0 -27
- data/lib/minke/commands/swift.rb +0 -32
- data/lib/minke/docker.rb +0 -122
- data/lib/minke/docker_compose.rb +0 -31
- data/lib/minke/helpers.rb +0 -56
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ODY0MTRkNGJkNjIzNWVjZWExZGI3YzEzZTg5NWU2NmY1MTNjN2Q3NQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NjU0M2JjMjMzNDUyNGFlOTg5ODE3ZTE3NzYyM2E5NDhhNDBlOGJjNA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NWY0NjJiZmIxYmI3NGNkMDk3ZDIzNTEwZTc1M2NjNGJjMjA3OTVmNTNhMTlj
|
10
|
+
YzVmZjFmMTRlNDI5ZGMyYTk1NDY4Yzg4Y2E0ZmQwZTE2Mjk1Njg3ZGY1OWQ2
|
11
|
+
NDc1N2NmMGI4NzNiNDFlZWQ4YWVjNjMyYmI1OGI5Y2ZjMzBkNjc=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MzVhM2U2Njc3OWVjMDc4MTY4ZjJiMDIxNzNhZjcyZGVlNDQzZWZkMGU1MjY5
|
14
|
+
YWNhZGIxZjg0ZDNjYTk1ZTk1ZmRlN2NmYWI2MzM3Yzc2MTEyMDU0YjI4ODM4
|
15
|
+
NTAwMDhmZmZkNWE4NzNiOTBjOGU1ZjZkMWVhNmM1ZGE2MGQ5Y2E=
|
data/.codeclimate.yml
ADDED
data/.gitignore
CHANGED
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.3.1
|
data/.travis.yml
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
language: ruby
|
2
2
|
rvm:
|
3
|
-
- 2.
|
3
|
+
- 2.3.1
|
4
|
+
env:
|
5
|
+
global:
|
6
|
+
secure: "ND69gJ0h5JB0I7mogcjIwAr+3lc815M0L9i9xg7CKVdtMKyuLIT/QKoqAJ9ivnYCapnRrxweRco82VlrFz6hru5phhEiCHLLmdyYngZcjVOnTWVLanc9juQ+cz/65lqJl7MbwZxKbdurh4/2FzGoTCMdjIYzMDk+pT0hHHiZ+8p492mj0hdglGX1WfoQJvIsvR94jy+JEDsjzlB6odk+uhD2qlhK0/k2UDG8tlbEPp/zf2dvonhud3TmdvkiVTNKPS1kpB1BJCwkhNfg7ZRKkt0FMMR/g1GAfHlRE/FiUaVCyurUaUVnfAUvhuGZ28XhHotRCogP6YV6hkpWy7wyelool4c+CzSho4cdEwNFiNXME5wbpMUiZN5w9YTBBK11u2uPrhw2tUvJtjNQdvvKKdQw404hPcVaLsGaviK3G6qC1huo3kRQW51HgBF8J99+icCDgTyM+m+iJrQwCGU+darpv/ozpczoM9avE6EOF1Nu+35iRAdu5o4KR4k5EDf7AlXck1B0n5aAYj7t624cVKIF9vusOq7nmT63N8m37ZBWz09aAHasW0bm6ReB6+uOFM776Umh3/A6hr0zYrqiaQuk1zw2PNR5twvrqSLqEAwEK9ozROe3bWMdFlZhoCWNzaKNqMCt0O8B1k5xPClx3uhI63XeykxMWMDFLfvQNtw="
|
4
7
|
install: bundle
|
5
8
|
script:
|
6
9
|
- rake test
|
data/Gemfile
CHANGED
@@ -2,3 +2,8 @@ source 'https://rubygems.org'
|
|
2
2
|
|
3
3
|
# Specify your gem's dependencies in go_builder.gemspec
|
4
4
|
gemspec
|
5
|
+
|
6
|
+
gem "codeclimate-test-reporter", group: :test, require: nil
|
7
|
+
#gem 'minke-generator-go', :path => '/Users/nicj/Developer/gems/minke-generator-go'
|
8
|
+
#gem 'minke-generator-node', :path => '/Users/nicj/Developer/gems/minke-generator-node'
|
9
|
+
#gem 'minke-generator-spring', :github => 'notonthehighstreet/minke-generator-spring', :branch => 'master'
|
data/Guardfile
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
# A sample Guardfile
|
2
|
+
# More info at https://github.com/guard/guard#readme
|
3
|
+
|
4
|
+
## Uncomment and set this to only include directories you want to watch
|
5
|
+
# directories %w(app lib config test spec features) \
|
6
|
+
# .select{|d| Dir.exists?(d) ? d : UI.warning("Directory #{d} does not exist")}
|
7
|
+
|
8
|
+
## Note: if you are using the `directories` clause above and you are not
|
9
|
+
## watching the project directory ('.'), then you will want to move
|
10
|
+
## the Guardfile to a watched dir and symlink it back, e.g.
|
11
|
+
#
|
12
|
+
# $ mkdir config
|
13
|
+
# $ mv Guardfile config/
|
14
|
+
# $ ln -s config/Guardfile .
|
15
|
+
#
|
16
|
+
# and, you'll have to watch "config/Guardfile" instead of "Guardfile"
|
17
|
+
|
18
|
+
# Note: The cmd option is now required due to the increasing number of ways
|
19
|
+
# rspec may be run, below are examples of the most common uses.
|
20
|
+
# * bundler: 'bundle exec rspec'
|
21
|
+
# * bundler binstubs: 'bin/rspec'
|
22
|
+
# * spring: 'bin/rspec' (This will use spring if running and you have
|
23
|
+
# installed the spring binstubs per the docs)
|
24
|
+
# * zeus: 'zeus rspec' (requires the server to be started separately)
|
25
|
+
# * 'just' rspec: 'rspec'
|
26
|
+
|
27
|
+
guard :rspec, cmd: "bundle exec rspec", failed_mode: :focus do
|
28
|
+
require "guard/rspec/dsl"
|
29
|
+
dsl = Guard::RSpec::Dsl.new(self)
|
30
|
+
|
31
|
+
# Feel free to open issues for suggestions and improvements
|
32
|
+
|
33
|
+
# RSpec files
|
34
|
+
rspec = dsl.rspec
|
35
|
+
watch(rspec.spec_helper) { rspec.spec_dir }
|
36
|
+
watch(rspec.spec_support) { rspec.spec_dir }
|
37
|
+
watch(rspec.spec_files)
|
38
|
+
|
39
|
+
# Ruby files
|
40
|
+
ruby = dsl.ruby
|
41
|
+
dsl.watch_spec_files_for(ruby.lib_files)
|
42
|
+
|
43
|
+
# Rails files
|
44
|
+
rails = dsl.rails(view_extensions: %w(erb haml slim))
|
45
|
+
dsl.watch_spec_files_for(rails.app_files)
|
46
|
+
dsl.watch_spec_files_for(rails.views)
|
47
|
+
|
48
|
+
watch(rails.controllers) do |m|
|
49
|
+
[
|
50
|
+
rspec.spec.("routing/#{m[1]}_routing"),
|
51
|
+
rspec.spec.("controllers/#{m[1]}_controller"),
|
52
|
+
rspec.spec.("acceptance/#{m[1]}")
|
53
|
+
]
|
54
|
+
end
|
55
|
+
|
56
|
+
# Rails config changes
|
57
|
+
watch(rails.spec_helper) { rspec.spec_dir }
|
58
|
+
watch(rails.routes) { "#{rspec.spec_dir}/routing" }
|
59
|
+
watch(rails.app_controller) { "#{rspec.spec_dir}/controllers" }
|
60
|
+
|
61
|
+
# Capybara features specs
|
62
|
+
watch(rails.view_dirs) { |m| rspec.spec.("features/#{m[1]}") }
|
63
|
+
watch(rails.layouts) { |m| rspec.spec.("features/#{m[1]}") }
|
64
|
+
|
65
|
+
# Turnip features and steps
|
66
|
+
watch(%r{^spec/acceptance/(.+)\.feature$})
|
67
|
+
watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) do |m|
|
68
|
+
Dir[File.join("**/#{m[1]}.feature")][0] || "spec/acceptance"
|
69
|
+
end
|
70
|
+
end
|
data/README.md
CHANGED
@@ -1,20 +1,23 @@
|
|
1
1
|
# Minke
|
2
2
|
|
3
|
+
[![Join the chat at https://gitter.im/nicholasjackson/minke](https://badges.gitter.im/nicholasjackson/minke.svg)](https://gitter.im/nicholasjackson/minke?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
4
|
+
|
3
5
|
## NOTE:
|
4
|
-
Version
|
6
|
+
Version 1 is pretty much a complete rewrite which supports new generator plugins to scaffold applications and greater compatibility for running docker compose on CI environments. Documentation is coming soon (as in hopefully tomorrow), but for the moment I apologize but the documentation below is a little out of date.
|
7
|
+
|
8
|
+
Version 1.0 is not compatible with previous versions of minke however upgrading is not so painful, full instructions will be updated shortly. In the mean time please continue to use the previous stable 0.1.5 [https://github.com/nicholasjackson/minke/tree/0.1.5](https://github.com/nicholasjackson/minke/tree/0.1.5).
|
5
9
|
|
6
|
-
**Version
|
10
|
+
**Version 1.0**
|
7
11
|
[![Build Status](https://travis-ci.org/nicholasjackson/minke.svg?branch=master)](https://travis-ci.org/nicholasjackson/minke)
|
8
12
|
|
9
13
|
Minke is an opinionated build system for Microservices and Docker, like a little envelope of quality it scaffolds the build, run and test (unit test and functional tests) phases of your microservice project allowing you to simply run and test your images using Docker Compose. Currently supporting Google's Go, and experimental support for Swift, extensions are planned for Node.js or HTML / Javascript sites with Grunt or Gulp based builds.
|
10
14
|
|
11
|
-
##
|
12
|
-
- Go
|
13
|
-
-
|
14
|
-
|
15
|
-
|
16
|
-
-
|
17
|
-
- Java
|
15
|
+
## Generators
|
16
|
+
- Go - Go Microservice Template
|
17
|
+
- Java - Spring Boot
|
18
|
+
- Swift - Kitura (Coming Soon)
|
19
|
+
- Node - ExpressJS (Coming Soon)
|
20
|
+
- Ruby - Rails (Coming Soon)
|
18
21
|
|
19
22
|
## Installation
|
20
23
|
|
data/bin/minke
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'optparse'
|
3
|
+
require 'minke'
|
4
|
+
|
5
|
+
ASCII_ART = <<eos
|
6
|
+
888b d888 d8b 888
|
7
|
+
8888b d8888 Y8P 888
|
8
|
+
88888b.d88888 888
|
9
|
+
888Y88888P888 888 88888b. 888 888 .d88b.
|
10
|
+
888 Y888P 888 888 888 "88b 888 .88P d8P Y8b
|
11
|
+
888 Y8P 888 888 888 888 888888K 88888888
|
12
|
+
888 " 888 888 888 888 888 "88b Y8b.
|
13
|
+
888 888 888 888 888 888 888 "Y8888
|
14
|
+
eos
|
15
|
+
|
16
|
+
puts ""
|
17
|
+
puts ASCII_ART
|
18
|
+
puts ""
|
19
|
+
puts "Version: #{Minke::VERSION}"
|
20
|
+
puts ""
|
21
|
+
|
22
|
+
options = {}
|
23
|
+
OptionParser.new do |opts|
|
24
|
+
opts.banner = "Usage: example.rb [options]"
|
25
|
+
|
26
|
+
opts.on('-g', '--generator GENERATOR', 'Generator plugin to use') { |v| options[:generator] = v }
|
27
|
+
opts.on('-o', '--output OUTPUT', 'Output folder') { |v| options[:output] = v }
|
28
|
+
opts.on('-a', '--application_name NAME', 'Application name') { |v| options[:name] = v }
|
29
|
+
opts.on('-n', '--namespace NAMESPACE', 'Application namespace') { |v| options[:namespace] = v }
|
30
|
+
|
31
|
+
end.parse!
|
32
|
+
|
33
|
+
# load the installed generators
|
34
|
+
variables = Minke::Generators::ConfigVariables.new.tap do |v|
|
35
|
+
v.application_name = options[:name]
|
36
|
+
v.namespace = options[:namespace]
|
37
|
+
v.src_root = File.expand_path(options[:output]) unless options[:output] == nil
|
38
|
+
end
|
39
|
+
processor = Minke::Generators::Processor.new variables
|
40
|
+
processor.load_generators
|
41
|
+
|
42
|
+
|
43
|
+
if options[:generator] == nil || options[:output] == nil || options[:name] == nil || options[:namespace] == nil
|
44
|
+
puts "Please specify options use: minke --help for help on command line options"
|
45
|
+
exit 0
|
46
|
+
end
|
47
|
+
|
48
|
+
processor.process options[:generator], options[:output]
|
data/examples/config_go.yml
CHANGED
@@ -1,7 +1,5 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
application_name: 'event-sauce'
|
4
|
-
comand: '/usr/local/go/bin/go'
|
1
|
+
namespace: 'github.com/nicholasjackson'
|
2
|
+
application_name: 'event-sauce'
|
5
3
|
docker_registry:
|
6
4
|
url: <%= ENV['DOCKER_REGISTRY_URL'] %>
|
7
5
|
user: <%= ENV['DOCKER_REGISTRY_USER'] %>
|
@@ -9,26 +7,47 @@ docker_registry:
|
|
9
7
|
email: <%= ENV['DOCKER_REGISTRY_EMAIL'] %>
|
10
8
|
namespace: <%= ENV['DOCKER_NAMESPACE'] %>
|
11
9
|
docker:
|
12
|
-
|
13
|
-
|
10
|
+
build_image: [optional]
|
11
|
+
build_docker_file: [optional]
|
12
|
+
application_docker_file: './dockerfiles/event-sauce/Dockerfile'
|
13
|
+
application_compose_file: './dockercompose/event-sauce/docker-compose.yml'
|
14
|
+
fetch:
|
15
|
+
include: true
|
16
|
+
build:
|
17
|
+
pre:
|
18
|
+
tasks:
|
19
|
+
-
|
20
|
+
copy_assets:
|
21
|
+
-
|
22
|
+
docker:
|
23
|
+
application_compose_file: './dockercompose/event-sauce/docker-compose.yml'
|
24
|
+
post:
|
25
|
+
tasks:
|
26
|
+
-
|
27
|
+
copy:
|
28
|
+
-
|
29
|
+
from: <%= "#{ENV['GOPATH']}/src/github.com/nicholasjackson/event-sauce/event-sauce" %>
|
30
|
+
to: './docker/event-sauce'
|
31
|
+
-
|
32
|
+
from: './swagger_spec/swagger.yml'
|
33
|
+
to: './dockerfile/event-sauce/swagger_spec/swagger.yml'
|
14
34
|
run:
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
35
|
+
pre:
|
36
|
+
consul_loader:
|
37
|
+
config_file: './config.yml'
|
38
|
+
url: http://<%= get_public_server_for 'test2:9500' %> # specifying the url as a coompose server name and private port will auto resolve
|
39
|
+
docker:
|
40
|
+
application_compose_file: './dockercompose/event-sauce/docker-compose-alternate.yml'
|
41
|
+
post:
|
42
|
+
tasks:
|
43
|
+
- wait_for_elastic_search
|
19
44
|
cucumber:
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
-
|
30
|
-
from: <%= "#{ENV['GOPATH']}/src/github.com/nicholasjackson/event-sauce/event-sauce" %>
|
31
|
-
to: './docker/event-sauce'
|
32
|
-
-
|
33
|
-
from: './swagger_spec/swagger.yml'
|
34
|
-
to: './dockerfile/event-sauce/swagger_spec/swagger.yml'
|
45
|
+
pre:
|
46
|
+
consul_loader:
|
47
|
+
config_file: './config.yml'
|
48
|
+
url: http://<%= get_public_server_for 'consul:8500' %>
|
49
|
+
health_check:
|
50
|
+
url: http://<%= get_public_server_for 'test2:8001' %>/v1/health
|
51
|
+
post:
|
52
|
+
tasks:
|
53
|
+
- 'wait_for_elastic_search'
|
@@ -0,0 +1,326 @@
|
|
1
|
+
module Minke
|
2
|
+
module Config
|
3
|
+
##
|
4
|
+
# Config represents project level configuration for minke builds
|
5
|
+
class Config
|
6
|
+
##
|
7
|
+
# the namespace for the application
|
8
|
+
#
|
9
|
+
# [Required]
|
10
|
+
attr_accessor :namespace
|
11
|
+
|
12
|
+
##
|
13
|
+
# the name of the application
|
14
|
+
#
|
15
|
+
# [Required]
|
16
|
+
attr_accessor :application_name
|
17
|
+
|
18
|
+
##
|
19
|
+
# the name of the generator to use
|
20
|
+
#
|
21
|
+
# [Required]
|
22
|
+
attr_accessor :generator_name
|
23
|
+
|
24
|
+
##
|
25
|
+
# Docker registry settings instance of Minke::Config::DockerRegistrySettings
|
26
|
+
#
|
27
|
+
# [Optional]
|
28
|
+
attr_accessor :docker_registry
|
29
|
+
|
30
|
+
##
|
31
|
+
# Docker settings for tasks, any items defined in this section will override
|
32
|
+
# the defaults provided inside the generator.
|
33
|
+
# instance of Minke::Config::DockerSettings
|
34
|
+
#
|
35
|
+
# [Required]
|
36
|
+
attr_accessor :docker
|
37
|
+
|
38
|
+
##
|
39
|
+
# Settings for the fetch packages phase
|
40
|
+
# instance of Minke::Config::Task
|
41
|
+
#
|
42
|
+
# [Optional] if not provided the fetch commands will not be executed
|
43
|
+
attr_accessor :fetch
|
44
|
+
|
45
|
+
##
|
46
|
+
# Settings for the build image phase
|
47
|
+
# instance of Minke::Config::Task
|
48
|
+
#
|
49
|
+
# [Optional] if not provided the build commands will not be executed
|
50
|
+
attr_accessor :build
|
51
|
+
|
52
|
+
##
|
53
|
+
# Settings for the run application phase
|
54
|
+
# instance of Minke::Config::Task
|
55
|
+
#
|
56
|
+
# [Optional] if not provided the run commands will not be executed
|
57
|
+
attr_accessor :run
|
58
|
+
|
59
|
+
##
|
60
|
+
# Settings for the run application phase
|
61
|
+
# instance of Minke::Config::Task
|
62
|
+
#
|
63
|
+
# [Optional] if not provided the test commands will not be executed
|
64
|
+
attr_accessor :test
|
65
|
+
|
66
|
+
##
|
67
|
+
# Settings for the cuccumber functional test phase
|
68
|
+
# instance of Minke::Config::Task
|
69
|
+
#
|
70
|
+
# [Optional] if not provided the cucumber commands will not be executed
|
71
|
+
attr_accessor :cucumber
|
72
|
+
|
73
|
+
##
|
74
|
+
# Returns the docker_compose file for the given section,
|
75
|
+
# if the section overrides application_compose_file then this is returned
|
76
|
+
# otherwise the global file is returned
|
77
|
+
# Parameters
|
78
|
+
# - :fetch
|
79
|
+
# - :build
|
80
|
+
# - :run
|
81
|
+
# - :test
|
82
|
+
# - :cucumber
|
83
|
+
def compose_file_for section
|
84
|
+
file = docker.application_compose_file unless docker.application_compose_file == nil
|
85
|
+
|
86
|
+
if self.send(section) != nil &&
|
87
|
+
self.send(section).docker != nil &&
|
88
|
+
self.send(section).docker.application_compose_file != nil
|
89
|
+
file = self.send(section).docker.application_compose_file
|
90
|
+
end
|
91
|
+
return file
|
92
|
+
end
|
93
|
+
|
94
|
+
##
|
95
|
+
# Returns the build_image file for the given section,
|
96
|
+
# if the section overrides build_image then this is returned
|
97
|
+
# otherwise the global build_image is returned
|
98
|
+
# Parameters
|
99
|
+
# - :fetch
|
100
|
+
# - :build
|
101
|
+
# - :run
|
102
|
+
# - :test
|
103
|
+
# - :cucumber
|
104
|
+
def build_image_for section
|
105
|
+
file = docker.build_image unless docker.build_image == nil
|
106
|
+
|
107
|
+
if self.send(section) != nil &&
|
108
|
+
self.send(section).docker != nil &&
|
109
|
+
self.send(section).docker.build_image != nil
|
110
|
+
file = self.send(section).docker.build_image
|
111
|
+
end
|
112
|
+
return file
|
113
|
+
end
|
114
|
+
|
115
|
+
##
|
116
|
+
# Returns the docker_compose file for the given section,
|
117
|
+
# if the section overrides application_compose_file then this is returned
|
118
|
+
# otherwise the global file is returned
|
119
|
+
# Parameters
|
120
|
+
# - :fetch
|
121
|
+
# - :build
|
122
|
+
# - :run
|
123
|
+
# - :test
|
124
|
+
# - :cucumber
|
125
|
+
def build_docker_file_for section
|
126
|
+
file = docker.build_docker_file unless docker.build_docker_file == nil
|
127
|
+
|
128
|
+
if self.send(section) != nil &&
|
129
|
+
self.send(section).docker != nil &&
|
130
|
+
self.send(section).docker.build_docker_file != nil
|
131
|
+
file = self.send(section).docker.build_docker_file
|
132
|
+
end
|
133
|
+
return file
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
137
|
+
##
|
138
|
+
# DockerRegistrySettings encapsulates the settings related to the docker registry
|
139
|
+
class DockerRegistrySettings
|
140
|
+
##
|
141
|
+
# url of the docker registry to use.
|
142
|
+
#
|
143
|
+
# [Optional]
|
144
|
+
attr_accessor :url
|
145
|
+
|
146
|
+
##
|
147
|
+
# user to use when logging into a docker registry.
|
148
|
+
#
|
149
|
+
# [Optional]
|
150
|
+
attr_accessor :user
|
151
|
+
|
152
|
+
##
|
153
|
+
# password to use when logging into a docker registry.
|
154
|
+
#
|
155
|
+
# [Optional]
|
156
|
+
attr_accessor :password
|
157
|
+
|
158
|
+
##
|
159
|
+
# email to use when logging into a docker registry.
|
160
|
+
#
|
161
|
+
# [Optional]
|
162
|
+
attr_accessor :email
|
163
|
+
|
164
|
+
##
|
165
|
+
# namespace to use when tagging an image for the docker registry.
|
166
|
+
#
|
167
|
+
# [Required]
|
168
|
+
attr_accessor :namespace
|
169
|
+
end
|
170
|
+
|
171
|
+
##
|
172
|
+
# DockerSettings encapsulate the configuration used when running builds using docker.
|
173
|
+
class DockerSettings
|
174
|
+
##
|
175
|
+
# Docker Image to use when building the application source code.
|
176
|
+
#
|
177
|
+
# [Optional]
|
178
|
+
attr_accessor :build_image
|
179
|
+
|
180
|
+
##
|
181
|
+
# Specific docker settings to allow an override of the defaults provided by the template, you may want to use
|
182
|
+
# this if you require a specific piece of software to be installed on the build container.
|
183
|
+
#
|
184
|
+
# [Optional]
|
185
|
+
attr_accessor :build_docker_file
|
186
|
+
|
187
|
+
##
|
188
|
+
# Dockerfile to use when creating the final docker image.
|
189
|
+
#
|
190
|
+
# [Required]
|
191
|
+
attr_accessor :application_docker_file
|
192
|
+
|
193
|
+
##
|
194
|
+
# Docker compose file to use when running and executing cucumber tests.
|
195
|
+
#
|
196
|
+
# [Required]
|
197
|
+
attr_accessor :application_compose_file
|
198
|
+
end
|
199
|
+
|
200
|
+
##
|
201
|
+
# Task encapsulates the configuration for the various rake tasks like build, run, etc.
|
202
|
+
class Task
|
203
|
+
##
|
204
|
+
# pre tasks will run before the main task executes.
|
205
|
+
# instance of Minke::Config::TaskRunSettings
|
206
|
+
#
|
207
|
+
# [Optional]
|
208
|
+
attr_accessor :pre
|
209
|
+
|
210
|
+
##
|
211
|
+
# post tasks will run after the main task executes.
|
212
|
+
# instance of Minke::Config::TaskRunSettings
|
213
|
+
#
|
214
|
+
# [Optional]
|
215
|
+
attr_accessor :post
|
216
|
+
|
217
|
+
##
|
218
|
+
# docker config allows you to override the main docker configuration on a per task basis.
|
219
|
+
# instance of Minke::Config::TaskRunSettings
|
220
|
+
#
|
221
|
+
# [Optional]
|
222
|
+
attr_accessor :docker
|
223
|
+
|
224
|
+
##
|
225
|
+
# container_addresses contains an array of Minke::Config::ContainerAddress which holds the details
|
226
|
+
# for the address the public and private ports of any containers which will be started by this
|
227
|
+
# task.
|
228
|
+
attr_accessor :container_addresses
|
229
|
+
end
|
230
|
+
|
231
|
+
##
|
232
|
+
# TaskRunSettings encapsulates the configuration for the various pre and post sections for each task.
|
233
|
+
# You can use this section to load config into consul, wait for a health check to complete, copy files
|
234
|
+
# or execute other tasks defined in your Rakefile.
|
235
|
+
class TaskRunSettings
|
236
|
+
##
|
237
|
+
# tasks is an array of strings which point to a defined task in your Rakefile.
|
238
|
+
#
|
239
|
+
# [Optional]
|
240
|
+
attr_accessor :tasks
|
241
|
+
|
242
|
+
##
|
243
|
+
# consul_loader will specify that the given config file is loaded into Consul.
|
244
|
+
# instance of Minke::Config::ConsulLoader
|
245
|
+
#
|
246
|
+
# [Optional]
|
247
|
+
attr_accessor :consul_loader
|
248
|
+
|
249
|
+
##
|
250
|
+
# health_check is the string representation of a url to check before continuing with the rest of the
|
251
|
+
# task a successfull 200 response from the endpoint is required to contine.
|
252
|
+
#
|
253
|
+
# [Optional]
|
254
|
+
attr_accessor :health_check
|
255
|
+
|
256
|
+
##
|
257
|
+
# copy is an array of Copy instances which will be copied before the task continues.
|
258
|
+
# instance of Minke::Config::Copy
|
259
|
+
#
|
260
|
+
# [Optional]
|
261
|
+
attr_accessor :copy
|
262
|
+
end
|
263
|
+
|
264
|
+
##
|
265
|
+
# ConsulLoader defines the settings and url to be loaded into a running consul instance.
|
266
|
+
class ConsulLoader
|
267
|
+
##
|
268
|
+
# config_file points to a yaml file of key values to load into consul.
|
269
|
+
#
|
270
|
+
# [Required]
|
271
|
+
attr_accessor :config_file
|
272
|
+
|
273
|
+
##
|
274
|
+
# url is the url to the running consul instance into which the keys and values will be loaded.
|
275
|
+
#
|
276
|
+
# [Required]
|
277
|
+
attr_accessor :url
|
278
|
+
end
|
279
|
+
|
280
|
+
##
|
281
|
+
# Copy defines a source and destination of either a file or directory to be copied during a task.
|
282
|
+
class Copy
|
283
|
+
##
|
284
|
+
# from is the file or directory to copy from.
|
285
|
+
#
|
286
|
+
# [Required]
|
287
|
+
attr_accessor :from
|
288
|
+
|
289
|
+
##
|
290
|
+
# to is the file or directory to copy to.
|
291
|
+
#
|
292
|
+
# [Required]
|
293
|
+
attr_accessor :to
|
294
|
+
end
|
295
|
+
|
296
|
+
##
|
297
|
+
# URL represents a url object which is used for health_check and consul_loader locations
|
298
|
+
class URL
|
299
|
+
##
|
300
|
+
# address of the server i.e 127.0.0.1 or the docker name consul
|
301
|
+
attr_accessor :address
|
302
|
+
|
303
|
+
##
|
304
|
+
# port which the server is running on
|
305
|
+
# default 80
|
306
|
+
attr_accessor :port
|
307
|
+
|
308
|
+
##
|
309
|
+
# protocol for the server
|
310
|
+
# - http [default]
|
311
|
+
# - https
|
312
|
+
attr_accessor :protocol
|
313
|
+
|
314
|
+
##
|
315
|
+
# path for the server
|
316
|
+
# default /
|
317
|
+
attr_accessor :path
|
318
|
+
|
319
|
+
##
|
320
|
+
# type of the URL
|
321
|
+
# - public
|
322
|
+
# - private used for linked containers
|
323
|
+
attr_accessor :type
|
324
|
+
end
|
325
|
+
end
|
326
|
+
end
|