Module: Dapp::Dapp::Deps::Base
- Included in:
- Dapp::Dapp
- Defined in:
- lib/dapp/dapp/deps/base.rb
Constant Summary collapse
- BASE_VERSION =
'0.1.14'.freeze
Instance Method Summary collapse
- #base_container ⇒ Object
-
#base_container_name ⇒ Object
FIXME: hashsum(image) or dockersafe().
- #sudo_command(owner: nil, group: nil) ⇒ Object
- #sudo_format_user(user) ⇒ Object
Instance Method Details
#base_container ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/dapp/dapp/deps/base.rb', line 11 def base_container @base_container ||= begin if shellout("docker inspect #{base_container_name}").exitstatus.nonzero? log_secondary_process(t(code: 'process.base_container_creating'), short: true) do shellout!( ['docker create', "--name #{base_container_name}", "--volume /.dapp/deps/base/#{BASE_VERSION} dappdeps/base:#{BASE_VERSION}"].join(' ') ) end end base_container_name end end |
#base_container_name ⇒ Object
FIXME: hashsum(image) or dockersafe()
7 8 9 |
# File 'lib/dapp/dapp/deps/base.rb', line 7 def base_container_name # FIXME: hashsum(image) or dockersafe() "dappdeps_base_#{BASE_VERSION}" end |
#sudo_command(owner: nil, group: nil) ⇒ Object
33 34 35 36 37 38 39 40 41 |
# File 'lib/dapp/dapp/deps/base.rb', line 33 def sudo_command(owner: nil, group: nil) sudo = '' if owner || group sudo = "#{sudo_bin} -E " sudo += "-u #{sudo_format_user(owner)} " if owner sudo += "-g #{sudo_format_user(group)} " if group end sudo end |
#sudo_format_user(user) ⇒ Object
43 44 45 |
# File 'lib/dapp/dapp/deps/base.rb', line 43 def sudo_format_user(user) user.to_s.to_i.to_s == user.to_s ? "\\\##{user}" : user end |