mirror of
https://github.com/jongracecox/anybadge.git
synced 2025-07-21 04:11:05 +02:00
* Make `build_examples.py` callable from python * Allow tests to run from outside project directory * Add invoke tasks * Add server tests * Run travis tests against wheel package instead of local code * Update `badge.write_badge()` to support `pathlib.Path` * Update `CONTRIBUTING.md`
25 lines
541 B
Python
25 lines
541 B
Python
import subprocess
|
|
|
|
from invoke import task
|
|
|
|
|
|
@task
|
|
def docker_build(c):
|
|
print("Building Docker image...")
|
|
subprocess.run("docker build . -t anybadge:latest", shell=True)
|
|
|
|
|
|
@task
|
|
def docker_run(c, port=8000):
|
|
print("Running server in Docker container...")
|
|
subprocess.run(
|
|
f"docker run -it --rm -p{port}:{port}/tcp anybadge:latest --port={port}",
|
|
shell=True,
|
|
)
|
|
|
|
|
|
@task
|
|
def run(c, port=8000):
|
|
print("Running server locally...")
|
|
subprocess.run(f"python3 anybadge_server.py --port={port}", shell=True)
|