Class: AmazonStaticSite::Client::S3
- Inherits:
-
Base
- Object
- Base
- AmazonStaticSite::Client::S3
show all
- Defined in:
- lib/amazon_static_site/client/s3.rb
Instance Attribute Summary
Attributes inherited from Base
#service
Instance Method Summary
collapse
Methods inherited from Base
#initialize
Instance Method Details
#create_buckets ⇒ Object
4
5
6
7
|
# File 'lib/amazon_static_site/client/s3.rb', line 4
def create_buckets
primary
secondary
end
|
#primary ⇒ Object
9
10
11
|
# File 'lib/amazon_static_site/client/s3.rb', line 9
def primary
@primary ||= get_bucket(config.domain.primary)
end
|
#publish_static_website_on_s3 ⇒ Object
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
# File 'lib/amazon_static_site/client/s3.rb', line 17
def publish_static_website_on_s3
puts "Publish static web site:".yellow
s3_client.put_bucket_website(
bucket: config.domain.primary,
website_configuration: {
index_document: {
suffix: "index.html"
},
error_document: {
key: "error.html"
}
}
)
puts " Primary #{config.domain.primary} DONE"
s3_client.put_bucket_website(
bucket: config.domain.secondary,
website_configuration: {
redirect_all_requests_to: {
host_name: config.domain.primary,
protocol: "https",
},
}
)
puts " Secondary #{config.domain.secondary} DONE"
end
|
#s3_primary ⇒ Object
43
|
# File 'lib/amazon_static_site/client/s3.rb', line 43
def s3_primary; s3_domain(config.domain.primary); end
|
#s3_secondary ⇒ Object
44
|
# File 'lib/amazon_static_site/client/s3.rb', line 44
def s3_secondary; s3_domain(config.domain.secondary); end
|
#secondary ⇒ Object
13
14
15
|
# File 'lib/amazon_static_site/client/s3.rb', line 13
def secondary
@secondary ||= get_bucket(config.domain.secondary)
end
|