Created
July 5, 2021 16:38
-
-
Save kamontat/04e99e4c4bf97e6bfd0c581c026d9740 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
banner() { | |
echo | |
echo "----------------------------------------" | |
echo "$@" | |
echo "----------------------------------------" | |
echo | |
} | |
__ftdir="/freqtrade" | |
__imgname="freqtradeorg/freqtrade" | |
__imgtag="develop_plot_pg" | |
__pyreq="requirements.txt" | |
__deps=( | |
"psycopg2-binary==2.9.1" | |
) | |
banner "Move to freqtrade ($__ftdir)" | |
cd "$__ftdir" || exit 1 | |
banner "Collect current git SHA" | |
git log --pretty='format:%h' -n 1 >freqtrade_commit | |
if test -f "./.ftpversion"; then | |
echo "-" >>freqtrade_commit | |
cat ".ftpversion" >>freqtrade_commit | |
fi | |
banner "Add extra dependencies" | |
for dep in "${__deps[@]}"; do | |
if ! grep -q "$dep" <"$__pyreq"; then | |
echo "[info] adding $dep to $__pyreq" | |
echo "$dep" >>"$__pyreq" | |
fi | |
done | |
# rebuild local tag with postgres support | |
banner "Build docker image if postgres support" | |
docker build --tag "${__imgname}:${__imgtag}" . | |
unset __ftdir | |
unset __imgname __imgtag | |
unset __pyreq __deps |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment