Skip to content
This repository was archived by the owner on Jun 30, 2021. It is now read-only.

Commit 8de4049

Browse files
authored
Merge pull request #1 from awslabs/skeleton
Skeleton code with handlers.py
2 parents c9270d0 + fa3672a commit 8de4049

File tree

11 files changed

+751
-0
lines changed

11 files changed

+751
-0
lines changed

.gitignore

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
*.egg-info/
24+
.installed.cfg
25+
*.egg
26+
MANIFEST
27+
.idea*
28+
29+
# PyInstaller
30+
# Usually these files are written by a python script from a template
31+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
32+
*.manifest
33+
*.spec
34+
35+
# Installer logs
36+
pip-log.txt
37+
pip-delete-this-directory.txt
38+
39+
# Unit test / coverage reports
40+
htmlcov/
41+
.tox/
42+
.coverage
43+
.coverage.*
44+
.cache
45+
nosetests.xml
46+
coverage.xml
47+
*.cover
48+
.hypothesis/
49+
.pytest_cache/
50+
51+
# Translations
52+
*.mo
53+
*.pot
54+
55+
# Django stuff:
56+
*.log
57+
local_settings.py
58+
db.sqlite3
59+
60+
# Flask stuff:
61+
instance/
62+
.webassets-cache
63+
64+
# Scrapy stuff:
65+
.scrapy
66+
67+
# Sphinx documentation
68+
docs/_build/
69+
70+
# PyBuilder
71+
target/
72+
73+
# Jupyter Notebook
74+
.ipynb_checkpoints
75+
76+
# pyenv
77+
.python-version
78+
79+
# celery beat schedule file
80+
celerybeat-schedule
81+
82+
# SageMath parsed files
83+
*.sage.py
84+
85+
# Environments
86+
.env
87+
.venv
88+
env/
89+
venv/
90+
ENV/
91+
env.bak/
92+
venv.bak/
93+
94+
# Spyder project settings
95+
.spyderproject
96+
.spyproject
97+
98+
# Rope project settings
99+
.ropeproject
100+
101+
# mkdocs documentation
102+
/site
103+
104+
# mypy
105+
.mypy_cache/

Makefile

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
SHELL := /bin/sh
2+
PY_VERSION := 3.6
3+
4+
export PYTHONUNBUFFERED := 1
5+
6+
BUILD_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
18+
19+
PYTHON := $(shell /usr/bin/which python$(PY_VERSION))
20+
21+
.DEFAULT_GOAL := build
22+
23+
clean:
24+
rm -rf $(BUILD_DIR)
25+
26+
init:
27+
$(PYTHON) -m pip install pipenv --user
28+
pipenv sync --dev
29+
30+
compile-app:
31+
mkdir -p $(BUILD_DIR)
32+
pipenv run flake8 app
33+
pipenv run pydocstyle app
34+
35+
test: compile-app
36+
pipenv run py.test --cov=app -vv test/unit
37+
38+
build: package test
39+
40+
package: compile-app
41+
cp -r $(TEMPLATE_DIR)/app.yml app $(BUILD_DIR)
42+
43+
# package dependencies in lib dir
44+
pipenv lock --requirements > $(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

Pipfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[[source]]
2+
url = "https://pypi.org/simple"
3+
verify_ssl = true
4+
name = "pypi"
5+
6+
[packages]
7+
"boto3" = "*"
8+
9+
[dev-packages]
10+
pytest = "*"
11+
"flake8" = "*"
12+
pydocstyle = "*"
13+
pytest-cov = "*"
14+
aws-sam-cli = "*"
15+
16+
[requires]
17+
python_version = "3.6"

0 commit comments

Comments
 (0)