Class: Larrow::Runner::Manifest::Erlang

Inherits:
Object
  • Object
show all
Defined in:
lib/larrow/runner/manifest/adapter/travis.rb

Constant Summary collapse

TEMPLATE_PATH =
'/opt/install/erlang/%s'

Class Method Summary collapse

Class Method Details

.fulfill(data, configuration) ⇒ Object



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/larrow/runner/manifest/adapter/travis.rb', line 34

def self.fulfill data, configuration
  revision = case data[:otp_release].last
             when /R15/ then 'R15B03'
             when /R16/ then 'R16B03'
             when /17/  then '17.1'
             end rescue '17'
  install_dir = sprintf(TEMPLATE_PATH,revision.downcase)
  lines = <<-EOF
echo '-s' >> .curlrc
curl https://raw.githubusercontent.com/spawngrid/kerl/master/kerl -o /usr/local/bin/kerl
chmod a+x /usr/local/bin/kerl
kerl update releases
kerl build #{revision} #{revision}
kerl install #{revision} #{install_dir}
echo 'source #{install_dir}/activate' >> $HOME/.bashrc
  EOF
  lines.split(/\n/).each do |line|
    s = Script.new line
    configuration.put_to_step :init, s
  end
end