forked from CircleCI-Public/cimg-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpythonFeed.sh
executable file
·46 lines (38 loc) · 1.26 KB
/
pythonFeed.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
#!/usr/bin/env bash
# Update to latest pyenv version
curl -sSL "https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer" | bash
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
LATEST_VERSION=0
VERSION_LIST=$(pyenv install --list | sed 's/^ //' | grep '^[3]' | grep --invert-match 'dev\|a\|b')
getPythonVersionLatest() {
LATEST_VERSION=$(echo "$VERSION_LIST" | tail -1)
}
processLastVersion() {
PROCESSED_LATEST_VERSION=$(echo "$LATEST_VERSION" | cut -f1,2 -d'.')
VERSION_LIST=$(echo "$VERSION_LIST" | grep -v "$PROCESSED_LATEST_VERSION")
generateVersions "$LATEST_VERSION"
generateSearchTerms "PYTHON_VERSION" "$majorMinor"/Dockerfile '\'
# shellcheck disable=SC2154
directoryCheck "$majorMinor" "$SEARCH_TERM"
if [[ $(eval echo $?) == 0 ]]; then
echo "$LATEST_VERSION is valid"
VERSIONS+=$LATEST_VERSION
VERSIONS+=' '
fi
}
while [ "${PROCESSED_LATEST_VERSION}" != "3.7" ]
do
getPythonVersionLatest
processLastVersion
done
if [ "$VERSIONS" != "" ]; then
echo "generating cimg-python for versions: $VERSIONS"
./shared/release.sh $VERSIONS
else
echo "No changes"
fi