egads 0.0.3 → 0.0.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 +8 -8
- data/lib/egads/cli.rb +7 -7
- data/lib/egads/config.rb +1 -1
- data/lib/egads/s3_tarball.rb +7 -3
- data/lib/egads/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NTUwYTQ0MTFjOTlhNDhkYTIxMWFiYTE1ZmJlMjk2NTI5OTgxYTViMg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
M2EyZWFmNWY0NTdlNDgxMTJiNDQ1NTI1NjRhY2YxMTUwYzJmYzIxNg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NjdiMmRhOTM3YWE4Mzc5OTQ5MTQ1MDcxMmVjM2Q3NzZkNmVlOTA3N2E4YTdm
|
10
|
+
YjNjZmEzMzdhYWQyYjhiZGE2MmVjNjhiZTBlMGE5YmE2YmQ1ZWQzNTc0ZDRm
|
11
|
+
ODkzMzEyYjE0ZDI4NTZjNTYwN2ViY2Q2NjU4YmE5ZjgzN2Q1YmQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZjFkMDhjZjhjYTIyOWM5MmU0MmMwN2MwYjg1MjYyMmViYjU3ZTBlM2Q1OGVi
|
14
|
+
ZjAwMjM0ZGM2YzkyYWMxYThkNjM0MmZlOWRhYzZmYzFhMzQ4NzkwNjE4YWYx
|
15
|
+
YjMxYWQ0MDZiOWU3MjhiN2VhY2MxN2NmZWNhMmU0MGM2NTdhNGE=
|
data/lib/egads/cli.rb
CHANGED
@@ -41,7 +41,7 @@ module Egads
|
|
41
41
|
File.open('REVISION', 'w') {|f| f << sha + "\n" }
|
42
42
|
run_or_die "tar -uf #{tarball.local_tar_path} REVISION"
|
43
43
|
|
44
|
-
run_hooks_for(:build, :
|
44
|
+
run_hooks_for(:build, :after)
|
45
45
|
|
46
46
|
extra_paths = Config.build_extra_paths
|
47
47
|
if extra_paths.any?
|
@@ -85,19 +85,19 @@ module Egads
|
|
85
85
|
tarball = S3Tarball.new(sha, true)
|
86
86
|
|
87
87
|
inside dir do
|
88
|
-
if options[:force] || !File.exists?(path)
|
88
|
+
if options[:force] || File.zero?(path) || !File.exists?(path)
|
89
89
|
say "Downloading tarball"
|
90
90
|
duration = Benchmark.realtime do
|
91
|
-
File.open(path, 'w') {|f| f << tarball.
|
91
|
+
File.open(path, 'w') {|f| f << tarball.contents }
|
92
92
|
end
|
93
93
|
size = File.size(path)
|
94
94
|
say "Downloaded in %.1f seconds (%.1f KB/s)" % [duration, (size.to_f / 2**10) / duration]
|
95
95
|
else
|
96
|
-
say "Tarball already
|
96
|
+
say "Tarball already downloaded. Use --force to overwrite"
|
97
97
|
end
|
98
98
|
|
99
99
|
# Check revision file to see if tarball is already extracted
|
100
|
-
extract_flag_path File.join(dir, '.egads-extract-success')
|
100
|
+
extract_flag_path = File.join(dir, '.egads-extract-success')
|
101
101
|
if options[:force] || !File.exists?(extract_flag_path)
|
102
102
|
say "Extracting tarball"
|
103
103
|
run_or_die "tar -zxf #{path}"
|
@@ -118,7 +118,7 @@ module Egads
|
|
118
118
|
inside dir do
|
119
119
|
run_hooks_for(:stage, :before)
|
120
120
|
|
121
|
-
run_or_die("bundle install --deployment --quiet") if File.readable?("
|
121
|
+
run_or_die("bundle install --deployment --quiet") if File.readable?("Gemfile")
|
122
122
|
if ENV['SHARED_PATH']
|
123
123
|
symlinked_dirs = %w(public/system tmp/pids log)
|
124
124
|
symlinked_dirs.each do |d|
|
@@ -169,7 +169,7 @@ module Egads
|
|
169
169
|
|
170
170
|
private
|
171
171
|
# Run command hooks from config file
|
172
|
-
# E.g. run_hooks_for(:build, :
|
172
|
+
# E.g. run_hooks_for(:build, :after)
|
173
173
|
def run_hooks_for(cmd, hook)
|
174
174
|
say_status :hooks, "Running #{cmd} #{hook} hooks"
|
175
175
|
Config.hooks_for(cmd, hook).each do |command|
|
data/lib/egads/config.rb
CHANGED
@@ -22,7 +22,7 @@ module Egads
|
|
22
22
|
extend CommonConfig
|
23
23
|
|
24
24
|
def self.config_path
|
25
|
-
path = ENV['EGADS_CONFIG'] || File.join(
|
25
|
+
path = ENV['EGADS_CONFIG'] || File.join(Dir.pwd, 'egads.yml')
|
26
26
|
unless path && File.readable?(path)
|
27
27
|
raise ArgumentError.new("Could not read config file. Set either EGADS_CONFIG, or create egads.yml in the current directory")
|
28
28
|
end
|
data/lib/egads/s3_tarball.rb
CHANGED
@@ -6,8 +6,12 @@ module Egads
|
|
6
6
|
@remote = remote
|
7
7
|
end
|
8
8
|
|
9
|
+
def config
|
10
|
+
remote ? RemoteConfig : Config
|
11
|
+
end
|
12
|
+
|
9
13
|
def key
|
10
|
-
[
|
14
|
+
[config.s3_prefix, "#{sha}.tar.gz"].compact * '/'
|
11
15
|
end
|
12
16
|
|
13
17
|
def exists?
|
@@ -30,11 +34,11 @@ module Egads
|
|
30
34
|
|
31
35
|
# Load the file contents from S3
|
32
36
|
def contents
|
33
|
-
bucket.files.get(key
|
37
|
+
bucket.files.get(key).body
|
34
38
|
end
|
35
39
|
|
36
40
|
def bucket
|
37
|
-
|
41
|
+
config.s3_bucket
|
38
42
|
end
|
39
43
|
end
|
40
44
|
end
|
data/lib/egads/version.rb
CHANGED