tdoly's blog


  • Home

  • Categories

  • Archives

Delpoy Blog To GCS

Posted on 2018-09-18

使用Google Cloud Storage部署静态博客。

Google GCS(Google Cloud Storage)介绍

More info: GCS

Google SDK

More info: SDK

Mac Install SDK

1
$ brew install google-cloud-sdk

GSUTIL

More info : gsutil

  1. 创建分区

    1
    gsutil mb gs://www.example.com
  2. 上传文件

    1
    2
    gsutil cp Desktop/index.html gs://www.example.com
    gsutil rsync -R local-dir gs://www.example.com
  3. 共享您的文件

    1
    gsutil acl ch -u AllUsers:R gs://www.example.com/index.html
  4. 设置
    使用 gsutil web set 命令设置 MainPageSuffix 属性(搭配 -m 标志)和 NotFoundPage(搭配 -e 标志):

    1
    gsutil web set -m index.html -e 404.html gs://www.example.com
  5. 删除

    1
    gsutil rm -r gs://www.example.com

启用CDN & DNS & HTTPS

Use Cloudflare

Hexo Deploy

1
$ npm install git+https://github.com/bigcat/hexo-deployer-gcs.git --save

Create service account key

1
2
3
4
5
deploy:
- type: gcs
bucket: <GCP GCS bucket name>
projectId: <GCP projectID>
keyFilename: <key file path>

Hello World

Posted on 2018-04-27

Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.

Quick Start

Create a new post

1
$ hexo new "My New Post"

More info: Writing

Run server

1
$ hexo server

More info: Server

Generate static files

1
$ hexo generate

More info: Generating

Deploy to remote sites

1
$ hexo deploy

More info: Deployment

tdoly

2 posts
2 tags
© 2018 tdoly
Powered by Hexo
|
Theme — NexT.Muse