slugbuilder 2.0.1 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: eeaac445621a0c0521008a3b7e92ef3a0faca8fa
4
- data.tar.gz: 859fe6152e81018f187c89887e51015960610513
3
+ metadata.gz: 367b7b519e31d8a09a34a4a5be8d0d7fcc7f84d4
4
+ data.tar.gz: 76ebf745bb4ac19173043db02eb11eac64c51b8b
5
5
  SHA512:
6
- metadata.gz: 15010197f5d99b3e1cf48fed3c5556a86349dfd9aebd74eba2caf5925cc8dd1f041601bed45db94ff09e8588043a6901e90e68ce870c4a74b3e78d92e7766818
7
- data.tar.gz: 65273d2387626c01a8ac718c731635b02ead2c5624d0bf89adcc7d719df5bc7893d69b2e8b9e85dfb66a8bf454ba80ef6708b46674a87c00435c2937e06bf244
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:
@@ -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(@cache_dir, 'buildpacks')
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 = Shellwords.escape(File.join(@base_dir, 'git', @repo))
20
- @build_dir = Shellwords.escape(File.join(@base_dir, @repo, git_ref))
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
- run(script) if File.exists?(script)
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 compile application using buildpack #{buildpack}" if rc != 0
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
@@ -1,3 +1,3 @@
1
1
  module Slugbuilder
2
- VERSION = '2.0.1'
2
+ VERSION = '2.0.2'
3
3
  end
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.1
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-25 00:00:00.000000000 Z
11
+ date: 2017-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler