Class: Microstatic::Rake::S3DeployTask
- Inherits:
-
Rake::TaskLib
- Object
- Rake::TaskLib
- Microstatic::Rake::S3DeployTask
- Defined in:
- lib/microstatic/rake/s3_deployer_task.rb
Instance Method Summary collapse
- #define ⇒ Object
-
#initialize(task_env) ⇒ S3DeployTask
constructor
A new instance of S3DeployTask.
Constructor Details
#initialize(task_env) ⇒ S3DeployTask
Returns a new instance of S3DeployTask.
6 7 8 |
# File 'lib/microstatic/rake/s3_deployer_task.rb', line 6 def initialize(task_env) @task_env = task_env end |
Instance Method Details
#define ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/microstatic/rake/s3_deployer_task.rb', line 10 def define require 'microstatic' te = @task_env te.check_for_mandatory_opts! desc "deploy to the '#{te.bucket_name}' S3 bucket" unless ::Rake.application.last_comment task te.task_name_or('s3deploy') do te.check_for_aws_creds! deployer = Microstatic::S3Deployer.build( te.source_dir, te.bucket_name, te.aws_creds ) deployer.exclude_files(te.exclude) if te.exclude deployer.upload end end |