aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/docker
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2021-08-02 17:20:27 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2021-08-02 17:20:27 +0300
commitff1c099de24237e58ed7931acf3e2f3f40b7adcc (patch)
tree6d6cc585188e331ca7f2997999f6fa198cc9ef5c /docker
parenttest/integration/docker: remove output directory (diff)
downloadcgitize-ff1c099de24237e58ed7931acf3e2f3f40b7adcc.tar.gz
cgitize-ff1c099de24237e58ed7931acf3e2f3f40b7adcc.zip
docker: fix CMD handling
It was difficult to override CMD (due to the requirement to `activate` the venv), move the `activate` call to entrypoint.sh.
Diffstat (limited to '')
-rwxr-xr-xdocker/entrypoint.sh7
1 files changed, 5 insertions, 2 deletions
diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh
index cf6eb77..5a07263 100755
--- a/docker/entrypoint.sh
+++ b/docker/entrypoint.sh
@@ -10,7 +10,10 @@ set -o errexit -o nounset -o pipefail
schedule="${SCHEDULE:-once}"
case "$schedule" in
- once) exec "$@" ;;
+ once)
+ . /tmp/venv/bin/activate
+ exec "$@"
+ ;;
15min) schedule='*/15 * * * *' ;;
hourly) schedule='0 * * * *' ;;
daily) schedule='0 0 * * *' ;;
@@ -20,7 +23,7 @@ case "$schedule" in
esac
script="#!/bin/bash
-cd /usr/src &&$( printf -- ' %q' "$@" )"
+cd /usr/src && . /tmp/venv/bin/activate &&$( printf -- ' %q' "$@" )"
echo "$script" > /task.sh
chmod +x /task.sh