-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtryout.sh
executable file
·38 lines (32 loc) · 915 Bytes
/
tryout.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
#!/bin/sh
run_script() {
if [ ! -d "versions" ];
then
mkdir "versions"
fi
for x in 6 7 8 9 10
do
VERSION=`curl -X GET "https://quay.io/api/v1/repository/openshift-release-dev/ocp-release/tag/?onlyActiveTags=true" | jq '.tags | sort_by(.start_ts) | .[].name' | grep 4.$x | grep "ppc64le" | tail -1 | tr -d '"'`
if [ "$(cat versions/4.$x.txt)" != "$VERSION" ] && [ "$VERSION" != "" ];
then
echo $VERSION > versions/4.$x.txt
fi
done
}
setup_git() {
git checkout -b master
git config --global user.email "${GH_EMAIL}"
git config --global user.name "${GH_NAME}"
}
commit_files() {
git add . versions
git commit --message "Update OCP versions"
}
upload_files() {
git remote add origin-page https://${GH_TOKEN}@github.com/varadahirwadkar/ELTPGitDemo > /dev/null 2>&1
git push --quiet --set-upstream origin-page master
}
run_script
setup_git
commit_files
upload_files