Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

s3_website

555 views

Published on

Hamamatsu.rb #69 にてs3_website gemについて話した資料です。

Published in: Technology
  • Be the first to comment

s3_website

  1. 1. s3_website Hamamatsu.rb#69 1 — Hamamatsu.rb #69
  2. 2. s3_website theeasiestwaytopublishstatic htmlonAWS 2 — Hamamatsu.rb #69
  3. 3. AmazonS3 · cloud storage · 99.999999999% durability · 99.99% availability · charging by hour · Ex. ($0.0330/GB + request charge)/month 3 — Hamamatsu.rb #69
  4. 4. staticsitehostingcan publish only uploading html to S3. 4 — Hamamatsu.rb #69
  5. 5. s3_website · s3_website is rubygems · repository https://github.com/laurilehmijoki/ s3_website · Jekyll · Amazon CloudFront 5 — Hamamatsu.rb #69
  6. 6. installs3_website mkdir my_website && cd my_website bundle init echo 'gem "s3_website"' >> Gemfile bundle install --path .bundle 6 — Hamamatsu.rb #69
  7. 7. setupwebsite bundle exec s3_website cfg create 7 — Hamamatsu.rb #69
  8. 8. s3_website.yml # aws access key & secret s3_id: <%= ENV["AWS_ACCESS_KEY"] %> s3_secret: <%= ENV["AWS_ACCESS_SECRET"] %> s3_bucket: my-awesome-website # html dirname site: html # aws region s3_endpoint: ap-northeast-1 8 — Hamamatsu.rb #69
  9. 9. generateAmazonS3bucket. 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 Region Bucket my-awesome-website now functions as a website No redirects to configure for my-awesome-website bucket Bucket my-awesome-website is now readable to the whole world Do you want to deliver your website via CloudFront, Amazon’s CDN service? [y/N] N 9 — Hamamatsu.rb #69
  10. 10. publishhtmlfiles. bundle exec s3_website push [info] Successfully pushed the website to http://my-awesome-website.s3-website-ap-northeast-1.amazonaws.com 10 — Hamamatsu.rb #69
  11. 11. generatedfiles. $ tree . |-- Gemfile |-- Gemfile.lock |-- html | `-- index.html `-- s3_website.yml 1 directory, 4 files 11 — Hamamatsu.rb #69
  12. 12. *notice* · Need to delete bucket manually. · Bucket name is unique in all of the world. 12 — Hamamatsu.rb #69
  13. 13. that'sall. Simple&Easy 13 — Hamamatsu.rb #69

×