build technical image

This commit is contained in:
Matthias 2018-08-14 09:44:21 +02:00
parent af7283017b
commit 0535660db7
2 changed files with 12 additions and 4 deletions

6
Dockerfile.technical Normal file
View File

@ -0,0 +1,6 @@
FROM freqtradeorg/freqtrade:develop
RUN apt-get update \
&& apt-get -y install git \
&& apt-get clean \
&& pip install git+https://github.com/berlinguyinca/technical

View File

@ -1,10 +1,8 @@
#!/bin/sh #!/bin/sh
# Tag with travis build
TAG=$TRAVIS_BUILD_NUMBER
# - export TAG=`if [ "$TRAVIS_BRANCH" == "develop" ]; then echo "latest"; else echo $TRAVIS_BRANCH ; fi` # - export TAG=`if [ "$TRAVIS_BRANCH" == "develop" ]; then echo "latest"; else echo $TRAVIS_BRANCH ; fi`
# Replace / with _ to create a valid tag # Replace / with _ to create a valid tag
TAG=$(echo "${TRAVIS_BRANCH}" | sed -e "s/\//_/") TAG=$(echo "${TRAVIS_BRANCH}" | sed -e "s/\//_/")
TAG_TECH="${TAG}_technical"
# Pull last build to avoid rebuilding the whole image # Pull last build to avoid rebuilding the whole image
docker pull ${REPO}:${TAG} docker pull ${REPO}:${TAG}
@ -23,6 +21,10 @@ if [ $? -ne 0 ]; then
return 1 return 1
fi fi
# build technical image
sed -i Dockerfile.technical -e "s/FROM freqtradeorg\/freqtrade:develop/FROM freqtradeorg\/freqtrade:${TAG}/"
docker build --cache-from freqtrade:${TAG} -t ${IMAGE_NAME}:${TAG_TECH} -f Dockerfile.technical .
# Tag image for upload # Tag image for upload
docker tag freqtrade:$TAG ${IMAGE_NAME}:$TAG docker tag freqtrade:$TAG ${IMAGE_NAME}:$TAG
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
@ -31,7 +33,7 @@ if [ $? -ne 0 ]; then
fi fi
# Tag as latest for develop builds # Tag as latest for develop builds
if [ "${TRAVIS_BRANCH}" == "develop" ]; then if [ "${TRAVIS_BRANCH}" = "develop" ]; then
docker tag freqtrade:$TAG ${IMAGE_NAME}:latest docker tag freqtrade:$TAG ${IMAGE_NAME}:latest
fi fi