pkgr 1.1.7 → 1.1.8
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.
data/lib/pkgr/builder.rb
CHANGED
@@ -76,9 +76,10 @@ module Pkgr
|
|
76
76
|
|
77
77
|
FileUtils.mkdir_p(compile_cache_dir)
|
78
78
|
|
79
|
-
run_hook config.
|
79
|
+
run_hook config.before_hook
|
80
80
|
buildpack_for_app.compile(source_dir, compile_cache_dir)
|
81
81
|
buildpack_for_app.release(source_dir, compile_cache_dir)
|
82
|
+
run_hook config.after_hook
|
82
83
|
else
|
83
84
|
raise Errors::UnknownAppType, "Can't find a buildpack for your app"
|
84
85
|
end
|
@@ -219,6 +220,7 @@ module Pkgr
|
|
219
220
|
|
220
221
|
cmd = %{env -i PATH="$PATH"#{config.env} bash '#{file}' 2>&1}
|
221
222
|
|
223
|
+
Pkgr.logger.debug "Running hook in #{source_dir}: #{file.inspect}"
|
222
224
|
puts "-----> Running hook: #{file.inspect}"
|
223
225
|
|
224
226
|
Dir.chdir(source_dir) do
|
data/lib/pkgr/config.rb
CHANGED
@@ -90,6 +90,40 @@ module Pkgr
|
|
90
90
|
@errors ||= []
|
91
91
|
end
|
92
92
|
|
93
|
+
def before_hook
|
94
|
+
if before_precompile.nil? || before_precompile.empty?
|
95
|
+
before_steps = self.before || []
|
96
|
+
|
97
|
+
if before_steps.empty?
|
98
|
+
nil
|
99
|
+
else
|
100
|
+
tmpfile = Tempfile.new(["before_hook", ".sh"])
|
101
|
+
before_steps.each{|step| tmpfile.puts step}
|
102
|
+
tmpfile.close
|
103
|
+
tmpfile.path
|
104
|
+
end
|
105
|
+
else
|
106
|
+
before_precompile
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
def after_hook
|
111
|
+
if after_precompile.nil? || after_precompile.empty?
|
112
|
+
after_steps = self.after || []
|
113
|
+
|
114
|
+
if after_steps.empty?
|
115
|
+
nil
|
116
|
+
else
|
117
|
+
tmpfile = Tempfile.new(["after_hook", ".sh"])
|
118
|
+
after_steps.each{|step| tmpfile.puts step}
|
119
|
+
tmpfile.close
|
120
|
+
tmpfile.path
|
121
|
+
end
|
122
|
+
else
|
123
|
+
after_precompile
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
93
127
|
def to_args
|
94
128
|
args = [
|
95
129
|
"--name \"#{name}\"",
|
@@ -2,6 +2,7 @@ start on (started network-interface
|
|
2
2
|
or started network-manager
|
3
3
|
or started networking)
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
# The `networking` job is a task, which means it will be stopped after the network interfaces have been configured.
|
6
|
+
# That's why we don't stop on "stopping networking".
|
7
|
+
# See <https://github.com/ddollar/foreman/issues/263>
|
8
|
+
stop on runlevel [!2345]
|
data/lib/pkgr/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pkgr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-03-
|
12
|
+
date: 2014-03-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|