-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathclojureFeed.sh
executable file
·65 lines (54 loc) · 2.06 KB
/
clojureFeed.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/usr/bin/env bash
source manifest
vers=()
if [ -f shared/automated-updates.sh ]; then
source shared/automated-updates.sh
else
echo "Check if submodule was loaded; automated-updates.sh is missing"
exit 1
fi
buildParameter () {
local newVersionString=$1
export builtParam="#$(echo "$newVersionString" | awk -F. '{print $NF}')"
}
getLeinVersion() {
local templateFile=$1
RSS_URL="https://github.com/technomancy/leiningen/tags.atom"
VERSIONS=$(curl --silent "$RSS_URL" | grep -E '(title)' | tail -n +2 | sed -e 's/^[ \t]*//' | sed -e 's/<title>//' -e 's/<\/title>//')
for version in $VERSIONS; do
if [[ $version =~ [0-9]+(\.[0-9]+)*$ ]]; then
generateVersions "$version"
generateSearchTerms "LEIN_VERSION=" "$templateFile" ""
replaceVersions "LEIN_VERSION=" "$SEARCH_TERM" "true"
fi
done
}
getClojureVersion() {
echo "Getting Lein version..."
getLeinVersion "Dockerfile.template"
RSS_URL="https://github.com/clojure/clojure/tags.atom"
VERSIONS=$(curl --silent "$RSS_URL" | grep -E '(title)' | tail -n +2 | sed -e 's/^[ \t]*//' | sed -e 's/<title>//' -e 's/<\/title>//')
for version in $VERSIONS; do
if [[ $version =~ ^clojure-[0-9]+(\.[0-9]+)*$ ]]; then
version_copy="$(cut -d '-' -f2 <<< "$version")"
generateVersions "$(cut -d '-' -f2 <<< "$version")"
generateSearchTerms "CLOJURE_VERSION=" "$majorMinor/${parentTags[-1]}/Dockerfile" "\\"
releaseVersion=$(curl -sSL https://api.github.com/repos/clojure/brew-install/releases |
jq -r --arg version "$version_copy" 'map(select(.target_commitish == $version)) | sort_by(.created_at) | last | .tag_name')
buildParameter "$releaseVersion"
directoryCheck "$majorMinor" "$SEARCH_TERM" "$builtParam"
if [[ $(eval echo $?) == 0 ]]; then
generateVersionString "$newVersion" "$builtParam"
fi
fi
done
}
getClojureVersion
if [ -n "${vers[*]}" ]; then
echo "Included version updates: ${vers[*]}"
echo "Running release script"
./shared/release.sh "${vers[@]}"
else
echo "No new version updates"
exit 0
fi