luban 0.8.3 → 0.8.4
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 +4 -4
- data/CHANGELOG.md +11 -0
- data/lib/luban/deployment/cli/application/base.rb +12 -1
- data/lib/luban/deployment/cli/application/crontab.rb +9 -12
- data/lib/luban/deployment/cli/application/publisher.rb +1 -0
- data/lib/luban/deployment/cli/application/repository.rb +4 -3
- data/lib/luban/deployment/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b6c8d8264eb67e64d12b8898d1d3f6be9d9bae49
|
4
|
+
data.tar.gz: ac0c9be4be0449a4f4d8d0460785b3aef5fd98f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e8cca593188e1ed1eaec53681f13e0ba51fa7119ee616a02e0f58e4d9b9fd3793d2fb0f1ee525e250de0b40d81910e48844c8bad4018f93eeeaafaf3a7af584
|
7
|
+
data.tar.gz: a5885b65c1431c4f5a35b8dc62226b27e88c59cd0c50da0fd3dc4928dcc7b4674de82e4c86fe55c20c7d2a5c71a60409a20bf959c5373678766da2d74765f06e
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,16 @@
|
|
1
1
|
# Change log
|
2
2
|
|
3
|
+
## Version 0.8.4 (Sept 22, 2016)
|
4
|
+
|
5
|
+
Minor enhancements:
|
6
|
+
* Added #bundle_via to specify Ruby version to bundle gems with
|
7
|
+
* This is useful for bundling gems that requires specific Ruby version
|
8
|
+
* Forced bundler using the gems already present in vendor/cache thru option "--local"
|
9
|
+
|
10
|
+
Bug fixes:
|
11
|
+
* Added source release to cronjob deployment if source is provided
|
12
|
+
* Properly update cronjob if the crontab contains other unrelated entries
|
13
|
+
|
3
14
|
## Version 0.8.3 (Sept 21, 2016)
|
4
15
|
|
5
16
|
Minor enhancements:
|
@@ -84,6 +84,12 @@ module Luban
|
|
84
84
|
end
|
85
85
|
alias_method :require_package, :package
|
86
86
|
|
87
|
+
def bundle_via(ruby:)
|
88
|
+
bundle_cmd = luban_root_path.join("env", "#{stage}.#{project}", ".luban", "pkg",
|
89
|
+
"ruby", "versions", ruby.to_s.downcase, 'bin', 'bundle')
|
90
|
+
set :bundle_via, bundle_cmd
|
91
|
+
end
|
92
|
+
|
87
93
|
def profile(from = nil, **opts)
|
88
94
|
from.nil? ? @profile : (@profile = opts.merge(type: 'profile', from: from))
|
89
95
|
end
|
@@ -194,7 +200,6 @@ module Luban
|
|
194
200
|
deploy_profile(args: args, opts: opts) if has_profile?
|
195
201
|
deploy_cronjobs(args: args, opts: opts)
|
196
202
|
end
|
197
|
-
dispatch_task :deploy_cronjobs, to: :crontab, as: :deploy_cronjobs
|
198
203
|
|
199
204
|
Luban::Deployment::Command::Tasks::Control::Actions.each do |action|
|
200
205
|
define_method(action) do |args:, opts:|
|
@@ -379,6 +384,12 @@ module Luban
|
|
379
384
|
dispatch_task :deprecate_packaged_release!, to: :repository, as: :deprecate, locally: true
|
380
385
|
dispatch_task :deprecate_published_release!, to: :publisher, as: :deprecate
|
381
386
|
|
387
|
+
def deploy_cronjobs(args:, opts:)
|
388
|
+
opts = opts.merge(version: current_app) if has_source?
|
389
|
+
deploy_cronjobs!(args: args, opts: opts)
|
390
|
+
end
|
391
|
+
dispatch_task :deploy_cronjobs!, to: :crontab, as: :deploy_cronjobs
|
392
|
+
|
382
393
|
def print_summary(result)
|
383
394
|
result.each do |entry|
|
384
395
|
s = entry[:summary]
|
@@ -109,21 +109,18 @@ module Luban
|
|
109
109
|
def update_cronjobs!
|
110
110
|
crontab = capture(:crontab, "-l")
|
111
111
|
new_crontab = capture(:cat, crontab_file_path, "2>/dev/null")
|
112
|
-
|
112
|
+
found = false
|
113
113
|
crontab = crontab.split("\n").inject([]) do |lines, line|
|
114
|
-
if
|
115
|
-
lines << new_crontab unless (
|
114
|
+
if found || line == crontab_open
|
115
|
+
lines << new_crontab unless (found = line != crontab_close)
|
116
116
|
else
|
117
117
|
lines << line
|
118
118
|
end
|
119
119
|
lines
|
120
120
|
end
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
upload!(StringIO.new(crontab.join("\n")), tmp_crontab_file_path)
|
125
|
-
test(:crontab, tmp_crontab_file_path, "2>&1")
|
126
|
-
end
|
121
|
+
crontab << new_crontab unless found
|
122
|
+
upload!(StringIO.new(crontab.join("\n")), tmp_crontab_file_path)
|
123
|
+
test(:crontab, tmp_crontab_file_path, "2>&1")
|
127
124
|
ensure
|
128
125
|
rm(tmp_crontab_file_path)
|
129
126
|
end
|
@@ -132,11 +129,11 @@ module Luban
|
|
132
129
|
crontab = capture(:crontab, "-l")
|
133
130
|
return crontab if all
|
134
131
|
|
135
|
-
|
132
|
+
found = false
|
136
133
|
crontab.split("\n").inject([]) do |lines, line|
|
137
|
-
if
|
134
|
+
if found || line == crontab_open
|
138
135
|
lines << line
|
139
|
-
|
136
|
+
found = line != crontab_close
|
140
137
|
end
|
141
138
|
lines
|
142
139
|
end.join("\n")
|
@@ -198,6 +198,7 @@ module Luban
|
|
198
198
|
options << "--gemfile #{gemfile}"
|
199
199
|
options << "--path #{bundle_path}"
|
200
200
|
unless test(bundle_executable, :check, *options)
|
201
|
+
options << "--local"
|
201
202
|
unless bundle_without.include?(stage.to_s)
|
202
203
|
options << "--without #{bundle_without.join(' ')}"
|
203
204
|
end
|
@@ -162,6 +162,7 @@ module Luban
|
|
162
162
|
end
|
163
163
|
|
164
164
|
def bundle_gems
|
165
|
+
bundle_cmd = fetch(:bundle_via, :bundle)
|
165
166
|
gemfile_path = Pathname.new(release_tag).join('Gemfile')
|
166
167
|
gems_cache = Pathname.new('vendor').join('cache')
|
167
168
|
bundle_path = Pathname.new('vendor').join('bundle')
|
@@ -173,14 +174,14 @@ module Luban
|
|
173
174
|
execute(:tar, "--strip-components=1 -xzf #{release_package_path} #{paths_to_extract.join(' ')} > /dev/null 2>&1; true")
|
174
175
|
options = []
|
175
176
|
options << "--path #{bundle_path}"
|
176
|
-
unless test(
|
177
|
+
unless test(bundle_cmd, :check, *options)
|
177
178
|
unless bundle_without.include?(stage.to_s)
|
178
179
|
options << "--without #{bundle_without.join(' ')}"
|
179
180
|
end
|
180
181
|
options << "--quiet"
|
181
|
-
execute(
|
182
|
+
execute(bundle_cmd, :install, *options)
|
182
183
|
info "Package gems bundled in Gemfile"
|
183
|
-
execute(
|
184
|
+
execute(bundle_cmd, :package, "--all --quiet")
|
184
185
|
end
|
185
186
|
gem_files = capture(:ls, '-xt', gems_cache.join('*.gem')).split
|
186
187
|
gem_files.each do |gem_file|
|
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.8.
|
4
|
+
version: 0.8.4
|
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-09-
|
11
|
+
date: 2016-09-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: luban-cli
|