Skip to content

Commit 5901b3f

Browse files
committed
Merge pull request #20793 from dreis2211
* pr/20793: Harmonize issue title for auto-created Docker upgrade issues Closes gh-20793
2 parents 1ea8c7b + 0ee6108 commit 5901b3f

File tree

6 files changed

+6
-10
lines changed

6 files changed

+6
-10
lines changed

ci/parameters.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
docker-upgrade-issue-title: "Upgrade Docker version in CI"
21
email-server: "smtp.svc.pivotal.io"
32
email-from: "[email protected]"
43
email-to: ["[email protected]"]

ci/pipeline.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,6 @@ jobs:
199199
params:
200200
GITHUB_REPO: spring-boot
201201
GITHUB_ORGANIZATION: spring-projects
202-
ISSUE_TITLE: ((docker-upgrade-issue-title))
203202
image: spring-boot-ci-image
204203
- put: git-repo-ci-docker
205204
params:
@@ -214,7 +213,6 @@ jobs:
214213
GITHUB_ORGANIZATION: spring-projects
215214
GITHUB_PASSWORD: ((github-password))
216215
GITHUB_USERNAME: ((github-username))
217-
ISSUE_TITLE: ((docker-upgrade-issue-title))
218216
image: spring-boot-ci-image
219217
- name: build
220218
serial: true

ci/scripts/create-pull-request.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
set -e
33

44
if [[ -f commit-details/message ]]; then
5+
ISSUE_TITLE="$(cat commit-details/message)"
56
curl \
67
-s \
78
-u ${GITHUB_USERNAME}:${GITHUB_PASSWORD} \

ci/scripts/detect-docker-updates.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#!/bin/bash
22

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)' )
3+
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+
title_prefix="Upgrade CI to Docker"
5+
6+
existing_upgrade_issues=$( curl -s https://api.github.com/repos/spring-projects/spring-boot/issues\?labels\=type:%20task\&state\=open\&creator\=spring-buildmaster | jq -c --arg TITLE_PREFIX "$title_prefix" '.[] | select(.pull_request != null) | select(.title | startswith($TITLE_PREFIX))' )
57

68
if [[ ${existing_upgrade_issues} = "" ]]; then
79
git clone git-repo git-repo-updated > /dev/null
@@ -11,8 +13,6 @@ else
1113
exit 0
1214
fi
1315

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' )
15-
1616
if [[ $latest_version =~ (beta|rc) ]]; then
1717
echo "Skip pre-release versions"
1818
exit 0;
@@ -31,7 +31,7 @@ git config user.name "Spring Buildmaster" > /dev/null
3131
git config user.email "[email protected]" > /dev/null
3232
sed -i "s/version=.*/version=\"$latest_version\"/" ci/images/get-docker-url.sh
3333
git add ci/images/get-docker-url.sh > /dev/null
34-
commit_message="Upgrade to Docker $latest_version in CI"
34+
commit_message="$title_prefix $latest_version"
3535
git commit -m "$commit_message" > /dev/null
3636
popd
3737
echo ${commit_message} > commit-details/message

ci/tasks/create-pull-request.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,5 @@ params:
1010
GITHUB_ORGANIZATION:
1111
GITHUB_PASSWORD:
1212
GITHUB_USERNAME:
13-
ISSUE_TITLE:
1413
run:
1514
path: git-repo/ci/scripts/create-pull-request.sh

ci/tasks/detect-docker-updates.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,5 @@ outputs:
99
params:
1010
GITHUB_REPO:
1111
GITHUB_ORGANIZATION:
12-
ISSUE_TITLE:
1312
run:
1413
path: git-repo/ci/scripts/detect-docker-updates.sh

0 commit comments

Comments
 (0)