Sha256: 471ae8314dc8d257407127836ee7ea68dd385b6d4996db90a51bee7c2ae5bc95

Contents?: true

Size: 931 Bytes

Versions: 6

Compression:

Stored size: 931 Bytes

Contents

# frozen_string_literal: true

require 'travis/cli/setup'
require 'yaml'

module Travis
  module CLI
    class Setup
      class EngineYard < Service
        description 'automatic deployment to Engine Yard'

        def run
          deploy 'engineyard' do |config|
            eyrc                  = File.expand_path('.eyrc', Dir.home)
            config['api_key']     = YAML.load_file(eyrc)['api_token'] if File.exist?(eyrc)
            config['api_key']     = ask('API token: ') { |q| q.echo = '*' }.to_s unless config['api_key']
            env                   = ask('Environment (optional): ').to_s
            config['environment'] = env unless env.empty?
            migrate               = agree('Run migrations on deploy? ') { |q| q.default = 'yes' }
            config['migrate']     = ask('Migration command: ') { |q| q.default = 'rake db:migrate' } if migrate
          end
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
travis-1.14.0 lib/travis/cli/setup/engine_yard.rb
travis-1.13.3 lib/travis/cli/setup/engine_yard.rb
travis-1.13.2 lib/travis/cli/setup/engine_yard.rb
travis-1.13.1 lib/travis/cli/setup/engine_yard.rb
travis-1.13.0 lib/travis/cli/setup/engine_yard.rb
travis-1.12.0 lib/travis/cli/setup/engine_yard.rb