minke 1.13.0 → 1.13.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
  SHA1:
3
- metadata.gz: a8a968e0c1571582674fa98f092560407ae4ca50
4
- data.tar.gz: 0f81d735278d8c5580b475a916572354504dbf9d
3
+ metadata.gz: 1269e53e6dd27dd353fea28c6685abfdc5c587ef
4
+ data.tar.gz: 4712f2d2267f4304948ae9c9df9c414a27cc41df
5
5
  SHA512:
6
- metadata.gz: 1262da8729c6d2fe0060ebe3f24f737c1d2822fedf4435b1ce5a274b7aeff1627e8a36183ec52abbaecebdff07f1b31733a1614d4552d2c9dafd13655e5fd456
7
- data.tar.gz: 2b8d1055d0554c843b015aae2d80209019a388bc17f12cf81c89866cd4dd21580b303c17a4cc274fea2b1f8b208e3bdeafa1ad7e2bb3e3dbaa012556812204af
6
+ metadata.gz: 947f7c63f787d7ecf89ae5fbb3d7f8caee3c0a50879dee58654257824d2ce14e70bca21b5c209f79e67ac248b2cfe50bd8f898c04aae1b6c046ba27d10c938e9
7
+ data.tar.gz: a0747a16ad9a200a9ec9888371cc5ed684199b7fa715a0a2430dd7997f51b72523ef76d26f49c06f200cabdaa99665d2ea38260a719e8e1a2d48176ae4a52049
data/.travis.yml CHANGED
@@ -30,7 +30,7 @@ after_deploy:
30
30
  docker build -t nicholasjackson/minke --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` --build-arg VCS_REF=`git rev-parse --short HEAD` .;
31
31
  docker login -e="$DOCKER_EMAIL" -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
32
32
  docker push nicholasjackson/minke:latest;
33
- docker tag nicholasjackson/minke nicholasjackson/minke:1.13.0;
34
- docker push nicholasjackson/minke:1.13.0;
33
+ docker tag nicholasjackson/minke nicholasjackson/minke:1.13.1;
34
+ docker push nicholasjackson/minke:1.13.1;
35
35
  curl https://hooks.microbadger.com/images/nicholasjackson/minke/tkpohfdrYPE0B0TL5NzLcOap4k0=;
36
36
  fi
data/bin/minke CHANGED
@@ -38,6 +38,7 @@ Commonly used command are:
38
38
  run : start the application
39
39
  build_image : build a docker image
40
40
  push : push built image to the registry
41
+ encrypt : encrypt secrets with a private key
41
42
  See 'minke COMMAND --help' for more information on a specific command.
42
43
  HELP
43
44
 
@@ -50,7 +51,12 @@ end
50
51
 
51
52
  subcommands = {
52
53
  'generate' => OptionParser.new do |opts|
53
- # ...
54
+ opts.banner = "Usage: minke [options] generate [options]"
55
+
56
+ opts.on('-g', '--generator GENERATOR', 'Generator plugin to use') { |v| options[:generator] = v }
57
+ opts.on('-o', '--output OUTPUT', 'Output folder') { |v| options[:output] = v }
58
+ opts.on('-a', '--application_name NAME', 'Application name') { |v| options[:name] = v }
59
+ opts.on('-n', '--namespace NAMESPACE', 'Application namespace') { |v| options[:namespace] = v }
54
60
  end,
55
61
 
56
62
  'build' => OptionParser.new do |opts|
@@ -58,100 +64,70 @@ subcommands = {
58
64
  end,
59
65
 
60
66
  'test' => OptionParser.new do |opts|
61
- opts.banner = "Usage: minke test [options]"
67
+ opts.banner = "Usage: minke [options] test [options]"
62
68
 
63
69
  opts.on("-c", "--config", "Load config file at given path") { |c| options[:config] = c }
64
- end
70
+ end,
71
+
72
+ 'encrypt' => OptionParser.new do |opts|
73
+ opts.banner = "Usage: minke [options] encrypt [options]"
74
+
75
+ opts.on('-e', '--encrypt STRING', 'Encrypt a string') { |v| options[:encrypt] = v }
76
+ opts.on('-k', '--key STRING', 'Private key to use for encryption') { |v| options[:key] = v }
77
+ end
65
78
  }
66
79
 
67
80
  global.order!
68
81
  command = ARGV.shift
69
- subcommands[command].order!
82
+ subcommands[command].order! unless command == ''
70
83
 
71
- def load_config options
72
- reader = Minke::Config::Reader.new Minke::Logging.create_logger(options[:verbose])
73
- config = reader.read options[:config]
84
+ def load_config config_file, verbose
85
+ reader = Minke::Config::Reader.new Minke::Logging.create_logger(verbose)
86
+ config = reader.read config_file
74
87
  variables = Minke::Generators::ConfigVariables.new.tap do |v|
75
88
  v.application_name = config.application_name
76
89
  v.namespace = config.namespace
77
90
  v.src_root = File.expand_path('../')
78
91
  end
79
- processor = Minke::Generators::Processor.new variables, nil, Minke::Logging.create_logger(options[:verbose])
92
+ processor = Minke::Generators::Processor.new variables, nil, Minke::Logging.create_logger(verbose)
80
93
  generator_config = processor.get_generator config.generator_name
81
94
  return config, generator_config
82
95
  end
83
96
 
84
- config, generator_config = load_config options
85
-
86
- case command
87
- when "test"
88
- Minke::Command.new(
89
- config,
90
- generator_config,
91
- options[:verbose]
92
- ).test
93
- when "build"
94
- Minke::Command.new(
95
- config,
96
- generator_config,
97
- options[:verbose]
98
- ).build
99
- when "fetch"
100
- Minke::Command.new(
101
- config,
102
- generator_config,
103
- options[:verbose]
104
- ).fetch
105
- when "cucumber"
106
- Minke::Command.new(
107
- config,
108
- generator_config,
109
- options[:verbose]
110
- ).cucumber
111
- when "build_image"
112
- Minke::Command.new(
113
- config,
114
- generator_config,
115
- options[:verbose]
116
- ).build_image
117
- when "run"
118
- Minke::Command.new(
119
- config,
120
- generator_config,
121
- options[:verbose]
122
- ).run
123
- when "push"
124
- Minke::Command.new(
97
+ def doCommand(command, verbose, config_file = nil)
98
+ config, generator_config = load_config(config_file, verbose) unless config_file == nil
99
+ c = Minke::Command.new(
125
100
  config,
126
- generator_config,
127
- options[:verbose]
128
- ).run
129
- end
130
-
131
- exit 0
132
-
133
- OptionParser.new do |opts|
134
- opts.banner = "Usage: minke [options]"
101
+ generator_config,
102
+ verbose
103
+ )
135
104
 
136
- opts.on('-e', '--encrypt STRING', 'Encrypt a string') { |v| options[:encrypt] = v }
137
- opts.on('-k', '--key STRING', 'Private key to use for encryption') { |v| options[:key] = v }
138
- opts.on('-g', '--generator GENERATOR', 'Generator plugin to use') { |v| options[:generator] = v }
139
- opts.on('-o', '--output OUTPUT', 'Output folder') { |v| options[:output] = v }
140
- opts.on('-a', '--application_name NAME', 'Application name') { |v| options[:name] = v }
141
- opts.on('-n', '--namespace NAMESPACE', 'Application namespace') { |v| options[:namespace] = v }
142
-
143
- end.parse!
105
+ puts c
106
+ c.public_send(command)
107
+ end
144
108
 
145
- # load the installed generators
146
- variables = Minke::Generators::ConfigVariables.new.tap do |v|
147
- v.application_name = options[:name]
148
- v.namespace = options[:namespace]
149
- v.src_root = File.expand_path(options[:output]) unless options[:output] == nil
109
+ def doGenerate(options)
110
+ # load the installed generators
111
+ variables = Minke::Generators::ConfigVariables.new.tap do |v|
112
+ v.application_name = options[:name]
113
+ v.namespace = options[:namespace]
114
+ v.src_root = File.expand_path(options[:output]) unless options[:output] == nil
115
+ end
116
+ logger = Minke::Logging.create_logger(options[:verbose])
117
+ processor = Minke::Generators::Processor.new(
118
+ variables,
119
+ Minke::Docker::DockerRunner.new(logger),
120
+ logger
121
+ )
122
+
123
+ processor.process options[:generator], options[:output]
150
124
  end
151
- processor = Minke::Generators::Processor.new variables, Minke::Docker::DockerRunner.new
152
125
 
153
- if options[:encrypt] != nil
154
- puts "Please specify a key to use for encryption using -k [path to file]" if options[:key] == nil
126
+ def doEncrypt(options)
127
+ if options[:key] == nil
128
+ puts "Please specify a key to use for encryption using -k [path to file]"
129
+ exit 1
130
+ end
155
131
 
156
132
  encrypt = Minke::Encryption::Encryption.new options[:key]
157
133
 
@@ -161,13 +137,30 @@ if options[:encrypt] != nil
161
137
  puts " fingerprint: #{encrypt.fingerprint}"
162
138
  puts ' value: >'
163
139
  encrypt.encrypt_string(options[:encrypt]).split("\n").each { |l| puts " #{l}"}
164
-
165
- exit 0
166
140
  end
167
141
 
168
- if options[:generator] == nil || options[:output] == nil || options[:name] == nil || options[:namespace] == nil
169
- puts "Please specify options use: minke --help for help on command line options"
170
- exit 0
171
- end
142
+ case command
143
+ when "test"
144
+ doCommand(:test, options[:verbose], options[:config])
145
+ when "build"
146
+ doCommand(:build, options[:verbose], options[:config])
147
+ when "fetch"
148
+ doCommand(:fetch, options[:verbose], options[:config])
149
+ when "cucumber"
150
+ doCommand(:cucumber, options[:verbose], options[:config])
151
+ when "build_image"
152
+ doCommand(:build_image, options[:verbose], options[:config])
153
+ when "run"
154
+ doCommand(:run, options[:verbose], options[:config])
155
+ when "push"
156
+ doCommand(:push, options[:verbose], options[:config])
157
+ when "generate"
158
+ if options[:generator] == nil || options[:output] == nil || options[:name] == nil || options[:namespace] == nil
159
+ puts "Please specify options use: minke generate --help for help on command line options"
160
+ exit 0
161
+ end
172
162
 
173
- processor.process options[:generator], options[:output]
163
+ doGenerate(options)
164
+ when "encrypt"
165
+ doEncrypt(options)
166
+ end
data/docker/Gemfile CHANGED
@@ -8,7 +8,7 @@ gem "cucumber"
8
8
  gem "cucumber-rest-api", "= 0.3"
9
9
  gem 'cucumber-api', '~> 0.3'
10
10
 
11
- gem 'minke', "= 1.12.8"
11
+ gem 'minke', "= 1.13.1"
12
12
  gem 'minke-generator-swift', "= 0.2.2"
13
13
  gem 'minke-generator-netmvc'
14
14
  gem 'minke-generator-go', "= 0.8.2"
@@ -1,5 +1,5 @@
1
1
  #!/bin/bash
2
- MINKE_VERSION="1.13.0"
2
+ MINKE_VERSION="1.13.1"
3
3
  ERROR="Please specify a command e.g. ./minke test"
4
4
 
5
5
  DOCKER_SOCK="/var/run/docker.sock:/var/run/docker.sock"
data/lib/minke/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Minke
2
- VERSION = "1.13.0"
2
+ VERSION = "1.13.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minke
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.13.0
4
+ version: 1.13.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nic Jackson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-27 00:00:00.000000000 Z
11
+ date: 2016-08-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler