updateProductionContainer.sh 628 B

1234567891011121314151617181920212223242526272829303132333435
  1. #!/usr/bin/env bash
  2. IMAGE_NAME="logicp/ky_gui:production"
  3. CWD=$(cd $(dirname $0) && pwd)
  4. function rebuild_docker_image() {
  5. if [[ ! -f Dockerfile ]]; then
  6. echo "No Dockerfile found in $CWD"
  7. exit 1
  8. fi
  9. docker build --build-arg REBUILD_KY_GUI=$(date +%s) -t $IMAGE_NAME .
  10. if [[ $? -eq 0 ]]; then
  11. docker push $IMAGE_NAME
  12. if [[ $? -eq 0 ]]; then
  13. echo "Image updated on docker hub!"
  14. return 0
  15. fi
  16. echo "Image updated but not pushed to docker hub"
  17. return 1
  18. fi
  19. echo "Image could not be updated"
  20. return 1
  21. }
  22. rebuild_docker_image
  23. if [[ $? -eq 0 ]]; then
  24. exit 0
  25. else
  26. exit 1
  27. fi