Sha256: a7bd428ce36cb2502a3b0acd82e206cc26c5ba5259512bf3ae9b86981574f69f

Contents?: true

Size: 1 KB

Versions: 14

Compression:

Stored size: 1 KB

Contents

module ProconBypassMan
  module RemotePbmAction
    class ChangePbmVersionAction < BaseAction

      def action_content(args: )
        require "pbmenv"
        ProconBypassMan.logger.info "execute ChangePbmVersionAction!"
        pbm_version = args["pbm_version"] or raise(ProconBypassMan::RemotePbmAction::NeedPbmVersionError, "pbm_versionが必要です, #{args.inspect}")
        Pbmenv.uninstall(pbm_version) # 途中でシャットダウンしてしまった、とか状態が途中の状態かもしれないので一旦消す
        Pbmenv.install(pbm_version, enable_pbm_cloud: true)
        Pbmenv.use(pbm_version)
        ProconBypassMan.logger.info "#{pbm_version}へアップグレードしました"
        ProconBypassMan::ReportCompletedUpgradePbmJob.perform
        `reboot` # symlinkの参照先が変わるのでrebootする必要がある
      end

      private

      def before_action_callback
        be_processed
      end

      def after_action_callback
        # no-op
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
procon_bypass_man-0.3.4 lib/procon_bypass_man/remote_pbm_action/change_pbm_version_action.rb
procon_bypass_man-0.3.3.1 lib/procon_bypass_man/remote_pbm_action/change_pbm_version_action.rb
procon_bypass_man-0.3.3 lib/procon_bypass_man/remote_pbm_action/change_pbm_version_action.rb
procon_bypass_man-0.3.2 lib/procon_bypass_man/remote_pbm_action/change_pbm_version_action.rb
procon_bypass_man-0.3.1 lib/procon_bypass_man/remote_pbm_action/change_pbm_version_action.rb
procon_bypass_man-0.3.0 lib/procon_bypass_man/remote_pbm_action/change_pbm_version_action.rb
procon_bypass_man-0.2.3 lib/procon_bypass_man/remote_pbm_action/change_pbm_version_action.rb
procon_bypass_man-0.2.2 lib/procon_bypass_man/remote_pbm_action/change_pbm_version_action.rb
procon_bypass_man-0.2.1 lib/procon_bypass_man/remote_pbm_action/change_pbm_version_action.rb
procon_bypass_man-0.2.0 lib/procon_bypass_man/remote_pbm_action/change_pbm_version_action.rb
procon_bypass_man-0.1.23 lib/procon_bypass_man/remote_pbm_action/change_pbm_version_action.rb
procon_bypass_man-0.1.22 lib/procon_bypass_man/remote_pbm_action/change_pbm_version_action.rb
procon_bypass_man-0.1.21 lib/procon_bypass_man/remote_pbm_action/change_pbm_version_action.rb
procon_bypass_man-0.1.20.2 lib/procon_bypass_man/remote_pbm_action/change_pbm_version_action.rb