Class: Pkgman::Targets::Centos
- Inherits:
-
Object
- Object
- Pkgman::Targets::Centos
- Defined in:
- lib/pkgman/targets/centos.rb
Instance Attribute Summary collapse
-
#container ⇒ Object
readonly
Returns the value of attribute container.
Instance Method Summary collapse
-
#initialize(runtime, target) ⇒ Centos
constructor
A new instance of Centos.
- #install(*packages) ⇒ Object
- #update ⇒ Object
Constructor Details
#initialize(runtime, target) ⇒ Centos
Returns a new instance of Centos.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/pkgman/targets/centos.rb', line 7 def initialize(runtime, target) @runtime = runtime @target = target @container = runtime.container(target['image'], target['version']) self.update self.install('gcc', 'bzip2', 'make', 'rpm-build', 'rubygems', 'ruby-devel', 'ruby-json') @container.execute('gem install --no-document fpm') self.install(*target['requires']) @container.execute('mkdir -p /tmp/compiled') @container.execute('mkdir -p /tmp/src') @container.execute('mkdir -p /tmp/product') end |
Instance Attribute Details
#container ⇒ Object (readonly)
Returns the value of attribute container.
5 6 7 |
# File 'lib/pkgman/targets/centos.rb', line 5 def container @container end |
Instance Method Details
#install(*packages) ⇒ Object
29 30 31 32 |
# File 'lib/pkgman/targets/centos.rb', line 29 def install(*packages) pkgs = packages.join(' ') @container.execute("yum install -y --setopt=tsflags=nodocs #{pkgs}") end |
#update ⇒ Object
25 26 27 |
# File 'lib/pkgman/targets/centos.rb', line 25 def update @container.execute('yum update -y --setopt=tsflags=nodocs') end |