minke 1.8.3 → 1.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- OTUyYTNhOWE0ODZiYjRjODM0MjY5ODBmZDk3ZjU5MzczOGVkZmIyNw==
4
+ NzcxNDdkYWEzOGQyM2ZlYjVkYTYwYzYxZmI2MGU5ODI2OTk5YzI5MA==
5
5
  data.tar.gz: !binary |-
6
- YjhjMzlkZTgzMTkxZGQwNjc2MjYyMmNiZjg5MWM4ZTU2OTVkNjczNg==
6
+ MmJhOTlmOWU2YTBjZmYyNTFiZjZhMzY0ZWExZTUyMjFmNzE5ZTYwOA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MjFhZjM1NjJkY2MwMzZjNDIwNjg2YjJlNmY3MDJkZWNkMTg3NDRjZDlhNDVh
10
- NTliNWExYTM3ZmVmZDI4Zjg3NjgyMDUwZjgyMGQxYmRiOWE0ZTUwNmMzZGYz
11
- NzkwMDQ3ZDQ4NDY2ZTdjNTE4YzBlZWZlN2FkYTFjNGY3MGY5NGM=
9
+ ZmIxOTNmNzk1ZWUyNzM5MGM0Yjc1MmI0YjcwYjgwZjIzZDk5ZTIyMGM5MTZm
10
+ OGM3ZTcyOWM2ZTA3MjY5ZTFkOGUwZWZmZmNmZGFhZDYwYmI4MmYxY2YxMzkx
11
+ ODQwMGFiYTRkMWVhODFhOWU4MWFjZjYwYmIwZDAyZDVhZTllODQ=
12
12
  data.tar.gz: !binary |-
13
- OTlhYmQzODNiMjg1OGI1NDFlZDVkMTQ5NjQ1YTcxMjExYjRjOTcwMTBiYTcw
14
- OTM3NDM0M2I0OWJiMDIyNmFlNDI4MDBiY2FiMGIxMmFiNTgwNDYzNzAxZDIz
15
- ZDQxODI3Y2NhMGRjYzNjM2JmZDc0MGYwNDY2NDRlMDlmZDcyYjE=
13
+ ZmZkNDgwYmIxZGRjYzE0OWM0MDYzOTBjMGYxNGUzOWMxNmM4MzJhMGFjNjQy
14
+ MTBlZTg0MjBlM2U2OWZlMzRjYmU4NzA3OGE1YWVkNTA3MWRlNGIwZTJkYzBk
15
+ MjllZjgzMzIzZjc0YjM5YTc4ZjNlNTJjYjFlOGY3YTI5NjFiZWU=
data/lib/minke.rb CHANGED
@@ -41,6 +41,7 @@ require 'minke/generators/config_processor'
41
41
  require 'minke/generators/config_variables'
42
42
  require 'minke/generators/processor'
43
43
  require 'minke/generators/register'
44
+ require 'minke/generators/shell_script.rb'
44
45
 
45
46
  require 'minke/encryption/encryption'
46
47
  require 'minke/encryption/key_locator'
@@ -26,6 +26,9 @@ module Minke
26
26
 
27
27
  run_command_in_container image, generator.generate_settings.command unless generator.generate_settings.command == nil
28
28
  end
29
+
30
+ # write the shell script
31
+ Minke::Generators::write_bash_script output_folder + "/_build/minke.sh"
29
32
  end
30
33
 
31
34
  def build_image docker_file
@@ -0,0 +1,34 @@
1
+ module Minke
2
+ module Generators
3
+ SCRIPT = <<-EOF
4
+ #!/bin/bash
5
+
6
+ DOCKER_SOCK="/var/run/docker.sock:/var/run/docker.sock"
7
+ BUNDLE_COMMAND="set :bundle_flags, \"--path \#{shared_path}/bundles --quiet\" && bundle install -j3 && bundle update"
8
+ ERROR="Please specify a command e.g. ./minke.sh rake app:test"
9
+ COMMAND=""
10
+ NEW_UUID=$(base64 /dev/urandom | tr -d '/+' | head -c 32 | tr '[:upper:]' '[:lower:]')
11
+
12
+ if [ "$1" == '' ]; then
13
+ echo $ERROR;
14
+ exit 1;
15
+ fi
16
+
17
+ COMMAND=$*
18
+ DIR=$(dirname `pwd`)
19
+
20
+ echo "Running command: ${COMMAND}"
21
+
22
+ eval "docker network create minke_${NEW_UUID}"
23
+ eval "docker run --rm -it --net=minke_${NEW_UUID} -v ${DOCKER_SOCK} -v ${DIR}:${DIR} -e DOCKER_NETWORK=minke_${NEW_UUID} -w ${DIR}/_build nicholasjackson/minke /bin/bash -c '${BUNDLE_COMMAND} && ${COMMAND}'"
24
+ eval "docker network rm minke_${NEW_UUID}"
25
+ EOF
26
+
27
+ def write_bash_script path
28
+ File.write(path, SCRIPT)
29
+ File.chmod(0755, path)
30
+ end
31
+
32
+ module_function :write_bash_script
33
+ end
34
+ end
@@ -6,7 +6,7 @@ namespace :app do
6
6
 
7
7
  if @config.fetch != nil
8
8
  puts 'run fetch'
9
- runner = Minke::Tasks::Fetch.new @config, :fetch, @generator_config, @docker_runner, @docker_compose_factory, @logger, @helper
9
+ runner = Minke::Tasks::Fetch.new @config, :fetch, @generator_config, @docker_runner, @docker_compose_factory, @service_discovery, @logger, @helper
10
10
  runner.run
11
11
  end
12
12
  end
@@ -16,7 +16,7 @@ namespace :app do
16
16
  create_dependencies
17
17
 
18
18
  if @config.build != nil
19
- runner = Minke::Tasks::Build.new @config, :build, @generator_config, @docker_runner, @docker_compose_factory, @logger, @helper
19
+ runner = Minke::Tasks::Build.new @config, :build, @generator_config, @docker_runner, @docker_compose_factory, @service_discovery, @logger, @helper
20
20
  runner.run
21
21
  end
22
22
  end
@@ -26,7 +26,7 @@ namespace :app do
26
26
  create_dependencies
27
27
 
28
28
  if @config.test != nil
29
- runner = Minke::Tasks::Test.new @config, :test, @generator_config, @docker_runner, @docker_compose_factory, @logger, @helper
29
+ runner = Minke::Tasks::Test.new @config, :test, @generator_config, @docker_runner, @docker_compose_factory, @service_discovery, @logger, @helper
30
30
  runner.run
31
31
  end
32
32
  end
@@ -36,7 +36,7 @@ namespace :app do
36
36
  create_dependencies
37
37
 
38
38
  if @config.build != nil
39
- runner = Minke::Tasks::BuildImage.new @config, :build, @generator_config, @docker_runner, @docker_compose_factory, @logger, @helper
39
+ runner = Minke::Tasks::BuildImage.new @config, :build, @generator_config, @docker_runner, @docker_compose_factory, @service_discovery, @logger, @helper
40
40
  runner.run
41
41
  end
42
42
  end
@@ -67,7 +67,7 @@ namespace :app do
67
67
  desc "push built image to Docker registry"
68
68
  task :push do
69
69
  create_dependencies
70
- runner = Minke::Tasks::Push.new @config, :cucumber, @generator_config, @docker_runner, @docker_compose_factory, @logger, @helper
70
+ runner = Minke::Tasks::Push.new @config, :cucumber, @generator_config, @docker_runner, @docker_compose_factory, @service_discovery, @logger, @helper
71
71
  runner.run
72
72
  end
73
73
 
data/lib/minke/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Minke
2
- VERSION = "1.8.3"
2
+ VERSION = "1.9.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minke
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.3
4
+ version: 1.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nic Jackson
@@ -219,6 +219,7 @@ files:
219
219
  - lib/minke/generators/config_variables.rb
220
220
  - lib/minke/generators/processor.rb
221
221
  - lib/minke/generators/register.rb
222
+ - lib/minke/generators/shell_script.rb
222
223
  - lib/minke/helpers/helper.rb
223
224
  - lib/minke/rake/app.rake
224
225
  - lib/minke/rake/config.rake