1
0

build_docker_image.sh 676 B

1234567891011121314151617181920
  1. #!/bin/bash
  2. set -e
  3. : ${DOCKER_IMAGE:=huginn/huginn}
  4. : ${DOCKER_IMAGE_TAG:=${GITHUB_SHA:-$(git rev-parse HEAD)}}
  5. : ${DOCKERFILE:=docker/multi-process/Dockerfile}
  6. docker build $BUILD_ARGS -t "$DOCKER_IMAGE" -f "$DOCKERFILE" .
  7. if [[ "$1" == --push ]]; then
  8. [[ -n "$DOCKER_USER" && -n "$DOCKER_IMAGE_TAG" ]]
  9. docker login -u "$DOCKER_USER" -p "$DOCKER_PASS" "$REGISTRY"
  10. docker tag "$DOCKER_IMAGE" "$DOCKER_IMAGE:$DOCKER_IMAGE_TAG"
  11. docker push "$DOCKER_IMAGE"
  12. docker push "$DOCKER_IMAGE:$DOCKER_IMAGE_TAG"
  13. fi
  14. if [[ "$DOCKER_IMAGE" == *huginn/huginn-single-process ]]; then
  15. DOCKER_IMAGE=huginn/huginn-test DOCKERFILE=docker/test/Dockerfile ./build_docker_image.sh
  16. fi