luban 0.5.0 → 0.5.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: 03a9c57a554704d306e2a27b7e7275d3f40597aa
4
- data.tar.gz: 0daf44cc27a95855104af6c961e7fde2955c5e37
3
+ metadata.gz: 5d4ff5719088dde2272d1acffdb8f0929872f02c
4
+ data.tar.gz: a02e072d9d3760b30c3c6f22f3029cf69b6a95e0
5
5
  SHA512:
6
- metadata.gz: 4a7b0b50e21b604f2309086267db37960632dd69783e12aa3f0a844e19417c0825260d1a20cd8b1bb7344f146a3c9313a1641e68e4bf506e2dff1fb5bd9db0c8
7
- data.tar.gz: 5af9a462115a938ef504bcd38d78732fa3bd95ea773a2e4e8a8ce900ab472004aacab5802a6fb4652e65ea202738880dcab879d5e683d5761dfdc9b87becc3d7
6
+ metadata.gz: 54678b14d233074638fd1f03950dc37fb3598c71bedd45c3a1426adc8acbcc8c58f1613357dc4e7c87a790bfa66fd960ce6b0e87c968940b204ff43d6f33bb22
7
+ data.tar.gz: c93eb97c9383c8e88b1020affe8318cdbe4ad6ae36e7ef3bc2691feb3fd49cab3f874b6f35e3582b567e46b11695e52242b54d2fed8d3a990389fa8f078aee17
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Change log
2
2
 
3
+ ## Version 0.5.1 (Jun 24, 2016)
4
+
5
+ Minor enhancements:
6
+ * Added subcommands #init to initialize deployment application/service profiles
7
+ * Added .gitignore file to the deployment project skeleton
8
+
3
9
  ## Version 0.5.0 (Jun 22, 2016)
4
10
 
5
11
  Minor enhancements:
@@ -116,14 +116,26 @@ module Luban
116
116
  end
117
117
  end
118
118
 
119
- def init_services(args:, opts:)
119
+ def init_profiles(args:, opts:)
120
120
  show_app_environment
121
- service = args[:service]
122
- (service.nil? ? services.values : [services[service]]).each do |s|
123
- s.init_service(args: args, opts: opts)
121
+ if opts[:app]
122
+ init_profile(args: args, opts: opts)
123
+ elsif opts[:service].nil?
124
+ init_profile(args: args, opts: opts)
125
+ init_service_profiles(args: args, opts: opts)
126
+ elsif opts[:service].is_a?(TrueClass)
127
+ init_service_profiles(args: args, opts: opts)
128
+ else
129
+ services[opts[:service]].init_profile(args: args, opts: opts)
124
130
  end
125
131
  end
126
132
 
133
+ def init_profile(args:, opts:); end
134
+
135
+ def init_service_profiles(args:, opts:)
136
+ services.values.each { |s| s.init_profile(args: args, opts: opts) }
137
+ end
138
+
127
139
  protected
128
140
 
129
141
  def set_parameters
@@ -166,17 +178,18 @@ module Luban
166
178
  end
167
179
 
168
180
  def setup_tasks
169
- setup_init_services
181
+ setup_init_profiles
170
182
  super
171
183
  end
172
184
 
173
- def setup_init_services
174
- return unless has_services?
175
- service_names = services.keys
185
+ def setup_init_profiles
186
+ _services = services.keys
176
187
  command :init do
177
- desc 'Initialize deployment services'
178
- argument :service, 'Service name', within: service_names, required: false, type: :symbol
179
- action! :init_services
188
+ desc 'Initialize deployment application/service profiles'
189
+ switch :app, "Application profile ONLY", short: :a
190
+ option :service, "Service profile ONLY", short: :s, nullable: true,
191
+ within: _services.push(nil), type: :symbol
192
+ action! :init_profiles
180
193
  end
181
194
  end
182
195
 
@@ -28,14 +28,14 @@ module Luban
28
28
  respond_to?(:default_templates_path, true)
29
29
  end
30
30
 
31
- def init_service(args:, opts:)
31
+ def init_profile(args:, opts:)
32
32
  return unless has_templates?
33
33
  require 'fileutils'
34
34
  puts " Initializing #{name} profile"
35
35
  templates_path = config_finder[:application].profile_templates_path.join(name.to_s)
36
36
  profile_path = config_finder[:application].stage_profile_path.join(name.to_s)
37
37
  [templates_path, profile_path].each { |p| FileUtils.mkdir(p) unless p.directory? }
38
- init_templates.each do |src_path|
38
+ init_profile_templates.each do |src_path|
39
39
  next unless src_path.file?
40
40
  dst_path = (src_path.extname == '.erb' ? templates_path : profile_path).
41
41
  join(src_path.basename)
@@ -69,7 +69,7 @@ module Luban
69
69
  linked_dirs.push('log', 'pids')
70
70
  end
71
71
 
72
- def init_templates
72
+ def init_profile_templates
73
73
  default_templates_path.children
74
74
  end
75
75
  end
@@ -0,0 +1,5 @@
1
+ /.bundle/
2
+ /Gemfile.lock
3
+ .luban/
4
+ vendor/cache/
5
+ .DS_Store
@@ -1,5 +1,5 @@
1
1
  module Luban
2
2
  module Deployment
3
- VERSION = "0.5.0"
3
+ VERSION = "0.5.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: luban
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rubyist Lei
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-06-22 00:00:00.000000000 Z
11
+ date: 2016-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: luban-cli
@@ -153,6 +153,7 @@ files:
153
153
  - lib/luban/deployment/templates/application/lib/application.rb.erb
154
154
  - lib/luban/deployment/templates/envrc.erb
155
155
  - lib/luban/deployment/templates/header.erb
156
+ - lib/luban/deployment/templates/project/.gitignore
156
157
  - lib/luban/deployment/templates/project/CHANGELOG.md.erb
157
158
  - lib/luban/deployment/templates/project/Gemfile
158
159
  - lib/luban/deployment/templates/project/LICENSE.txt.erb