webpack S3 scripts
Project description
Installation
$ [sudo] pip install webpack-s3
Pros
- store webpack build/etc files on S3
How it works
webpack/
hard-coded folder
scripts:
- create full-access/read-only user and credentials
- upload/download
webpack/
hard-coded environment variables names:
AWS_S3_WEBPACK_BUCKET
AWS_S3_WEBPACK_USER
AWS_S3_WEBPACK_ACCESS_KEY_ID
AWS_S3_WEBPACK_SECRET_ACCESS_KEY
webpack prod config:
const output = {
path: path.resolve('./webpack'),
filename: "[name]-[hash].js",
publicPath: 'https://'+process.env.AWS_S3_WEBPACK_BUCKET+'.s3.amazonaws.com/'
}
Scripts usage
command | usage |
---|---|
webpack-s3 |
usage: webpack-s3 command [args] |
webpack-s3-create-bucket |
usage: webpack-s3-create-bucket bucket |
webpack-s3-create-full-access-env |
usage: webpack-s3-create-full-access-env bucket |
webpack-s3-create-read-only-env |
usage: webpack-s3-create-read-only-env bucket |
webpack-s3-download |
usage: webpack-s3-download |
webpack-s3-upload |
usage: webpack-s3-upload |
Examples
Makefile
, create env
WEBPACK_BUCKET:=BUCKET_NAME
all:
test -s .env.s3.webpack || webpack-s3-create-full-access-env $(WEBPACK_BUCKET) > .env.s3.webpack
test -s .env.prod.webpack || webpack-s3-create-read-only-env $(WEBPACK_BUCKET) > .env.prod.webpack
build and upload to S3
set -o allexport
. .env.s3.webpack || exit
webpack --config webpack.config.prod.js || exit
webpack-s3-upload
optional: deploy webpack files to server
Dockerfile
ENTRYPOINT ["/bin/sh","/entrypoint.sh"]
entrypoint.sh
webpack-s3-download
...
ansible-playbook.yml
...
tasks:
- name: task_name
docker_container:
...
env_file: ".env"
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
webpack-s3-2019.8.30.tar.gz
(3.5 kB
view details)
File details
Details for the file webpack-s3-2019.8.30.tar.gz
.
File metadata
- Download URL: webpack-s3-2019.8.30.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9687338bdf3b146c67e420403505ae4b9ff8706b1dcb8df10a0ecdcc4bb78364 |
|
MD5 | d0057df1f05d8a48c75e6434f5e8b905 |
|
BLAKE2b-256 | 03eb62d3a8f8df4575e0777bafc4f6ab878ace93b5614615550dd912fefa943a |