slugbuilder 1.0.0 → 1.1.0

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: bab77b33178bb303e46f50fc4914d07ab4777802
4
- data.tar.gz: 8d9ed29a4d5b50938081f986ad4796511c6f9ce7
3
+ metadata.gz: 8390ed6955989466405c4b13f75dda4c613e22ee
4
+ data.tar.gz: 3ffbc59def65e419090be1033c442100597a4fbb
5
5
  SHA512:
6
- metadata.gz: 5e6d9b29d4eaf4cb7bf8b09621a0b3d4cf713237796efc8e6e70afd7f2f9f1399dae3f9677617a7b2cb6b7c5b085f81bbccb49eea65627977842b88b07187be5
7
- data.tar.gz: 65b4d59438e84bfa00da8af5434fe8322611778d4c2d755356e456861de0e2be17225606016a0a76900c4657b4253141170585291e75f0616372010b7c4bad3a
6
+ metadata.gz: ca3c527f6d8dd812693a090f5475934821d31f20c88e58ca8f81df0ed81344b6361d6e0d54e33cdcf9c89092303b036cfb9475ca525195bced1dbc55303f64ca
7
+ data.tar.gz: acfa79622b0d7b7fcbcd4036105fda5991baa4e4bb43c06d06e78fd9c56e96f79e3d71b468565638bba494e13e5f9566a219001f6d86b4a970bb309ed9a48916
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.1.0 (2017-1-27)
4
+
5
+ Fixed:
6
+
7
+ - `build` with `clear_cache: true` now works correctly [e535c96](../../commit/e535c96)
8
+
9
+ Added:
10
+
11
+ - `build` optionally takes a `buildpacks` keyword argument that specifies an array of buildpacks to use for that particular build [3871ff9](../../commit/3871ff9)
12
+
3
13
  ## 1.0.0 (2017-1-18)
4
14
 
5
15
  Initial release
data/CODE_OF_CONDUCT.md CHANGED
@@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
55
55
  ## Enforcement
56
56
 
57
57
  Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
- reported by contacting the project team at jonathan.lehman91@gmail.com. All
58
+ reported by contacting the project team. All
59
59
  complaints will be reviewed and investigated and will result in a response that
60
60
  is deemed necessary and appropriate to the circumstances. The project team is
61
61
  obligated to maintain confidentiality with regard to the reporter of an incident.
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Slugbuilder is a Ruby gem to build [Heroku](https://www.heroku.com/)-like [slugs](https://devcenter.heroku.com/articles/platform-api-deploying-slugs).
4
4
 
5
- It runs Heroku [buildpacks](https://devcenter.heroku.com/articles/buildpacks) on an application and builds a [slug](https://devcenter.heroku.com/articles/slug-compiler), which is essentially a `tar` file that can run on services like Heroku, [lxfontes/slugrunner-rb](https://github.com/lxfontes/slugrunner-rb), [deis/slugrunner](https://github.com/deis/slugrunner), and the like.
5
+ It runs Heroku [buildpacks](https://devcenter.heroku.com/articles/buildpacks) on an application and builds a [slug](https://devcenter.heroku.com/articles/slug-compiler), which is essentially a `tar` file that can run on services like Heroku, [panoplymedia/slugrunner](https://github.com/panoplymedia/slugrunner), [lxfontes/slugrunner-rb](https://github.com/lxfontes/slugrunner-rb), [deis/slugrunner](https://github.com/deis/slugrunner), and the like.
6
6
 
7
7
  ## Installation
8
8
 
@@ -91,13 +91,14 @@ end
91
91
 
92
92
  Alternatively, a Proc can be passed to `build` method's keyword argument `prebuild` to achieve the same effect.
93
93
 
94
- ### Builder#build(slug_name: nil, clear_cache: false, env: {}, prebuild: nil, postbuild: nil, &block)
94
+ ### Builder#build(slug_name: nil, clear_cache: false, env: {}, buildpacks: Slugbuilder.config.buildpacks, prebuild: nil, postbuild: nil, &block)
95
95
 
96
96
  `build` builds the slug and writes build information to `STDOUT`.
97
97
 
98
98
  - `slug_name` String (optional): Override default name of slug (repo.git_ref.git_sha.tgz with the `/` in repo replaced by `.`)
99
99
  - `clear_cache` Boolean (optional): destroys the cache before building when true
100
100
  - `env` Hash (optional): an optional hash of environment variables
101
+ - `buildpacks` Array (optional): optionally set buildpacks to be used for that particular build. defaults to `Slugbuilder.config.buildpacks`
101
102
  - `prebuild` Proc (optional): an optional Proc (or anything that conforms to the `call` API of a Proc) that will be run before the build. The Proc will receive a Hash with the structure:
102
103
  - `repo` String: The git repo identifier
103
104
  - `git_ref` String: The git branchname or SHA
@@ -23,7 +23,8 @@ module Slugbuilder
23
23
  end
24
24
  end
25
25
 
26
- def build(clear_cache: false, env: {}, prebuild: nil, postbuild: nil, slug_name: nil)
26
+ def build(clear_cache: false, env: {}, prebuild: nil, postbuild: nil, slug_name: nil, buildpacks: Slugbuilder.config.buildpacks)
27
+ @buildpacks = buildpacks
27
28
  @env = env
28
29
  @slug_file = slug_name ? "#{slug_name}.tgz" : Shellwords.escape("#{@repo.gsub('/', '.')}.#{@git_ref}.#{@git_sha}.tgz")
29
30
  wipe_cache if clear_cache
@@ -50,7 +51,7 @@ module Slugbuilder
50
51
  end
51
52
  return true
52
53
  rescue => e
53
- stitle("Failed to create slug: #{e}")
54
+ stitle("Failed: #{e}")
54
55
  return false
55
56
  end
56
57
 
@@ -59,6 +60,7 @@ module Slugbuilder
59
60
 
60
61
  def wipe_cache
61
62
  FileUtils.rm_rf(@cache_dir)
63
+ FileUtils.mkdir_p(File.join(@cache_dir, 'buildpacks'))
62
64
  end
63
65
 
64
66
  def build_and_release
@@ -142,12 +144,11 @@ module Slugbuilder
142
144
  end
143
145
 
144
146
  def fetch_buildpacks
145
- buildpacks = Slugbuilder.config.buildpacks
146
- buildpacks << Shellwords.escape(@env['BUILDPACK_URL']) if @env.key?('BUILDPACK_URL')
147
- fail 'Could not detect buildpack' if buildpacks.size.zero?
147
+ @buildpacks << Shellwords.escape(@env['BUILDPACK_URL']) if @env.key?('BUILDPACK_URL')
148
+ fail 'Could not detect buildpack' if @buildpacks.size.zero?
148
149
 
149
150
  existing_buildpacks = Dir.entries(@buildpacks_dir)
150
- buildpacks.each do |buildpack_url|
151
+ @buildpacks.each do |buildpack_url|
151
152
  buildpack_name = get_buildpack_name(buildpack_url)
152
153
  if !existing_buildpacks.include?(buildpack_name)
153
154
  # download buildpack
@@ -164,7 +165,7 @@ module Slugbuilder
164
165
  end
165
166
  end
166
167
 
167
- buildpacks
168
+ @buildpacks
168
169
  end
169
170
 
170
171
  def run_buildpacks(buildpacks)
@@ -1,3 +1,3 @@
1
1
  module Slugbuilder
2
- VERSION = '1.0.0'
2
+ VERSION = '1.1.0'
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: 1.0.0
4
+ version: 1.1.0
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-01-19 00:00:00.000000000 Z
11
+ date: 2017-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler