Skip to content

Commit

Permalink
Merge ddf93df into 9842120
Browse files Browse the repository at this point in the history
  • Loading branch information
rohanpm committed Mar 22, 2022
2 parents 9842120 + ddf93df commit d60cbf1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
10 changes: 1 addition & 9 deletions scripts/build-package
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
#!/bin/bash
set -e

export ORIGIN_RESPONSE_LOGGER_LEVEL=${ORIGIN_RESPONSE_LOGGER_LEVEL:-WARNING}
export ORIGIN_REQUEST_LOGGER_LEVEL=${ORIGIN_REQUEST_LOGGER_LEVEL:-WARNING}
export EXODUS_HEADERS_MAX_AGE=${EXODUS_HEADERS_MAX_AGE:-600}
export EXODUS_CONFIG_CACHE_TTL=${EXODUS_CONFIG_CACHE_TTL:-2}
export EXODUS_COOKIE_TTL=${EXODUS_COOKIE_TTL:-720}
export EXODUS_SECRET_ARN=${EXODUS_SECRET_ARN}
export EXODUS_KEY_ID=${EXODUS_KEY_ID}

pip install --require-hashes -r requirements.txt --target ./package
pip install --no-deps --target ./package .
cp ./configuration/exodus-lambda-deploy.yaml ./package
envsubst < ./configuration/lambda_config.template > ./package/lambda_config.json
scripts/mk-config > ./package/lambda_config.json
aws cloudformation package \
--template ./package/exodus-lambda-deploy.yaml \
--s3-bucket $PROJECT-pipeline-artifacts \
Expand Down
14 changes: 14 additions & 0 deletions scripts/mk-config
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
set -e

export ORIGIN_RESPONSE_LOGGER_LEVEL=${ORIGIN_RESPONSE_LOGGER_LEVEL:-WARNING}
export ORIGIN_REQUEST_LOGGER_LEVEL=${ORIGIN_REQUEST_LOGGER_LEVEL:-WARNING}
export EXODUS_HEADERS_MAX_AGE=${EXODUS_HEADERS_MAX_AGE:-600}
export EXODUS_CONFIG_CACHE_TTL=${EXODUS_CONFIG_CACHE_TTL:-2}
export EXODUS_COOKIE_TTL=${EXODUS_COOKIE_TTL:-720}
export PROJECT=${PROJECT:-exodus}
export ENV_TYPE=${ENV_TYPE:-dev}
export EXODUS_SECRET_ARN=${EXODUS_SECRET_ARN}
export EXODUS_KEY_ID=${EXODUS_KEY_ID}

envsubst < ./configuration/lambda_config.template
5 changes: 1 addition & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,14 @@ skip_install=true
whitelist_externals=
sh
rm
cp
commands=
rm -rf ./package package.zip

# --require-hashes and then --no-deps to avoid using anything untrusted from PyPI
pip install --require-hashes -r requirements.txt --target ./package
pip install --no-deps --target ./package .

# Always using hardcoded config for now.
sh -c 'envsubst < configuration/lambda_config.template > configuration/lambda_config.json'
cp configuration/lambda_config.json package
sh -c 'scripts/mk-config > package/lambda_config.json'

sh -c 'cd package && zip -r ../package.zip .'
rm -rf ./package
Expand Down

0 comments on commit d60cbf1

Please sign in to comment.