generated from baikonur-oss/terraform-aws-template
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from baikonur-oss/init
Initialize repo
- Loading branch information
Showing
9 changed files
with
663 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,4 +17,4 @@ venv/ | |
|
||
### Others | ||
build/ | ||
package.zip | ||
lambda_package.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
IFS=$'\n\t' | ||
|
||
echo "[1/5] Activating venv" | ||
|
||
if [[ ! -f venv/bin/activate ]]; then | ||
echo "Could not find venv! Create a venv and try again." | ||
exit -1 | ||
fi | ||
|
||
source venv/bin/activate | ||
|
||
echo "[2/5] Cleaning cache" | ||
rm -rf build | ||
rm -rf lambda_package.zip | ||
|
||
echo "[3/5] Creating local copy" | ||
mkdir -p build | ||
cp lambda/*.py build/ | ||
cp lambda/requirements-deploy.txt build/ | ||
|
||
echo "[4/5] pip install" | ||
cd build | ||
docker run --rm -v $(pwd):/root/p python:3.7 pip3 install -r /root/p/requirements-deploy.txt -t /root/p/ > /dev/null | ||
|
||
echo "[5/5] Compiling and making zip package" | ||
python -m compileall . | ||
zip -r9 ../lambda_package.zip ./ -x ".*" > /dev/null | ||
cd .. | ||
|
||
echo "Finished!" |
Oops, something went wrong.