Class: Pkgman::Targets::Centos

Inherits:
Object
  • Object
show all
Defined in:
lib/pkgman/targets/centos.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#containerObject (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

#updateObject



25
26
27
# File 'lib/pkgman/targets/centos.rb', line 25

def update
  @container.execute('yum update -y --setopt=tsflags=nodocs')
end