set_release_env.sh 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. usage() {
  19. echo "usage: . set_release_env.sh <SUPERSET_RC_VERSION> <PGP_KEY_FULLBANE>"
  20. echo "example: . set_relese_env.sh 0.35.2rc1 myid@apache.org"
  21. }
  22. if [ -z "$1" ] || [ -z "$2" ]; then
  23. usage;
  24. else
  25. if [[ ${1} =~ ^([0-9]+)\.([0-9]+)\.([0-9]+)rc([0-9]+)$ ]]; then
  26. VERSION_MAJOR="${BASH_REMATCH[1]}"
  27. VERSION_MINOR="${BASH_REMATCH[2]}"
  28. VERSION_PATCH="${BASH_REMATCH[3]}"
  29. VERSION_RC="${BASH_REMATCH[4]}"
  30. else
  31. echo "unable to parse version string ${1}. Example of valid version string: 0.35.2rc1"
  32. exit 1
  33. fi
  34. export SUPERSET_VERSION="${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}"
  35. export SUPERSET_RC="${VERSION_RC}"
  36. export SUPERSET_GITHUB_BRANCH="${VERSION_MAJOR}.${VERSION_MINOR}"
  37. export SUPERSET_PGP_FULLNAME="${2}"
  38. export SUPERSET_VERSION_RC="${SUPERSET_VERSION}rc${VERSION_RC}"
  39. export SUPERSET_RELEASE=apache-superset-incubating-"${SUPERSET_VERSION}"
  40. export SUPERSET_RELEASE_RC=apache-superset-incubating-"${SUPERSET_VERSION_RC}"
  41. export SUPERSET_RELEASE_TARBALL="${SUPERSET_RELEASE}"-source.tar.gz
  42. export SUPERSET_RELEASE_RC_TARBALL="${SUPERSET_RELEASE_RC}"-source.tar.gz
  43. export SUPERSET_TMP_ASF_SITE_PATH="/tmp/incubator-superset-site-${SUPERSET_VERSION}"
  44. echo -------------------------------
  45. echo Set Release env variables
  46. env | grep ^SUPERSET_
  47. echo -------------------------------
  48. fi