To install, run pip install d3ploy. To use, run d3ploy. Additional arguments may be specified. Run d3ploy --help for more information.
Your AWS credentials can be set in a number of ways:
When you run d3ploy, it will look in the current directory for a “deploy.json” file that defines the different deploy enviroments and their options. At a minimum, a “default” environment is required and is the environment used if you pass no arguments to d3ploy. Additionally, you may pass in a different path for you config file with the -c or --config options.
You can add as many environments as needed. Deploy to an environment by passing in its key like d3ploy staging. Environments besides “default” will inherit any settings not explicitly set from the default configuration.
The only required option for any environment is “bucket” for the S3 bucket to upload to. Additionally, you may define:
If you want to set Cache-Control headers on various files, add a cache object to your config file like:
"cache": {
"text/css": 2592000,
"application/javascript": 2592000,
"image/png": 22896000,
"image/jpeg": 22896000,
"image/webp": 22896000,
"image/gif": 22896000
}
Each key is the mimetype of the kind of file you want to have cached, with a value that is the seconds the max-age flag set to. In the above example, CSS and JavaScript files will be cached for 30 days while images will be cached for 1 year. For more about Cache-Control, read Leverage Browser Caching.
d3ploy will attempt to alert you via Notification Center when it is completed. To enable this feature, you need pyobjc; run pip install pyobjc to install.
Almost all modern browsers will support files that are served with gzip compression. The notable exception is non-smartphone mobile browsers. If you have significant traffic over those browsers, it is advisable to avoid the gzip option.