bricky 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NjZmNGY2NGQwMzE4NDlhYzcxZmQxMWRiZjM0ZTU4MGNmMjcyYjdlMg==
4
+ ZjJjYjljZWFjZDFlNWYwZTJjODAxNGQwZDg4Y2IxYTM1NmU0MGRiYQ==
5
5
  data.tar.gz: !binary |-
6
- OTA0ODM2ZGQwYzZiMWUxOTI2OWZkOTNlYmU3MzkyNTExNzZlY2Q2Zg==
6
+ NGFkZDk4ZmYxYjFjZTUyMzUzYTJhYjk2NDhkYzcwYzFiNTg4ODhhNQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NjBiYWFiNzM1YTk4NmEyM2M3ZmI1ZDFhY2Q3OTFmM2NmZDU3YjI1ODA4ZmEx
10
- MTY0N2RlNTQ1ZTMwMjJjOGNlYjAyYzkwOGE0YTUwMjMwNjAxM2VjYjYxYzY1
11
- ZTkxZDg4NjYyZTEzNWI3OGVmZTYxMTgyMzY4MTE5N2Y2ZDI3MjM=
9
+ NWFhOTYxOGM0NmVkMGY2NTE4ZDNhYmFjMjQ0NTJjNTU5Y2Q2YWRjYjI4MWM0
10
+ YmY0Y2JlOGM5NGNiYWEzMTE2NmJkYWQ0MGQ1NzFkZjA4MzI5MDg1ZTE2Mjk1
11
+ Nzk4NDg3NzlhMGUwNWY1YzRkYjBmMGE2ZGUxYjQ4YWNmYjkyY2U=
12
12
  data.tar.gz: !binary |-
13
- NDcyN2UxYzNjMTNjMTYxOWFlZmE0MTQzZWY0YmQ4Zjk2MWEwMzYwZTQ4OTNj
14
- MWM0MGYxNDA5ZDA3ZmQ4Nzg1YWNmMGM4OTNmZjNiNjI2YzRjN2E5MzRkMGZl
15
- MzY0YTM1NTc3MDRiNzEyMjc5NjhlNjQ2MmE0YTY0ODVkNWJhMDM=
13
+ YmI4NDQxOWNmN2ZiZTlkN2U0MWMyMjM2ZDJjYTlhYjEyMTZlZGIxYTYyNTMz
14
+ NzU0NTU3N2YxNzEyMGY2YjljMTNmMDY4NDJiOTJmMGQ1MTJmNGQyODI5MWI4
15
+ ZTk4NTIwMzBkMGZmMzRlMTIyNmI5ZDYwNGIzMTc5NTdhZmE4ODg=
@@ -4,10 +4,11 @@
4
4
 
5
5
  execute() {
6
6
  . $BRICKS_HOME/builder
7
+ export GEM_HOME=~/.gems
7
8
 
8
9
  info 'Vendor project with Bundler'
9
10
  pushd /opt/workspace/source
10
- gem install bundler --conservative --no-ri --no-rdoc
11
+ command -v bundle > /dev/null 2>&1 || gem install --no-ri --no-rdoc bundler
11
12
  bundle install --deployment --without=$BRICKS_BUNDLE_WITHOUT
12
13
  popd
13
14
  }
@@ -4,8 +4,12 @@
4
4
 
5
5
  execute() {
6
6
  info 'Building workspace'
7
- rsync -a --stats /bricks/mounts/volumes/ /opt/workspace
8
- chown -R builder. /opt/workspace
7
+
8
+ pushd /bricks/mounts/volumes/
9
+ echo $BRICKS_MOUNTS_IGNORE | tr ',' '\n' > /tmp/ignore-files
10
+ rsync -a --stats --exclude-from /tmp/ignore-files . /opt/workspace
11
+ chown -R builder. /opt/workspace
12
+ popd
9
13
  }
10
14
 
11
15
  execute
@@ -4,6 +4,10 @@ bricky:
4
4
  bricks:
5
5
  mounts:
6
6
  source: .
7
+ ignore:
8
+ - source/log
9
+ - source/tmp
10
+ - source/.git
7
11
  bundle:
8
12
  cache: true
9
13
  without: development:test
@@ -7,12 +7,12 @@ module Bricky
7
7
  def arguments
8
8
  scripts_path = "#{bricks_path}/bundle"
9
9
  results = ["-v #{scripts_path}:/bricks/bundle"]
10
- results.push(cached) if config["cache"]
10
+ results.push(cached) if config['cache']
11
11
  results
12
12
  end
13
13
 
14
14
  def entrypoint
15
- "/bricks/bundle/builder"
15
+ '/bricks/bundle/builder'
16
16
  end
17
17
 
18
18
  def environments
@@ -31,7 +31,7 @@ module Bricky
31
31
  end
32
32
 
33
33
  def digest
34
- Digest::MD5.file('Gemfile').hexdigest
34
+ Digest::MD5.file('Gemfile.lock').hexdigest
35
35
  end
36
36
  end
37
37
  end
@@ -2,17 +2,28 @@ module Bricky
2
2
  module Bricks
3
3
  class Mounts < Base
4
4
  def arguments
5
- scripts_path = "#{bricks_path}/mounts"
6
- command = "-v #{scripts_path}:/bricks/mounts"
7
-
8
- config.inject([command]) do |acc, mount|
9
- acc << "-v #{File.expand_path(mount.last)}:/bricks/mounts/volumes/#{mount.first}"
5
+ result = config.inject([commands_volume]) do |acc, mount|
6
+ acc << mount_point(mount.last, mount.first) if not mount.first.eql? "ignore"
7
+ acc
10
8
  end
11
9
  end
12
10
 
13
11
  def entrypoint
14
12
  "/bricks/mounts/builder"
15
13
  end
14
+
15
+ def environments
16
+ ["-e BRICKS_MOUNTS_IGNORE='#{config.fetch('ignore', []).join(',')}'"]
17
+ end
18
+
19
+ private
20
+ def commands_volume
21
+ "-v #{bricks_path}/mounts:/bricks/mounts"
22
+ end
23
+
24
+ def mount_point(path, name)
25
+ "-v #{File.expand_path(path)}:/bricks/mounts/volumes/#{name}"
26
+ end
16
27
  end
17
28
  end
18
29
  end
@@ -2,6 +2,7 @@ require "thor"
2
2
  require "ostruct"
3
3
  require "colorize"
4
4
 
5
+ require "bricky/image"
5
6
  require "bricky/requirements"
6
7
  require "bricky/commands/base"
7
8
  require "bricky/commands/install"
@@ -36,7 +37,7 @@ module Bricky
36
37
  end
37
38
 
38
39
  def dispatch(name)
39
- clazz = Kernel.const_get("Bricky::Commands::#{name.to_s.capitalize}")
40
+ clazz = Bricky::Commands.const_get("#{name.to_s.capitalize}")
40
41
  command = clazz.new(options)
41
42
  command.execute
42
43
  end
@@ -35,7 +35,7 @@ module Bricky
35
35
  end
36
36
 
37
37
  def create_hack_image(image)
38
- hack_path = FileUtils::mkdir_p("#{Bricky.config.tmp_path}/containers/#{Bricky.config.name}").first
38
+ hack_path = FileUtils::mkdir_p("#{Bricky.config.tmp_path}/patch/").first
39
39
  File.open("#{hack_path}/Dockerfile", "w") { |file| file.write(parse_hack_template(image)) }
40
40
  hack_path
41
41
  end
data/lib/bricky/config.rb CHANGED
@@ -23,7 +23,7 @@ module Bricky
23
23
  end
24
24
 
25
25
  def tmp_path
26
- "#{ENV['HOME']}/.bricky"
26
+ "#{ENV['HOME']}/.bricky/#{name}"
27
27
  end
28
28
 
29
29
  private
@@ -1,3 +1,3 @@
1
1
  module Bricky
2
- VERSION = "0.0.9"
2
+ VERSION = "0.0.10"
3
3
  end
data/lib/bricky.rb CHANGED
@@ -1,5 +1,6 @@
1
- require "bricky/version"
1
+ require "bricky/config"
2
2
  require "bricky/command"
3
+ require "bricky/version"
3
4
 
4
5
  module Bricky
5
6
  extend self
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bricky
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - andrerocker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-13 00:00:00.000000000 Z
11
+ date: 2015-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -56,16 +56,16 @@ dependencies:
56
56
  name: thor
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - ! '>'
60
60
  - !ruby/object:Gem::Version
61
- version: 0.19.1
61
+ version: '0.14'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ~>
66
+ - - ! '>'
67
67
  - !ruby/object:Gem::Version
68
- version: 0.19.1
68
+ version: '0.14'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: colorize
71
71
  requirement: !ruby/object:Gem::Requirement