init with crummy buzzer & docker setup

so much boilerplate :O
This commit is contained in:
ducklet 2021-01-29 01:20:17 +01:00
commit f6bf544f54
23 changed files with 746 additions and 0 deletions

9
scripts/build Executable file
View file

@ -0,0 +1,9 @@
#!/bin/sh -eu
dockerdir="$RUN_DIR"
image=$(cat "$dockerdir"/.dockerimage)
tag=latest
set -x
docker build "$@" --tag "$image":"$tag" "$dockerdir"

9
scripts/dev Executable file
View file

@ -0,0 +1,9 @@
#!/bin/sh -eu
cd "$RUN_DIR"
set -x
"$RUN_BIN" build
exec honcho start

20
scripts/dev-http Executable file
View file

@ -0,0 +1,20 @@
#!/bin/sh -eu
image=$(cat "$RUN_DIR"/.dockerimage)
tag=latest
pubport=8080
set -x
# TODO would be better to mount dev config somewhere else & merge in code
exec docker run --init --name dumpr-quiz-http \
--rm \
--read-only \
--label org.dumpr.quiz.service=http \
-p "$pubport":8000 \
-v "$RUN_DIR":/var/quiz:ro \
-v "$RUN_DIR"/dev/config.js:/var/quiz/public/config.js:ro \
"$image":"$tag" \
python -m http.server -d public/ 8000

14
scripts/dev-ws Executable file
View file

@ -0,0 +1,14 @@
#!/bin/sh -eu
image=$(cat "$RUN_DIR"/.dockerimage)
tag=latest
set -x
exec docker run --init --name dumpr-quiz-ws \
--rm \
--read-only \
--label org.dumpr.quiz.service=ws \
-p 8765:8765 \
-v "$RUN_DIR":/var/quiz:ro \
"$image":"$tag" "$@"

7
scripts/lint Executable file
View file

@ -0,0 +1,7 @@
#!/bin/sh -eux
autoflake --in-place --recursive --remove-duplicate-keys --remove-unused-variables --remove-all-unused-imports --ignore-init-module-imports "$RUN_DIR"
black "$RUN_DIR"
isort --profile black "$RUN_DIR"
prettier --write "$RUN_DIR"/public
shellcheck "$RUN_DIR"/scripts/*