Sha256: b8b62ea1be54e41dbeb3e1d8945adf94045ee559a4f4c906ee797f2426610f48

Contents?: true

Size: 738 Bytes

Versions: 7

Compression:

Stored size: 738 Bytes

Contents

module Shipit
  module Api
    class DeploysController < BaseController
      require_permission :deploy, :stack

      def index
        render_resources stack.deploys_and_rollbacks
      end

      params do
        requires :sha, String, length: {in: 6..40}
        accepts :force, Boolean, default: false
        accepts :env, Hash, default: {}
      end
      def create
        commit = stack.commits.by_sha(params.sha) || param_error!(:sha, 'Unknown revision')
        param_error!(:force, "Can't deploy a locked stack") if !params.force && stack.locked?
        deploy = stack.trigger_deploy(commit, current_user, env: params.env, force: params.force)
        render_resource deploy, status: :accepted
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

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