Sha256: 56a54a153659784403f16f6a96083c1c4f65422eabb1396c213b79f5644d0873

Contents?: true

Size: 1.14 KB

Versions: 10

Compression:

Stored size: 1.14 KB

Contents

namespace :eb do
  def eb_deployer_env
    ENV['EB_DEPLOYER_ENV'] || 'dev'
  end

  def eb_deployer_package
    name = File.basename(Dir.pwd).downcase.gsub(/[^0-9a-z]/, '-').gsub(/--/, '-')
    "tmp/#{name}.zip"
  end

  desc "Remove the package file we generated."
  task :clean do
    sh "rm -rf #{eb_deployer_package}"
  end

  desc "Build package for eb_deployer to deploy to a Ruby environment in tmp directory. It zips all file list by 'git ls-files'"
  task :package => [:clean, :environment] do
    sh "git ls-files | zip #{eb_deployer_package} -@"
  end

  desc "Deploy package we built in tmp directory. default to dev environment, specify environment variable EB_DEPLOYER_ENV to override, for example: EB_DEPLOYER_ENV=production rake eb:deploy."
  task :deploy => [:package] do
    app_name = Rails.application.class.parent_name.downcase
    sh "eb_deploy -p #{eb_deployer_package} -e #{eb_deployer_env}"
  end

  desc "Destroy Elastic Beanstalk environments. It won't destroy resources defined in eb_deployer.yml. Default to dev environment, specify EB_DEPLOYER_ENV to override."
  task :destroy do
    sh "eb_deploy -d -e #{eb_deployer_env}"
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
eb_deployer-0.5.0 lib/generators/eb_deployer/install/templates/eb_deployer.rake
eb_deployer-0.4.13 lib/generators/eb_deployer/install/templates/eb_deployer.rake
eb_deployer-0.4.12 lib/generators/eb_deployer/install/templates/eb_deployer.rake
eb_deployer-0.4.11 lib/generators/eb_deployer/install/templates/eb_deployer.rake
eb_deployer-0.4.10 lib/generators/eb_deployer/install/templates/eb_deployer.rake
eb_deployer-0.4.9 lib/generators/eb_deployer/install/templates/eb_deployer.rake
eb_deployer-0.4.8 lib/generators/eb_deployer/install/templates/eb_deployer.rake
eb_deployer-0.4.7.beta1 lib/generators/eb_deployer/install/templates/eb_deployer.rake
eb_deployer-0.4.6 lib/generators/eb_deployer/install/templates/eb_deployer.rake
eb_deployer-0.4.5 lib/generators/eb_deployer/install/templates/eb_deployer.rake