make_docs.sh 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #!/bin/bash
  2. #
  3. # Licensed to the Apache Software Foundation (ASF) under one or more
  4. # contributor license agreements. See the NOTICE file distributed with
  5. # this work for additional information regarding copyright ownership.
  6. # The ASF licenses this file to You under the Apache License, Version 2.0
  7. # (the "License"); you may not use this file except in compliance with
  8. # the License. You may obtain a copy of the License at
  9. #
  10. # http://www.apache.org/licenses/LICENSE-2.0
  11. #
  12. # Unless required by applicable law or agreed to in writing, software
  13. # distributed under the License is distributed on an "AS IS" BASIS,
  14. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. # See the License for the specific language governing permissions and
  16. # limitations under the License.
  17. #
  18. set -e
  19. DOCKER_TMP_ASF_SITE_PATH=/asf-site
  20. DOC_SITE_PORT=5002
  21. # Clean tmp dir
  22. if [[ -d "${SUPERSET_TMP_ASF_SITE_PATH}" ]]; then
  23. rm -rf "${SUPERSET_TMP_ASF_SITE_PATH}"
  24. fi
  25. mkdir -p "${SUPERSET_TMP_ASF_SITE_PATH}"
  26. # Building docker that will help update superset asf-site
  27. docker build --no-cache -t apache-docs \
  28. --build-arg VERSION="${SUPERSET_VERSION}" \
  29. -f Dockerfile.make_docs .
  30. # Running docker to update superset asf-site
  31. docker run \
  32. -v "${SUPERSET_TMP_ASF_SITE_PATH}":"${DOCKER_TMP_ASF_SITE_PATH}":rw \
  33. -e HOST_UID=${UID} \
  34. -p ${DOC_SITE_PORT}:8000 \
  35. -d \
  36. -ti apache-docs
  37. RESULT=$?
  38. if [ $RESULT -ne 0 ]; then
  39. echo Updating and launching documentation site failed
  40. echo tip: Check if other container is using port:$DOC_SITE_PORT
  41. exit 1
  42. fi
  43. echo "---------------------------------------------------"
  44. echo Superset documentation site is ready at http://localhost:5002
  45. echo Check it out and if all looks good:
  46. echo $ cd "${SUPERSET_TMP_ASF_SITE_PATH}"
  47. echo $ git add .
  48. echo $ git commit -a -m \"New doc version "${SUPERSET_VERSION}"\"
  49. echo $ git push origin asf-site