GithubHelp home page GithubHelp logo

ghv / print Goto Github PK

View Code? Open in Web Editor NEW
5.0 5.0 1.0 46 KB

Deploy static files to AWS S3 and CloudFront

License: Apache License 2.0

Swift 98.57% HTML 0.53% Makefile 0.90%

print's People

Contributors

ghv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

print's Issues

Add support to prune files

File names may change as new deployments are created. In this scenario, we will need a way to delete missing files from the S3 bucket.

A per-folder prune flag could enable this for the folder and all its children.

The logic would compare the files specified in the contents.json file versus the timestamp history of uploaded files .contents-ts.json in prior runs. Any file in the timestamp history list that does not have a source in the contents.json file should be deleted.

CloudFront Functions

Add support for deploying updates to CloudFront Functions and rolling them out to production.

Add support invalidation flags for folders

According to AWS documentation, you can invalidate up to 1,000 paths per month at no charge when you use CloudFront. Each additional invalidation path costs $0.005. An invalidation path that includes the โ€œ*โ€ character incurs the same charge as one that does not. You pay for one invalidation path, even if the path matches hundreds or thousands of objects

Rather than invalidating each file, add support to invalidate the folder (by adding a new flag in contents.json) if any file changes in the folders below it. This helps reduce the number of paths per invalidation and saves costs.

I propose invalidateFolderLevel be the flag's name to indicate the level where all changes under it should be reduced to this one folder path with a * rather than invalidating each file.

Readme cleanups

  • Fix syntax errors in sample policy
  • Update content.json schema
  • New parameter to keychain command
  • Review the rest of the content for clarity and completeness

Add support for more than one AWS key

The code currently only supports one Keychain item named "AWS," which violates minimum security profile policies by giving the same identity push rights to multiple S3/CloudFront deployment resources.

To allow custom AWS keys, an optional keychainItem property will be added to the contents.json file, defaulting to "AWS" if not specified.

The keychain command will gain a new --keychain-item option to write the Keychain data to the specified name.

From a security perspective, knowledge of the keychain item name does not reveal additional information.

print keychain --keychain-item PREVIEWDEPLOY __Access key ID__

Add support to upload a local file to a different remote file name in contents.json

This allows you to upload "blogpost1.html" as "index.html" in the current folder and upload multiple copies but not locations (each copy has to have a unique name).

The files array in the contents property will support elements that are either a string with the local path or an array of two elements where the first element is the local path to the file and the second element is the desired remote file name.

You only need to use the array of two elements if you want the remote name to differ from the local file name.

The .contents-ts.json lookup key for each file uploaded where these two names differ will be updated to "\(file[0]) as \(file[1])" in order to allow for the same local file to be uploaded to different remote names.

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.