s3_website

13
s3_website Hamamatsu.rb #69 1 — Hamamatsu.rb #69

Upload: yuto-ogi

Post on 16-Feb-2017

130 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: s3_website

s3_websiteHamamatsu.rb #69

1 — Hamamatsu.rb #69

Page 2: s3_website

s3_websitethe easiest way to publish static

html on AWS2 — Hamamatsu.rb #69

Page 3: s3_website

Amazon S3· cloud storage

· 99.999999999% durability· 99.99% availability

· charging by hour· Ex. ($0.0330/GB + request charge)/month

3 — Hamamatsu.rb #69

Page 4: s3_website

static site hostingcan publish only uploading html to S3.

4 — Hamamatsu.rb #69

Page 5: s3_website

s3_website· s3_website is rubygems

· repository https://github.com/laurilehmijoki/s3_website

· Jekyll· Amazon CloudFront

5 — Hamamatsu.rb #69

Page 6: s3_website

install s3_websitemkdir my_website && cd my_websitebundle initecho 'gem "s3_website"' >> Gemfilebundle install --path .bundle

6 — Hamamatsu.rb #69

Page 7: s3_website

setup websitebundle exec s3_website cfg create

7 — Hamamatsu.rb #69

Page 8: s3_website

s3_website.yml# aws access key & secrets3_id: <%= ENV["AWS_ACCESS_KEY"] %>s3_secret: <%= ENV["AWS_ACCESS_SECRET"] %>s3_bucket: my-awesome-website

# html dirnamesite: html

# aws regions3_endpoint: ap-northeast-1

8 — Hamamatsu.rb #69

Page 9: s3_website

generate AmazonS3 bucket.bundle exec s3_website cfg apply

Applying the configurations in s3_website.yml on the AWS services ...Created bucket my-awesome-website in the us-east-1 RegionBucket my-awesome-website now functions as a websiteNo redirects to configure for my-awesome-website bucketBucket my-awesome-website is now readable to the whole worldDo you want to deliver your website via CloudFront, Amazon’s CDN service? [y/N] N

9 — Hamamatsu.rb #69

Page 10: s3_website

publish html files.bundle exec s3_website push

[info] Successfully pushed the website tohttp://my-awesome-website.s3-website-ap-northeast-1.amazonaws.com

10 — Hamamatsu.rb #69

Page 11: s3_website

generated files.$ tree.|-- Gemfile|-- Gemfile.lock|-- html| `-- index.html`-- s3_website.yml

1 directory, 4 files

11 — Hamamatsu.rb #69

Page 12: s3_website

* notice *· Need to delete bucket manually.

· Bucket name is unique in all of the world.

12 — Hamamatsu.rb #69

Page 13: s3_website

that's all.Simple & Easy

13 — Hamamatsu.rb #69