Sha256: bf4ce206a1a6f3e1410e8f23ff53e3f6b01752f60973da5422ec05370ad3bdd5

Contents?: true

Size: 1.2 KB

Versions: 3

Compression:

Stored size: 1.2 KB

Contents

module AcquiaToolbelt
  class CLI
    class Deploy < AcquiaToolbelt::Thor
      # Public: Deploy a VCS branch or tag.
      #
      # Returns a status message.
      desc 'code', 'Deploy a VCS branch or tag to an environment.'
      method_option :release, :type => :string, :aliases => %w(-r), :required => true,
        :desc => 'Name of the release to deploy to the environment.'
      def code
        if options[:environment].nil?
          ui.say "No value provided for required options '--environment'"
          return
        end

        if options[:subscription]
          subscription = options[:subscription]
        else
          subscription = AcquiaToolbelt::CLI::API.default_subscription
        end

        environment = options[:environment]
        release     = options[:release]
        data        = { :key => 'path', :value => "#{release}" }

        deploy_code = AcquiaToolbelt::CLI::API.request "sites/#{subscription}/envs/#{environment}/code-deploy", 'QUERY-STRING-POST', data

        if deploy_code["id"]
          ui.success "#{release} has been deployed to #{environment}."
        else
          ui.fail AcquiaToolbelt::CLI::API.display_error(deploy_code)
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
acquia_toolbelt-2.4.1 lib/acquia_toolbelt/cli/deploy.rb
acquia_toolbelt-2.4.0 lib/acquia_toolbelt/cli/deploy.rb
acquia_toolbelt-2.3.2 lib/acquia_toolbelt/cli/deploy.rb