neobytes/docker/push-docker.sh
Alexander Block e805f790e3 Automatically build and push docker image to docker.io/dashpay/dashd-develop (#1809)
* Automatically build and push docker image to dashpay/dashd-develop

* Remove DOCKER_REPO env var from .travis.yml and add new-line to .gitignore

This should not have been there and results in errournous pushes to
"dashpay/dashd/dashpay/dashd-develop".

Also add missing new-line in .gitignore

* Fix Travis build failures happening due to large writes to stdout

Travis issue: https://github.com/travis-ci/travis-ci/issues/4704

Build failure happened since the introduction of secrets in .travis.yml

* Fix BUILD_DIR

Due to changes in develop the build dir has changed to be just "build".

* Remove bogus upload example from .travis.yml

* Switch to pushing on "develop" branch

Used "pr_docker" before for testing purposes.

* Only push docker image when TRAVIS_PULL_REQUEST = false
2018-01-10 12:17:43 +03:00

18 lines
474 B
Bash
Executable File

#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $DIR/..
DOCKER_IMAGE=${DOCKER_IMAGE:-dashpay/dashd-develop}
DOCKER_TAG=${DOCKER_TAG:-latest}
if [ -n "$DOCKER_REPO" ]; then
DOCKER_IMAGE_WITH_REPO=$DOCKER_REPO/$DOCKER_IMAGE
else
DOCKER_IMAGE_WITH_REPO=$DOCKER_IMAGE
fi
docker tag $DOCKER_IMAGE:$DOCKER_TAG $DOCKER_IMAGE_WITH_REPO:$DOCKER_TAG
docker push $DOCKER_IMAGE_WITH_REPO:$DOCKER_TAG
docker rmi $DOCKER_IMAGE_WITH_REPO:$DOCKER_TAG