build_docker_image.sh 639 B

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