Sha256: 4b0a0551ec98f563da333e5e0d0dbcb8b91fd1365e2a80446d24ee3d8713f1fa

Contents?: true

Size: 658 Bytes

Versions: 12

Compression:

Stored size: 658 Bytes

Contents

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

      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

12 entries across 12 versions & 1 rubygems

Version Path
shipit-engine-0.26.0 app/controllers/shipit/api/deploys_controller.rb
shipit-engine-0.25.1 app/controllers/shipit/api/deploys_controller.rb
shipit-engine-0.25.0 app/controllers/shipit/api/deploys_controller.rb
shipit-engine-0.24.0 app/controllers/shipit/api/deploys_controller.rb
shipit-engine-0.23.1 app/controllers/shipit/api/deploys_controller.rb
shipit-engine-0.23.0 app/controllers/shipit/api/deploys_controller.rb
shipit-engine-0.22.0 app/controllers/shipit/api/deploys_controller.rb
shipit-engine-0.21.0 app/controllers/shipit/api/deploys_controller.rb
shipit-engine-0.20.1 app/controllers/shipit/api/deploys_controller.rb
shipit-engine-0.20.0 app/controllers/shipit/api/deploys_controller.rb
shipit-engine-0.19.0 app/controllers/shipit/api/deploys_controller.rb
shipit-engine-0.18.1 app/controllers/shipit/api/deploys_controller.rb