This repository was archived by the owner on Jun 30, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +315
-8
lines changed
Expand file tree Collapse file tree 4 files changed +315
-8
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,17 @@ PY_VERSION := 3.6
44export PYTHONUNBUFFERED := 1
55
66BUILD_DIR := dist
7+ TEMPLATE_DIR := sam
8+
9+ # Required environment variables (user must override)
10+
11+ # S3 bucket used for packaging SAM templates
12+ PACKAGE_BUCKET ?= <bucket>
13+
14+ # user can optionally override the following by setting environment variables with the same names before running make
15+
16+ # Stack name used when deploying the app for manual testing
17+ APP_STACK_NAME ?= aws-serverless-codepipeline-serverlessrepo-publish
718
819PYTHON := $(shell /usr/bin/which python$(PY_VERSION ) )
920
@@ -27,6 +38,12 @@ test: compile-app
2738build : package test
2839
2940package : compile-app
41+ cp -r $(TEMPLATE_DIR ) /app.yml app $(BUILD_DIR )
42+
3043 # package dependencies in lib dir
3144 pipenv lock --requirements > $(BUILD_DIR)/requirements.txt
32- pipenv run pip install -t $(BUILD_DIR ) /app/lib -r $(BUILD_DIR ) /requirements.txt
45+ pipenv run pip install -t $(BUILD_DIR)/app/lib -r $(BUILD_DIR)/requirements.txt
46+
47+ deploy : package
48+ pipenv run sam package --template-file $(BUILD_DIR ) /app.yml --s3-bucket $(PACKAGE_BUCKET ) --output-template-file $(BUILD_DIR ) /packaged-app.yml
49+ pipenv run sam deploy --template-file $(BUILD_DIR ) /packaged-app.yml --stack-name $(APP_STACK_NAME ) --capabilities CAPABILITY_IAM
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ pytest = "*"
1111"flake8" = " *"
1212pydocstyle = " *"
1313pytest-cov = " *"
14+ aws-sam-cli = " *"
1415
1516[requires ]
1617python_version = " 3.6"
You can’t perform that action at this time.
0 commit comments