Skip to content

Instantly share code, notes, and snippets.

@jacobo
Created August 12, 2013 23:02
Show Gist options
  • Save jacobo/6216165 to your computer and use it in GitHub Desktop.
Save jacobo/6216165 to your computer and use it in GitHub Desktop.
for travis gem
def setup_engineyard
configure 'deploy', 'provider' => 'engineyard' do |config|
eyrc = File.expand_path(".eyrc", Dir.home)
if File.exists?(eyrc)
config['api_key'] = YAML.load_file(eyrc)["api_token"]
end
env = ask("Environment (optional): ").to_s
config['environment'] = env unless env.empty?
if agree("Run migrations on deploy? ") { |q| q.default = 'yes' }
config['migrate'] = ask("Migration command: ") { |q| q.default = "rake db:migrate" }
end
config['on'] = { 'repo' => repository.slug } if agree("Deploy only from #{repository.slug}? ") { |q| q.default = 'yes' }
encrypt(config, 'api_key') if agree("Encrypt API key? ") { |q| q.default = 'yes' }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment