build_docker_image.sh 666 B

12345678910111213141516171819
  1. #!/bin/bash
  2. set -ev
  3. docker pull $DOCKER_IMAGE
  4. bin/docker_wrapper build -t $DOCKER_IMAGE -f $DOCKERFILE .
  5. if [[ -n "${DOCKER_USER}" && "${TRAVIS_PULL_REQUEST}" = 'false' && "${TRAVIS_BRANCH}" = "master" ]]; then
  6. docker login -u $DOCKER_USER -p $DOCKER_PASS
  7. docker tag $DOCKER_IMAGE $DOCKER_IMAGE:$TRAVIS_COMMIT
  8. docker push $DOCKER_IMAGE
  9. docker push $DOCKER_IMAGE:$TRAVIS_COMMIT
  10. else
  11. echo "Docker image are only pushed for builds of the master branch when Docker Hub credentials are present."
  12. fi
  13. if [[ $DOCKER_IMAGE == "huginn/huginn-single-process" ]]; then
  14. DOCKER_IMAGE=huginn/huginn-test DOCKERFILE=docker/test/Dockerfile ./build_docker_image.sh
  15. fi