Sha256: 0d2c0f0cfd5e99393fe90bd268ff9207597cc3db7ab89fb552137b97908e11b9

Contents?: true

Size: 706 Bytes

Versions: 7

Compression:

Stored size: 706 Bytes

Contents

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

    def create
      case params[:status]
      when 'success'
        @deploy.report_healthy!(user: current_user)
      when 'failure'
        @deploy.report_faulty!(user: current_user)
      else
        render status: :unprocessable_entity, json: {message: "Invalid `status` parameter"}
      end
      render status: :created, json: @deploy.last_release_status
    end

    private

    def load_deploy
      @deploy = @stack.deploys_and_rollbacks.find(params[:deploy_id])
    end

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

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
shipit-engine-0.31.0 app/controllers/shipit/release_statuses_controller.rb
shipit-engine-0.30.0 app/controllers/shipit/release_statuses_controller.rb
shipit-engine-0.29.0 app/controllers/shipit/release_statuses_controller.rb
shipit-engine-0.28.1 app/controllers/shipit/release_statuses_controller.rb
shipit-engine-0.28.0 app/controllers/shipit/release_statuses_controller.rb
shipit-engine-0.27.1 app/controllers/shipit/release_statuses_controller.rb
shipit-engine-0.27.0 app/controllers/shipit/release_statuses_controller.rb