1
1
#! /bin/bash
2
2
3
+ existing_tasks=$( curl -s https://api.github.com/repos/${GITHUB_ORGANIZATION} /${GITHUB_REPO} /pulls\? labels\= type:%20task\& state\= open\& creator\= spring-buildmaster )
4
+ existing_upgrade_issues=$( echo " $existing_tasks " | jq -c --arg TITLE " $ISSUE_TITLE " ' .[] | select(.title==$TITLE)' )
5
+
6
+ if [[ ${existing_upgrade_issues} = " " ]]; then
7
+ git clone git-repo git-repo-updated > /dev/null
8
+ else
9
+ git clone git-repo-ci-docker git-repo-updated > /dev/null
10
+ echo " Pull request already exists."
11
+ exit 0
12
+ fi
13
+
3
14
latest_version=$( curl -I -s https://github.com/docker/docker-ce/releases/latest | grep " location:" | awk ' {n=split($0, parts, "/"); print substr(parts[n],2);}' | awk ' {$1=$1;print}' | tr -d ' \r' | tr -d ' \n' )
4
15
5
16
if [[ $latest_version =~ (beta| rc) ]]; then
@@ -15,21 +26,12 @@ if [[ $current = $latest ]]; then
15
26
exit 0;
16
27
fi
17
28
18
- existing_tasks=$( curl -s https://api.github.com/repos/${GITHUB_ORGANIZATION} /${GITHUB_REPO} /pulls\? labels\= type:%20task\& state\= open\& creator\= spring-buildmaster )
19
- existing_upgrade_issues=$( echo " $existing_tasks " | jq -c --arg TITLE " $ISSUE_TITLE " ' .[] | select(.title==$TITLE)' )
20
-
21
- git clone git-repo git-repo-updated > /dev/null
22
-
23
- if [[ ${existing_upgrade_issues} = " " ]]; then
24
- pushd git-repo-updated > /dev/null
25
- git config user.name " Spring Buildmaster" > /dev/null
26
- git config user.email
" [email protected] " > /dev/null
27
- sed -i " s/version=.*/version=\" $latest_version \" /" ci/images/get-docker-url.sh
28
- git add ci/images/get-docker-url.sh > /dev/null
29
- commit_message=" Upgrade to Docker $latest_version in CI"
30
- git commit -m " $commit_message " > /dev/null
31
- popd
32
- echo ${commit_message} > commit-details/message
33
- else
34
- echo " Pull request already exists."
35
- fi
29
+ pushd git-repo-updated > /dev/null
30
+ git config user.name " Spring Buildmaster" > /dev/null
31
+ git config user.email
" [email protected] " > /dev/null
32
+ sed -i " s/version=.*/version=\" $latest_version \" /" ci/images/get-docker-url.sh
33
+ git add ci/images/get-docker-url.sh > /dev/null
34
+ commit_message=" Upgrade to Docker $latest_version in CI"
35
+ git commit -m " $commit_message " > /dev/null
36
+ popd
37
+ echo ${commit_message} > commit-details/message
0 commit comments