Skip to content

Commit

Permalink
API-1821 Dockerize testing sample
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanmartins committed Dec 5, 2023
1 parent 4d58c31 commit 82058db
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,9 @@ ENV/
# OS generated files
.DS_Store
.idea/

# Ignore secret files
secret.json

# Ignore volume folder created by docker
app/
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM python:3.9
ENV PYTHONUNBUFFERED 1

RUN apt-get clean && apt-get update

RUN mkdir /app
WORKDIR /app

RUN pip install bynder-sdk

COPY . /app/
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
DISTNAME= $(shell python setup.py --name | sed 's/-/_/g' )

.PHONY: test
test: lint unittest

Expand Down Expand Up @@ -36,3 +34,8 @@ testdeps:
.PHONY: typehint
typehint:
mypy --ignore-missing-imports --follow-imports=skip $(DISTNAME)

# make executeSdkSample sample-file-name=metaproperties.py
.PHONY: executeSdkSample
executeSdkSample:
docker-compose exec bynder-python-sdk python /app/samples/$(sample-file-name)
8 changes: 8 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: '3'
services:
bynder-python-sdk:
container_name: bynder-python-sdk
build: .
command: sh -c "tail -f /dev/null"
volumes:
- .:/app

0 comments on commit 82058db

Please sign in to comment.