bricky 0.0.37 → 0.0.38

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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YzAwOGYyZmU3OTBkNzRlN2M2ODJmMWMxMTA1YmYzOTYwNzdjOWYxNw==
4
+ YmY1ODgxMjA0ZTllMmFlOGFlODdiYmZkZGQ5ZGJjMWY4ZDFiMWQ4MA==
5
5
  data.tar.gz: !binary |-
6
- M2ZkYWQ4YWQ3ZGY2YmQ4YTZiMmU4NDk4NTU0NjdiMGJjYzQ0MDlmNA==
6
+ OWMxMTUyMzM5YzllNjcwMmM2MzFkZDBiOGY2OWE4NGU2ODkyZDIxZg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MWU0MDI3MmUwYTE5OWNmMjliOTI5MWQ5N2Y4ZmNhYTk0MGU3NmQzNjNjNWNl
10
- YmM0YWI5NmE5YmVmMzdlYjExYzQwYTM1NGU1MDcxOWE0OGQ4YzVjNjYxNWRk
11
- ZGVkMDhiYTY0ZWM4NjhkYWU3MTA4MDhhMTU4YWZiYzZhZTMyNzk=
9
+ NWQ4ZTRiNzk0Y2UyNmVjNWJiY2QwNDY4MDUxMzBjN2VhODVlMzBjMmU5ZDkx
10
+ MTkzZDVhM2VkOWQxY2E1Zjc0ZmRiZjQ0NWRhMjUxZjE4MTQzMzVkM2VhODdl
11
+ MGJiZjI4MTI4OTJiYjM1MmMxMmYzMzJmOGJjM2U4ZTg1OWEyMjM=
12
12
  data.tar.gz: !binary |-
13
- MmZhZmU0OGRjYTdhNjlhMmE3ZjU1NGZlZWUxYmY4NWFjMzE4MDI3YmNjMzRh
14
- Njc1ODJmZjJhY2RjOTZjYjVlOTI1NzRiMmFlZWVhNmQzNmRkMzljZTJkZGIy
15
- ZWEyNjZkZDAxOGZmZjMzYmI5MDU5YTA5ZjU2MTFjNDJjNjdiODc=
13
+ M2VmYjMwODBkODk5NmQ4ZDkxNTg4NDg5ZTg4ZWE0ODNkNmFmNzUzY2Q2OTg3
14
+ YzM2NmMzMTE0ODQ2Yzg0MGQ2NzdjNzg5OTg1NjA4MGI2OTg5YjA0MTgxMDc3
15
+ NDMzZTVjZjI2NTJkNzBiMmYxZDA3NWFiNTAyODBkMmMzYmQyNGE=
@@ -8,7 +8,7 @@ mounts() {
8
8
 
9
9
  pushd /bricks/mounts/volumes/
10
10
  echo $BRICKS_MOUNTS_IGNORE | tr ',' '\n' > /tmp/ignore-files
11
- rsync -a --stats --exclude-from /tmp/ignore-files . /opt/workspace
11
+ rsync -a --stats -h --exclude-from /tmp/ignore-files . /opt/workspace
12
12
  chown -R builder. /opt/workspace
13
13
  popd
14
14
  }
@@ -1 +1,19 @@
1
1
  #!/bin/bash -e
2
+
3
+ . $BRICKS_HOME/suexec
4
+
5
+ system() {
6
+ info 'Executing custom commands'
7
+ local commands=$(echo $BRICKS_SYSTEM_COMMANDS | sed -e 's/;;/ /g')
8
+
9
+ pushd /opt/workspace/source
10
+ for rawCommand in $commands
11
+ do
12
+ local command=$(echo $rawCommand | base64 -d)
13
+ echo "- $command"
14
+ $command
15
+ done
16
+ popd
17
+ }
18
+
19
+ execute system
@@ -1,3 +1,5 @@
1
+ require "base64"
2
+
1
3
  module Bricky
2
4
  module Bricks
3
5
  class System < Base
@@ -8,6 +10,24 @@ module Bricky
8
10
  end
9
11
  end
10
12
  end
13
+
14
+ def arguments
15
+ ["-v #{bricks_path}/system:/bricks/system"]
16
+ end
17
+
18
+ def entrypoint
19
+ '/bricks/system/builder'
20
+ end
21
+
22
+ def environments
23
+ commands = config.fetch('builder', false)
24
+ commands.empty? ? nil : ["-e BRICKS_SYSTEM_COMMANDS='#{encode(commands)}'"]
25
+ end
26
+
27
+ private
28
+ def encode(commands)
29
+ commands.collect{|x| Base64.encode64(x).chomp}.join(';;')
30
+ end
11
31
  end
12
32
  end
13
33
  end
@@ -15,7 +15,7 @@ module Bricky
15
15
  code = command(images)
16
16
  logger.debug format(code)
17
17
 
18
- unless Bricky::Executor.system(code)
18
+ unless executor.call(code)
19
19
  logger.failure '~~~~~~~~~~~ Problems building image ~~~~~~~~~~~'
20
20
  return false
21
21
  end
@@ -62,6 +62,14 @@ module Bricky
62
62
  FileUtils.safe_unlink(shim) if File.exist?(shim)
63
63
  FileUtils.symlink(Bricky.config.bricks_path, shim)
64
64
  end
65
+
66
+ def executor
67
+ if options['shell']
68
+ lambda { |command| Bricky::Executor.tty(command) }
69
+ else
70
+ lambda { |command| Bricky::Executor.system(command) }
71
+ end
72
+ end
65
73
  end
66
74
  end
67
75
  end
@@ -16,6 +16,10 @@ module Bricky
16
16
  end
17
17
  end
18
18
 
19
+ def tty(command)
20
+ Kernel.system(command)
21
+ end
22
+
19
23
  private
20
24
  def execute(command)
21
25
  Open3.popen2e(command) do |input, output, wait|
@@ -1,4 +1,4 @@
1
1
  module Bricky
2
- VERSION = "0.0.37"
2
+ VERSION = "0.0.38"
3
3
  CODENAME = "silver-surfer"
4
4
  end
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.37
4
+ version: 0.0.38
5
5
  platform: ruby
6
6
  authors:
7
7
  - andrerocker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-18 00:00:00.000000000 Z
11
+ date: 2015-09-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler