Giter Site home page Giter Site logo

lektor-s3's Introduction

lektor-s3

lektor-s3 makes it easy to deploy your Lektor project to an S3 bucket.

Installation and Usage

Install with the usual Lektor toolchain. Within your project, run

lektor plugins add lektor-s3

You should see a message saying lektor-s3 has been added to the project.

Next, add an S3 bucket to your project's servers. In your project file (like blog.lektorproject), add the following:

[servers.s3]
name = S3
enabled = yes
target = s3://<YOUR-BUCKET>

For example, if you wanted to deploy to a bucket named 'huntedwumpus', you'd make that last line

target = s3://huntedwumpus

Now, if you call lektor deploy s3, Lektor will upload your built website to S3 in the bucket you targeted.

Important: the bucket must already exist. lektor-s3 won't automatically create the S3 bucket for you. AWS has a pretty good guide for how to set up a bucket to host a static website.

Credentials

You need to prove to S3 that you have permission to upload to the bucket you've chosen.

lektor-s3 uses boto, which means it will obey boto's usual flow for gathering credentials.

For a refresher, that means you have two options: you can store your credentials in an INI file at ~/.aws/credentials, or you can pass credentials in through the environment variables AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY.

If you have multiple sets of credentials, you can group them into profiles in your credentials file and choose the right one using the AWS_PROFILE environment variable. Your ~/.aws/credenials file might look like this:

[work]
aws_access_key_id = <...>
aws_secret_access_key = <...>

[personal]
aws_access_key_id = <...>
aws_secret_access_key = <...>

And then you can invoke lektor with the environment variable:

$ AWS_PROFILE=personal lektor deploy`

Contributing

Pull requests are super useful and encouraged! Once accepted, changes are published using lektor with lektor dev publish-plugin.

lektor-s3's People

Contributors

euphoris avatar spenczar avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.