You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
1.1 KiB

  1. #!/bin/sh
  2. #
  3. # Script to build images
  4. #
  5. # break on error
  6. set -e
  7. REPO="muccg"
  8. DATE=`date +%Y.%m.%d`
  9. DEVPI_VERSION="2.5.3"
  10. # ALternative config to use local proxy
  11. #DOCKER_HOST=$(ip -4 addr show docker0 | grep -Po 'inet \K[\d.]+')
  12. #HTTP_PROXY="http://${DOCKER_HOST}:3128"
  13. #PIP_INDEX_URL="http://${DOCKER_HOST}:3141/root/pypi/+simple/"
  14. #PIP_TRUSTED_HOST=${DOCKER_HOST}
  15. #: ${DOCKER_BUILD_OPTIONS:="--no-cache --pull=true --build-arg PIP_TRUSTED_HOST=${PIP_TRUSTED_HOST} --build-arg PIP_INDEX_URL=${PIP_INDEX_URL} --build-arg DEVPI_VERSION=${DEVPI_VERSION}"}
  16. : ${DOCKER_BUILD_OPTIONS:="--pull=true --build-arg DEVPI_VERSION=${DEVPI_VERSION}"}
  17. image="${REPO}/devpi"
  18. echo "################################################################### ${image}"
  19. ## warm up cache for CI
  20. docker pull ${image} || true
  21. for tag in "${image}:latest" "${image}:latest-${DATE}" "${image}:${DEVPI_VERSION}"; do
  22. echo "############################################################# ${tag}"
  23. set -x
  24. docker build ${DOCKER_BUILD_OPTIONS} -t ${tag} .
  25. docker inspect ${tag}
  26. docker push ${tag}
  27. set +x
  28. done