slugbuilder 2.0.1 → 2.0.2
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 +10 -0
- data/lib/slugbuilder/builder.rb +15 -8
- data/lib/slugbuilder/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: 367b7b519e31d8a09a34a4a5be8d0d7fcc7f84d4
|
4
|
+
data.tar.gz: 76ebf745bb4ac19173043db02eb11eac64c51b8b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8121ef7398200674364e88db19bb757c5a3c2012b4f4202f3af102e858b55e1f69770af91a963b36c386ef4438e077eb6a124a8a5caa8a88a74d4122bb207339
|
7
|
+
data.tar.gz: 7697a17820a6305ff5d3671cd3e1072238b976873ac7a0baf41d2ecf139c0ee9531f118ea574b383db869645af6cdfce4c3ba05e6be6d72b230f1134de991434
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 2.0.2 (2017-5-26)
|
4
|
+
|
5
|
+
Fixed:
|
6
|
+
|
7
|
+
- Move location of buildpack caching to prevent buildpacks that try to clear the entire cache directory from deleting themselves in the middle of running. [7e444e1](../../commit/7e444e1)
|
8
|
+
|
9
|
+
Added:
|
10
|
+
|
11
|
+
- Improved error messaging [209eead](../../commit/209eead)
|
12
|
+
|
3
13
|
## 2.0.1 (2017-5-25)
|
4
14
|
|
5
15
|
Fixed:
|
data/lib/slugbuilder/builder.rb
CHANGED
@@ -7,17 +7,17 @@ module Slugbuilder
|
|
7
7
|
class Builder
|
8
8
|
def initialize(repo:, git_ref:, stdout: $stdout)
|
9
9
|
@stdout = stdout
|
10
|
-
@base_dir = Slugbuilder.config.base_dir
|
10
|
+
@base_dir = Shellwords.escape(Slugbuilder.config.base_dir)
|
11
11
|
@cache_dir = Shellwords.escape(Slugbuilder.config.cache_dir)
|
12
|
-
@output_dir = Slugbuilder.config.output_dir
|
13
|
-
@buildpacks_dir = File.join(@
|
12
|
+
@output_dir = Shellwords.escape(Slugbuilder.config.output_dir)
|
13
|
+
@buildpacks_dir = File.join(@base_dir, 'buildpacks')
|
14
14
|
@env_dir = File.join(@base_dir, 'environment')
|
15
15
|
repo_matches = parse_git_url(repo)
|
16
16
|
@repo = "#{repo_matches[:org]}/#{repo_matches[:name]}"
|
17
17
|
@git_url = normalize_git_url(repo)
|
18
18
|
@git_ref = git_ref
|
19
|
-
@git_dir =
|
20
|
-
@build_dir =
|
19
|
+
@git_dir = File.join(@base_dir, 'git', @repo)
|
20
|
+
@build_dir = File.join(@base_dir, @repo, git_ref)
|
21
21
|
|
22
22
|
setup
|
23
23
|
|
@@ -83,6 +83,8 @@ module Slugbuilder
|
|
83
83
|
|
84
84
|
def wipe_cache
|
85
85
|
FileUtils.rm_rf(@cache_dir)
|
86
|
+
FileUtils.rm_rf(@buildpacks_dir)
|
87
|
+
FileUtils.mkdir_p(@cache_dir)
|
86
88
|
FileUtils.mkdir_p(@buildpacks_dir)
|
87
89
|
end
|
88
90
|
|
@@ -136,6 +138,7 @@ module Slugbuilder
|
|
136
138
|
end
|
137
139
|
|
138
140
|
def create_dirs
|
141
|
+
FileUtils.mkdir_p(@cache_dir)
|
139
142
|
FileUtils.mkdir_p(@base_dir)
|
140
143
|
FileUtils.mkdir_p(@buildpacks_dir)
|
141
144
|
FileUtils.mkdir_p(@output_dir)
|
@@ -196,7 +199,7 @@ module Slugbuilder
|
|
196
199
|
# checkout hash
|
197
200
|
if buildpack_matches[:hash]
|
198
201
|
Dir.chdir("#{@buildpacks_dir}/#{buildpack_name}") do
|
199
|
-
rc = run("git checkout --quiet #{buildpack_matches[:hash]} && git reset origin --hard && git pull --quiet")
|
202
|
+
rc = run("git fetch --quiet --all && git checkout --quiet #{buildpack_matches[:hash]} && git reset origin --hard && git pull --quiet")
|
200
203
|
fail "Failed to fetch and checkout: #{buildpack_matches[:hash]}" if rc != 0
|
201
204
|
end
|
202
205
|
end
|
@@ -208,7 +211,10 @@ module Slugbuilder
|
|
208
211
|
def run_hook(hook_name)
|
209
212
|
Dir.chdir(@build_dir) do
|
210
213
|
script = "#{@build_dir}/bin/#{hook_name}"
|
211
|
-
|
214
|
+
if File.exists?(script)
|
215
|
+
rc = run(script)
|
216
|
+
fail "Failed to run #{script}" if rc != 0
|
217
|
+
end
|
212
218
|
end
|
213
219
|
end
|
214
220
|
|
@@ -243,7 +249,7 @@ module Slugbuilder
|
|
243
249
|
end
|
244
250
|
release_file.close
|
245
251
|
|
246
|
-
fail "Couldn't
|
252
|
+
fail "Couldn't release application using buildpack #{buildpack}" if rc != 0
|
247
253
|
end
|
248
254
|
|
249
255
|
def build_slug
|
@@ -279,6 +285,7 @@ module Slugbuilder
|
|
279
285
|
|
280
286
|
def normalize_git_url(url)
|
281
287
|
matches = parse_git_url(url)
|
288
|
+
fail "Invalid buildpack url: #{url}." unless matches
|
282
289
|
if Slugbuilder.config.protocol == 'ssh'
|
283
290
|
"git@#{matches[:host] || Slugbuilder.config.git_service}:#{matches[:org]}/#{matches[:name]}.git"
|
284
291
|
else
|
data/lib/slugbuilder/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slugbuilder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Panoply Dev
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|