mirror of
https://github.com/BishopFox/GitGot.git
synced 2026-11-07 09:45:58 -10:00
24 lines
616 B
Bash
Executable File
24 lines
616 B
Bash
Executable File
#!/bin/bash
|
|
|
|
if [[ -f "Dockerfile" && -f "gitgot.py" ]]; then
|
|
if [ -z $(docker images -q gitgot) ]; then
|
|
# Display output on fresh container build
|
|
docker build -t gitgot .
|
|
else
|
|
# Silent rebuild if in project directory
|
|
docker build -t gitgot . 2>&1 > /dev/null
|
|
fi
|
|
else
|
|
echo "Not in project directory. Skipping container update/rebuild..."
|
|
fi
|
|
|
|
if [[ ! -d "logs" || ! -d "states" ]]; then
|
|
mkdir logs states
|
|
fi
|
|
|
|
docker run --rm -it \
|
|
-e GITHUB_ACCESS_TOKEN=$GITHUB_ACCESS_TOKEN \
|
|
-v $PWD/logs:/gitgot/logs \
|
|
-v $PWD/states:/gitgot/states \
|
|
gitgot "$@"
|