Skip to content

Commit

Permalink
feat: list all versions from spark releases page
Browse files Browse the repository at this point in the history
Note: the versions here are different from the downloads and archive
pages, so this will have to change
  • Loading branch information
benberryallwood committed Jan 3, 2025
1 parent 4c779f9 commit bc89cea
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions lib/utils.bash
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,13 @@ sort_versions() {
LC_ALL=C sort -t. -k 1,1 -k 2,2n -k 3,3n -k 4,4n -k 5,5n | awk '{print $2}'
}

list_github_tags() {
git ls-remote --tags --refs "$GH_REPO" |
grep -o 'refs/tags/.*' | cut -d/ -f3- |
sed 's/^v//' # NOTE: You might want to adapt this sed to remove non-version strings from tags
}

list_all_versions() {
# TODO: Adapt this. By default we simply list the tag names from GitHub releases.
# Change this function if spark has other means of determining installable versions.
list_github_tags
curl -s https://spark.apache.org/releases/ |
grep -oE "spark-release(-\d+){3}.html" |
grep -oE "spark-release-[0-9]*-[0-9]*-[0-9]*.html" |
uniq |
sed 's/spark-release-\(.*\).html/\1/g' |
sed 's/-/./g'
}

download_release() {
Expand Down

0 comments on commit bc89cea

Please sign in to comment.