forked from freqtrade/freqtrade
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cleanup root dir and create build_helpers
- Loading branch information
Showing
3 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/bin/sh | ||
# Tag with travis build | ||
TAG=$TRAVIS_BUILD_NUMBER | ||
# - export TAG=`if [ "$TRAVIS_BRANCH" == "develop" ]; then echo "latest"; else echo $TRAVIS_BRANCH ; fi` | ||
# Replace / with _ to create a valid tag | ||
TAG=$(echo "${TRAVIS_BRANCH}" | sed -e "s/\//_/") | ||
|
||
|
||
# Pull last build to avoid rebuilding the whole image | ||
docker pull ${REPO}:${TAG} | ||
|
||
docker build --cache-from ${IMAGE_NAME}:${TAG} -t freqtrade:${TAG} . | ||
if [ $? -ne 0 ]; then | ||
echo "failed building image" | ||
return 1 | ||
fi | ||
|
||
# Run backtest | ||
docker run --rm -it -v $(pwd)/config.json.example:/freqtrade/config.json:ro freqtrade:${TAG} --datadir freqtrade/tests/testdata backtesting | ||
|
||
if [ $? -ne 0 ]; then | ||
echo "failed running backtest" | ||
return 1 | ||
fi | ||
|
||
# Tag image for upload | ||
docker tag freqtrade:$TAG ${IMAGE_NAME}:$TAG | ||
if [ $? -ne 0 ]; then | ||
echo "failed tagging image" | ||
return 1 | ||
fi | ||
|
||
# Tag as latest for develop builds | ||
if [ "${TRAVIS_BRANCH}" == "develop" ]; then | ||
docker tag freqtrade:$TAG ${IMAGE_NAME}:latest | ||
fi | ||
|
||
# Login | ||
echo "$DOCKER_PASS" | docker login -u $DOCKER_USER --password-stdin | ||
|
||
if [ $? -ne 0 ]; then | ||
echo "failed login" | ||
return 1 | ||
fi | ||
|
||
# Show all available images | ||
docker images | ||
|
||
docker push ${IMAGE_NAME} | ||
if [ $? -ne 0 ]; then | ||
echo "failed pushing repo" | ||
return 1 | ||
fi |
File renamed without changes.