Giter VIP home page Giter VIP logo

sdep's People

Contributors

mattjmcnaughton avatar

Watchers

 avatar  avatar

sdep's Issues

Update documentation

  • Document using sdep to deploy a blog.
  • Stop referencing Route53 and Cloudfront and instead give directions for working with whatever domain registrar and Cloudflare.

Detach `test_config.py` from user's local filesystem

Problem

Currently, the placement of different users .sdeprc files could impact the results from the test suite. Additionally, we avoided certain tests, or wrote them more generally, so as to avoid instances in which the local file system could effect test output. For example, the test for whether Config#locate_config_file finds ~/.sdeprc. Whether the user has an .sdeprc in the directory from which they are running these tests effects the result of this test.

Solution

As such, all file system tests should occur within a temporary scratch directory. We can mock calls to os.getcwd() and os.path.expanduser("~") so they return this mocked temp directory. We can then delete the temp directory after we are done running each test.

Create `test_utils.py` file containing common test utility functions

Right now, there is a decent amount of overlap in the helper functions we define in our different subclasses of unittest.TestCase. However, we should wait until we spin out config.py into its on class.

These utility functions would do things like handle the creation of temporary files and directories, etc.

Write application skeleton

Because of the strength of moto and boto for communicating/mocking communicating with AWS, I'm thinking it makes the most sense to write sdep in python. As such, I'll need to do the steps below for creating the application's skeleton. When in doubt, I emulate flask.

  • Define directory layout (i.e. where to place tests).
  • Configure travis.yml.
  • Write Makefile for building/pushing the package to pip.
  • Create Dockerfile for development environment and add common development tasks to the Makefile (i.e. test, lint).

Proper semver versioning

I messed up with semver on this project (starting with 0.10, instead of 0.1.0). So at some point, I'll just start over at 0.1.0. I'll need to update the dependencies for sites using sdep (just my sites) as well as delete the old tags and pip packages.

Document the command line interface and configuration options

Write good docs, with the accompanying code and tests, for the command line interface and where to specify configuration options. This process will allow us to determine the public api, and should also give a good sense of the next steps re coding.

  • Create the next issues tasks during this step.

Add main actions to `Sdep`

Add and test the main actions which can be taken on the static site. The Sdep class contains these actions.

  • create
  • update

Only upload to S3 the files that have changed

Currently we upload the entire site directory to s3 both during the create and update actions. S3 will just overwrite any files that are already there. If possible, we should only upload files that have changed during update. We could perform this selective upload either through checking the last modified times on the files, or checking hashes of files, or maybe something else.

Write and test config class

This class is responsible for reading configuration either from a file or environment variables and making it accessible to an instance of the Sdep class.

Add `index_suffix` and `error_key` as optional fields

When telling AWS to have our bucket perform like a website, with this boto call, we have the option of specifying which suffix will represent an index file (currently index.html) and the file to display when there is an error (currently 404.html). Make both of these configurable options with sensible defaults.

Add CHANGELOG

Add the CHANGELOG and think of a better way to schedule version updates.

Add AWS region as an optional config flag

Make AWS region an optional configuration flag, with a sensible default (i.e. us-east-1). This may not be super important if we're using Amazon CloudFront to serve the content from as close to the user as possible, but it seems like good practice regardless.

Add optional config flag for including `www` as subdomain

If we want to be able to access our site both from sdep-example.com and www.sdep-example.com, then we need to create S3 buckets for both, as indicated in this AWS tutorial.

This will just require small modifications to the create action to create both buckets, and perhaps modifications to the update action so we are updating the files in both buckets.

Abstract `config.py` into stand-alone package

All of the configuration handling for sdep is non-specific to this given use-case (except for some constants which could easily be passed as configuration values). Given our configuration handling is stand-alone and reusable, we should package the configuration handling into a stand-alone package which we will host on pip. We should not spin out until configuration is relatively stable, otherwise it will be too much of a pain to have to update the pip package every time we want to make a change.

Add option for specifying files/dirs to ignore in `SITE_DIR`

Currently, the directory we upload to S3 to serve as our static site is configurable through Config as SITE_DIR. However, currently we upload all the files in that directory. We should include a configuration option with files/dirs to ignore, so that they can specify files to not be uploaded.

Run `sdep` from command line

It should be possible to run $ sdep create from the terminal, as opposed to having to import the module and call it from a python file.

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.