Class: Stevenson::Deployer::S3
- Inherits:
-
Object
- Object
- Stevenson::Deployer::S3
- Includes:
- Base
- Defined in:
- lib/stevenson/deployers/s3.rb
Instance Attribute Summary collapse
-
#deployment_bucket_name ⇒ Object
readonly
Returns the value of attribute deployment_bucket_name.
-
#deployment_key ⇒ Object
readonly
Returns the value of attribute deployment_key.
Attributes included from Base
Instance Method Summary collapse
- #deploy!(directory) ⇒ Object
-
#initialize(options) ⇒ S3
constructor
A new instance of S3.
Methods included from Base
Constructor Details
#initialize(options) ⇒ S3
Returns a new instance of S3.
10 11 12 13 |
# File 'lib/stevenson/deployers/s3.rb', line 10 def initialize() @deployment_bucket_name, @deployment_key, @deployment_access_key, @deployment_access_secret = ["s3"] super end |
Instance Attribute Details
#deployment_bucket_name ⇒ Object (readonly)
Returns the value of attribute deployment_bucket_name.
8 9 10 |
# File 'lib/stevenson/deployers/s3.rb', line 8 def deployment_bucket_name @deployment_bucket_name end |
#deployment_key ⇒ Object (readonly)
Returns the value of attribute deployment_key.
8 9 10 |
# File 'lib/stevenson/deployers/s3.rb', line 8 def deployment_key @deployment_key end |
Instance Method Details
#deploy!(directory) ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/stevenson/deployers/s3.rb', line 15 def deploy!(directory) Dir.glob("#{directory}/**/*").each do |file| s3_bucket.files.create( key: File.join(deployment_key, file.partition(directory).last), body: File.read(file), public: true, ) if File.file?(file) end end |