Skip to content

Deploy website to S3

Peter Leitzen requested to merge pl-deploy into master

This MR enables the deployment of this project to AWS S3 with 3 bash scripts.

See README for instructions.

Part of gitlab#205168 (closed).

The current Proposal describes how will document the setup process.

This MR will the S3 and frontend part easier.

Out of scope

This MR does not provide any integration for Docker or Auto DevOps. See the follow-up MR !10 (merged) 👀

Verification

# Fresh project after `git clone`
$ git clean -ndx

# Build project
$ deploy/build_project
yarn install v1.21.1
[1/4] Resolving packages...

...

 DONE  Build complete. The dist directory is ready to be deployed.
 INFO  Check out deployment instructions at https://cli.vuejs.org/guide/deployment.html

Done in 9.98s.

# List need environment variables
$ export | grep -E "AWS|S3"
declare -x S3_BUCKET_NAME="pleitzen-status-page-mvc"
declare -x AWS_ACCESS_KEY_ID="AKIA3XKX1672T6TP5VM3"
declare -x AWS_SECRET_ACCESS_KEY="JVmVBmpzygF/fEWYL1ydThUzdhzuLg8rLwfXYpst"
declare -x AWS_DEFAULT_REGION="eu-west-1"

# Create S3 bucket and configure website
$ deploy/s3_setup
make_bucket: pleitzen-status-page-mvc
setting bucket policy
Website at: http://pleitzen-status-page-mvc.s3-website-eu-west-1.amazonaws.com

# Sync website
$ deploy/s3_sync
upload: dist/favicon.ico to s3://pleitzen-status-page-mvc/favicon.ico
upload: dist/index.html to s3://pleitzen-status-page-mvc/index.html
upload: dist/js/app.9b995020.js to s3://pleitzen-status-page-mvc/js/app.9b995020.js
upload: dist/js/app.9b995020.js.map to s3://pleitzen-status-page-mvc/js/app.9b995020.js.map
upload: dist/mock.json to s3://pleitzen-status-page-mvc/mock.json
upload: dist/js/chunk-vendors.5a5d1c43.js to s3://pleitzen-status-page-mvc/js/chunk-vendors.5a5d1c43.js
upload: dist/css/app.aef7469a.css to s3://pleitzen-status-page-mvc/css/app.aef7469a.css
upload: dist/js/chunk-vendors.5a5d1c43.js.map to s3://pleitzen-status-page-mvc/js/chunk-vendors.5a5d1c43.js.map

Deployed!

Verify via http://pleitzen-status-page-mvc.s3-website-eu-west-1.amazonaws.com

Screenshot

http://pleitzen-status-page-mvc.s3-website-eu-west-1.amazonaws.com

Screenshot_from_2020-02-29_22-27-13

Edited by Peter Leitzen

Merge request reports