init: Deploy tuxpub

This commit deploys tuxpub (downloads.trustedfirmware.org) using zappa
into a AWS lambda function. Currently this is deployed manually.

Signed-off-by: Benjamin Copeland <ben.copeland@linaro.org>
Change-Id: Ieaf0b2bbd8556db97060c6f649f865bc4316bec5
5 files changed
tree: 1dea95f0e394055b64657b18f0565224ffbe1c59
  1. Pipfile
  2. Pipfile.lock
  3. README.md
  4. zappa_init.py
  5. zappa_settings.yml
README.md

This repository uses Zappa, TuxPub, and pipenv to deploy a serverless S3 file server to the internet!

Installing

This will create Pipfile and Pipfile.lock.

$ pipenv install zappa
$ pipenv install git+https://gitlab.com/Linaro/tuxpublish.git@master#egg=tuxpub

Updating

This will update Pipfile.lock based on the most current version of the things listed in Pipfile.

$ pipenv update

Once it's already been deployed, changes (such as tuxpub updates) are deployed using 'zappa update'.

$ pipenv run zappa update dev
$ # test/validate dev
$ pipenv run zappa update prod

Running Locally

$ S3_BUCKET=trustedfirmware-prod-storage S3_REGION=us-east-1 ROOT_INDEX_LISTING=True FLASK_APP=tuxpub pipenv run flask run

Deploying

There are two environments: staging and production. The deploy and update verbs require an environment argument.

$ pipenv run zappa deploy dev

Certifying

To associate a zappa deploy with a domain name, as defined in zappa_settings.yml, run zappa certify. We use ACM certificates to terminate https, which were manually created and are automatically renewed.

$ pipenv run zappa certify dev