Sha256: e49be1dc21a4c6a84f26ce3b38baff72157e4850b6bfe8943d2d982a92c20252

Contents?: true

Size: 1000 Bytes

Versions: 5

Compression:

Stored size: 1000 Bytes

Contents

module Pvcglue
  class Packages
    class Secrets < Pvcglue::Packages
      def installed?
        false
      end

      def install!
        Pvcglue::Env.initialize_stage_env
        connection.write_to_file_from_template(user_name, 'web.env.erb', Pvcglue.cloud.env_file_name, nil, nil, '0640') # TODO:  Double check permissions
        restart_web_app!
      end

      def post_install_check?
        true
      end

      def restart_web_app!
        if connection.file_exists?(user_name, Pvcglue.cloud.deploy_to_app_current_temp_dir)
          connection.ssh!(user_name, '', "touch #{Pvcglue.cloud.restart_txt_file_name}")
        end
      end

      def self.load_for_stage
        data = Pvcglue::Packages::Manager.new.load_secrets
        data = '' if data.nil?
        Pvcglue.cloud.stage_env = TOML.parse(data)
      end

      def self.save_for_stage
        data = TOML.dump(Pvcglue.cloud.stage_env)
        Pvcglue::Packages::Manager.new.save_secrets(data)
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
pvcglue-0.9.4 lib/pvcglue/packages/secrets.rb
pvcglue-0.9.3 lib/pvcglue/packages/secrets.rb
pvcglue-0.9.2 lib/pvcglue/packages/secrets.rb
pvcglue-0.9.1 lib/pvcglue/packages/secrets.rb
pvcglue-0.9.0 lib/pvcglue/packages/secrets.rb