gordon 0.0.16 → 0.0.17
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/lib/gordon/cooker.rb +17 -11
- data/lib/gordon/version.rb +1 -1
- data/spec/gordon/cooker_spec.rb +9 -21
- 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: 070d6226cb7d4f623edc73bf8a5623b8a33df00e
|
4
|
+
data.tar.gz: 11ad4f9d175ca123ba3a9fc64bce415af8d02515
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 90fddfedda4dfb3a8743e1596188df717e291fbba9b1774c50f3827b721f21342d4d47172a79290874c70dda354f11a072cc15d1c26a86547c1eed305cb3e3cf
|
7
|
+
data.tar.gz: e27c7021854f4c90eeb982b8a9efd2c36e5b26b86c7e40ec2c8f64a5ff557a498e5e671dcdbf89cc03b028839fa1bc4e9aafa8dec6774ce6d1e4968c0a30b706
|
data/lib/gordon/cooker.rb
CHANGED
@@ -1,10 +1,11 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
|
1
3
|
module Gordon
|
2
4
|
class Cooker
|
3
5
|
attr_reader :recipe, :options
|
4
6
|
|
5
|
-
FPM_COOKERY_COMMAND
|
6
|
-
|
7
|
-
FPM_COOKERY_BUILD_DIR = '/tmp/gordon/build'
|
7
|
+
FPM_COOKERY_COMMAND = 'fpm-cook'
|
8
|
+
FPM_COOKERY_WORKING_DIR = '/tmp/gordon'
|
8
9
|
|
9
10
|
def initialize(recipe)
|
10
11
|
@recipe = recipe
|
@@ -19,12 +20,9 @@ module Gordon
|
|
19
20
|
private
|
20
21
|
|
21
22
|
def clean
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
cook_args << recipe.application_template_path
|
26
|
-
|
27
|
-
execute(cook_args)
|
23
|
+
# fpm-cook clean command only cleans tmp-build and tmp-dest folders
|
24
|
+
# and don't include cache dir :(
|
25
|
+
FileUtils.rm_rf(get_working_path)
|
28
26
|
end
|
29
27
|
|
30
28
|
def package
|
@@ -36,6 +34,14 @@ module Gordon
|
|
36
34
|
execute(cook_args)
|
37
35
|
end
|
38
36
|
|
37
|
+
def get_working_path
|
38
|
+
app_path = File.expand_path(options.app_source)
|
39
|
+
app_name = File.basename(app_path)
|
40
|
+
tmp_path = File.join(FPM_COOKERY_WORKING_DIR, app_name)
|
41
|
+
|
42
|
+
tmp_path
|
43
|
+
end
|
44
|
+
|
39
45
|
def get_command_args
|
40
46
|
cook_args = []
|
41
47
|
|
@@ -43,8 +49,8 @@ module Gordon
|
|
43
49
|
|
44
50
|
cook_args << "--target #{options.package_type}"
|
45
51
|
cook_args << "--pkg-dir #{File.expand_path(options.output_dir)}"
|
46
|
-
cook_args << "--cache-dir #{File.expand_path(
|
47
|
-
cook_args << "--tmp-root #{File.expand_path(
|
52
|
+
cook_args << "--cache-dir #{File.expand_path(get_working_path)}"
|
53
|
+
cook_args << "--tmp-root #{File.expand_path(get_working_path)}"
|
48
54
|
cook_args << "--no-deps"
|
49
55
|
|
50
56
|
cook_args
|
data/lib/gordon/version.rb
CHANGED
data/spec/gordon/cooker_spec.rb
CHANGED
@@ -31,32 +31,20 @@ describe Gordon::Cooker do
|
|
31
31
|
Gordon::EnvVars.from_cook(options)
|
32
32
|
end
|
33
33
|
|
34
|
+
let(:working_path) do
|
35
|
+
app_name = File.basename File.expand_path(options.app_source)
|
36
|
+
File.join(described_class::FPM_COOKERY_WORKING_DIR, app_name)
|
37
|
+
end
|
38
|
+
|
34
39
|
subject { described_class.new(recipe) }
|
35
40
|
|
36
41
|
before :each do
|
37
|
-
|
42
|
+
allow(subject).to receive(:debug)
|
38
43
|
end
|
39
44
|
|
40
45
|
describe 'cooking a package' do
|
41
46
|
it 'cleans fpm-cookery working directory' do
|
42
|
-
|
43
|
-
#{env_vars.join " "}
|
44
|
-
fpm-cook
|
45
|
-
--debug
|
46
|
-
--target
|
47
|
-
#{options.package_type}
|
48
|
-
--pkg-dir
|
49
|
-
#{File.expand_path(options.output_dir)}
|
50
|
-
--cache-dir
|
51
|
-
#{File.expand_path(described_class::FPM_COOKERY_CACHE_DIR)}
|
52
|
-
--tmp-root
|
53
|
-
#{File.expand_path(described_class::FPM_COOKERY_BUILD_DIR)}
|
54
|
-
--no-deps
|
55
|
-
clean
|
56
|
-
#{recipe.application_template_path}
|
57
|
-
}
|
58
|
-
|
59
|
-
expect(Gordon::Process).to receive(:run).with(clean_command.join " ")
|
47
|
+
expect(FileUtils).to receive(:rm_rf).with(working_path)
|
60
48
|
|
61
49
|
expect(subject).to receive(:package)
|
62
50
|
|
@@ -73,9 +61,9 @@ describe Gordon::Cooker do
|
|
73
61
|
--pkg-dir
|
74
62
|
#{File.expand_path(options.output_dir)}
|
75
63
|
--cache-dir
|
76
|
-
#{File.expand_path(
|
64
|
+
#{File.expand_path(working_path)}
|
77
65
|
--tmp-root
|
78
|
-
#{File.expand_path(
|
66
|
+
#{File.expand_path(working_path)}
|
79
67
|
--no-deps
|
80
68
|
package
|
81
69
|
#{recipe.application_template_path}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gordon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marcelo Pinheiro
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|