Python CSC Electronic Office
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
pyceo/docker.sh

39 lines
1.1 KiB

#!/bin/bash
set -x
case $1 in
up)
if ! [ -d venv ]; then
docker run --rm -v "$PWD:$PWD" -w "$PWD" python:3.7-buster \
sh -c "python -m venv venv && . venv/bin/activate && pip install -r dev-requirements.txt && pip install -r requirements.txt"
fi
docker network create ceod
for host in auth1 coffee mail phosphoric-acid; do
if [ $host = auth1 -o $host = coffee ]; then
image=debian:buster
else
image=python:3.7-buster
fi
docker run \
--detach \
--name $host \
--hostname $host \
--network ceod \
--volume "$PWD:$PWD" \
--workdir "$PWD" \
$image .drone/$host-setup.sh
done
;;
down)
for host in auth1 coffee mail phosphoric-acid; do
docker kill $host
docker rm $host
done
docker network rm ceod
;;
*)
echo 'Usage: docker.sh <up|down>' >&2
exit 1
;;
esac