Sha256: b18dfed959a00f1030c108d3391652029000f8aa834395085b2a75a76c042a1a

Contents?: true

Size: 722 Bytes

Versions: 21

Compression:

Stored size: 722 Bytes

Contents

module Shipit
  class RollbacksController < ShipitController
    before_action :load_stack
    before_action :load_deploy

    def create
      return redirect_to rollback_stack_deploy_path(@stack, @deploy) if !params[:force] && @stack.active_task?
      @rollback = @deploy.trigger_rollback(current_user, env: rollback_params[:env])
      redirect_to stack_deploy_path(@stack, @rollback)
    end

    private

    def load_stack
      @stack ||= Stack.from_param!(params[:stack_id])
    end

    def load_deploy
      @deploy = @stack.deploys.find(rollback_params[:parent_id])
    end

    def rollback_params
      params.require(:rollback).permit(:parent_id, env: @stack.deploy_variables.map(&:name))
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
shipit-engine-0.18.0 app/controllers/shipit/rollbacks_controller.rb
shipit-engine-0.17.0 app/controllers/shipit/rollbacks_controller.rb
shipit-engine-0.16.0 app/controllers/shipit/rollbacks_controller.rb
shipit-engine-0.15.0 app/controllers/shipit/rollbacks_controller.rb
shipit-engine-0.14.0 app/controllers/shipit/rollbacks_controller.rb
shipit-engine-0.13.0 app/controllers/shipit/rollbacks_controller.rb
shipit-engine-0.12.1 app/controllers/shipit/rollbacks_controller.rb
shipit-engine-0.12.0 app/controllers/shipit/rollbacks_controller.rb
shipit-engine-0.11.0 app/controllers/shipit/rollbacks_controller.rb
shipit-engine-0.10.0 app/controllers/shipit/rollbacks_controller.rb
shipit-engine-0.9.0 app/controllers/shipit/rollbacks_controller.rb
shipit-engine-0.8.9 app/controllers/shipit/rollbacks_controller.rb
shipit-engine-0.8.8 app/controllers/shipit/rollbacks_controller.rb
shipit-engine-0.8.7 app/controllers/shipit/rollbacks_controller.rb
shipit-engine-0.8.6 app/controllers/shipit/rollbacks_controller.rb
shipit-engine-0.8.5 app/controllers/shipit/rollbacks_controller.rb
shipit-engine-0.8.4 app/controllers/shipit/rollbacks_controller.rb
shipit-engine-0.8.3 app/controllers/shipit/rollbacks_controller.rb
shipit-engine-0.8.2 app/controllers/shipit/rollbacks_controller.rb
shipit-engine-0.8.1 app/controllers/shipit/rollbacks_controller.rb