build_docker_image.sh 830 B

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