Skip to content

Commit

Permalink
Merge pull request #5 from amancevice/python
Browse files Browse the repository at this point in the history
Convert to Python
  • Loading branch information
amancevice committed Apr 26, 2021
2 parents 30718ae + 458ddf8 commit 2bc3e4c
Show file tree
Hide file tree
Showing 32 changed files with 1,941 additions and 1,102 deletions.
4 changes: 0 additions & 4 deletions .dockerignore

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ on:
pull_request:
push:
schedule:
- cron: '11 21 * * *'
- cron: "11 21 * * *"
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- uses: hashicorp/setup-terraform@v1
- run: terraform fmt -check
- run: terraform init
Expand Down
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@
*.tfvars

**/.terraform/
**/node_modules/
*.env
*.iid
*.zip
.terraform.lock.hcl
!package.zip
.coverage
coverage.xml
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.8.9
10 changes: 0 additions & 10 deletions Dockerfile

This file was deleted.

33 changes: 7 additions & 26 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,19 @@ ENDPOINT = http://$$(REPO=$(REPO) docker-compose port lambda 8080)/2015-03-31/fu
all: validate

clean:
REPO=$(REPO) docker-compose down
rm -rf package.iid
rm -rf .terraform

clobber: clean
REPO=$(REPO) docker-compose down --rmi all --volumes
rm -rf .terraform.lock.hcl

down:
REPO=$(REPO) docker-compose down
up:
pipenv run lambda-gateway -p 3000 src.index.proxy

shell:
docker run -it --rm --entrypoint bash $(REPO)

up: package.iid
REPO=$(REPO) docker-compose up --detach lambda
@echo $(ENDPOINT)

validate: package.zip .terraform.lock.hcl
validate: | .terraform
terraform fmt -check
AWS_REGION=us-east-1 terraform validate

zip: package.zip

.PHONY: all clean clobber down shell up validate zip

package.zip: package.iid package-lock.json
docker run --rm --entrypoint cat $(REPO) $@ > $@

package-lock.json: package.json | package.iid
docker run --rm --entrypoint cat $(REPO) $@ > $@

package.iid: Dockerfile index.js package.json
docker build --iidfile $@ --tag $(REPO) .
.PHONY: all clean clobber up validate

.terraform.lock.hcl:
.terraform:
terraform init
18 changes: 18 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
boto3 = "*"

[dev-packages]
ipdb = "*"
ipython = "*"
lambda-gateway = "*"
pytest = "*"
pytest-cov = "*"
pytest-flake8 = "*"

[requires]
python_version = "3.8"

0 comments on commit 2bc3e4c

Please sign in to comment.