Sha256: f6ae3e2233b28caede2835af555dc2384034a98c1c8b527cf372e07de7b7ff75

Contents?: true

Size: 1.42 KB

Versions: 1

Compression:

Stored size: 1.42 KB

Contents

module Pvcglue
  class Packages
    class Rvm < Pvcglue::Packages
      def installed?
        connection.run_get_stdout!(user_name, '', 'type rvm | head -n 1') =~ /rvm is a function/
      end

      def install!
        connection.write_to_file_from_template(user_name, 'gemrc.erb', "/home/#{user_name}/.gemrc") # sets:  gem: --no-ri --no-rdoc
        connection.write_to_file_from_template(user_name, 'web.bashrc.erb', "/home/#{user_name}/.bashrc")

        connection.run_get_stdout!(user_name, '', 'gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3')
        # connection.run_get_stdout!(user_name, '', 'gpg --keyserver hkp://176.9.51.79 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3')
        # Do it again, the first time only sets things up, and does not import the keys
        connection.run!(user_name, '', '\curl -sSL https://get.rvm.io | bash -s stable --with-default-gems=bundler')

        # TODO: set autolibs mode so they are not installed automatically, as the user won't have sudo permissions later.
        # OR create a 'install' user that can sudo...might be easier...
        # Installing required packages: libreadline6-dev, libyaml-dev, libsqlite3-dev, sqlite3, autoconf, libgmp-dev, libgdbm-dev, libncurses5-dev, automake, libtool, bison, pkg-config, libffi-dev...............

        connection.run_get_stdout!(user_name, '', 'rvm requirements')

      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pvcglue-0.9.6 lib/pvcglue/packages/rvm.rb