Skip to content

Commit a8bd625

Browse files
committed
Merge branch '2.1.x' into 2.2.x
Closes gh-20981
2 parents 4c05924 + fd14c4e commit a8bd625

File tree

5 files changed

+21
-78
lines changed

5 files changed

+21
-78
lines changed

ci/pipeline.yml

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,6 @@ resources:
2727
username: ((github-username))
2828
password: ((github-password))
2929
branch: ((branch))
30-
- name: git-repo-ci-docker
31-
type: git
32-
icon: github-circle
33-
source:
34-
uri: ((github-repo))
35-
username: ((github-username))
36-
password: ((github-password))
37-
branch: ci-docker-((branch))
3830
- name: git-repo-windows
3931
type: git
4032
source:
@@ -224,31 +216,18 @@ jobs:
224216
- name: detect-docker-updates
225217
plan:
226218
- get: git-repo
227-
- get: git-repo-ci-docker
228219
- get: every-wednesday
229220
trigger: true
230221
- get: spring-boot-ci-image
231222
- do:
232223
- task: detect-docker-updates
233224
file: git-repo/ci/tasks/detect-docker-updates.yml
234225
params:
235-
GITHUB_REPO: spring-boot
236-
GITHUB_ORGANIZATION: spring-projects
237-
MILESTONE: ((milestone))
238-
image: spring-boot-ci-image
239-
- put: git-repo-ci-docker
240-
params:
241-
repository: git-repo-updated
242-
force: true
243-
- task: create-pull-request
244-
file: git-repo/ci/tasks/create-pull-request.yml
245-
params:
246-
BASE_BRANCH: ((branch))
247-
BRANCH: ci-docker-((branch))
248226
GITHUB_REPO: spring-boot
249227
GITHUB_ORGANIZATION: spring-projects
250228
GITHUB_PASSWORD: ((github-password))
251229
GITHUB_USERNAME: ((github-username))
230+
MILESTONE: ((milestone))
252231
image: spring-boot-ci-image
253232
- name: build
254233
serial: true

ci/scripts/create-pull-request.sh

Lines changed: 0 additions & 16 deletions
This file was deleted.

ci/scripts/detect-docker-updates.sh

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,16 @@
11
#!/bin/bash
22

33
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-
milestone_number=$( curl -s https://api.github.com/repos/${GITHUB_ORGANIZATION}/${GITHUB_REPO}/milestones\?state\=open | jq -c --arg MILESTONE "$MILESTONE" '.[] | select(.title==$MILESTONE)' | jq -r '.number')
7-
8-
existing_upgrade_issues=$( curl -s https://api.github.com/repos/${GITHUB_ORGANIZATION}/${GITHUB_REPO}/issues\?labels\=type:%20task\&state\=open\&creator\=spring-buildmaster\&milestone\=${milestone_number} | jq -c --arg TITLE_PREFIX "$title_prefix" '.[] | select(.pull_request != null) | select(.title | startswith($TITLE_PREFIX))' )
9-
10-
if [[ ${existing_upgrade_issues} = "" ]]; then
11-
git clone git-repo git-repo-updated > /dev/null
12-
else
13-
git clone git-repo-ci-docker git-repo-updated > /dev/null
14-
echo "Pull request already exists."
15-
exit 0
16-
fi
174

185
if [[ $latest_version =~ (beta|rc) ]]; then
196
echo "Skip pre-release versions"
207
exit 0;
218
fi
229

10+
title_prefix="Upgrade CI to Docker"
11+
milestone_number=$( curl -s https://api.github.com/repos/${GITHUB_ORGANIZATION}/${GITHUB_REPO}/milestones\?state\=open | jq -c --arg MILESTONE "$MILESTONE" '.[] | select(.title==$MILESTONE)' | jq -r '.number')
12+
existing_upgrade_issues=$( curl -s https://api.github.com/repos/${GITHUB_ORGANIZATION}/${GITHUB_REPO}/issues\?labels\=type:%20task\&state\=open\&creator\=spring-buildmaster\&milestone\=${milestone_number} | jq -c --arg TITLE_PREFIX "$title_prefix" '.[] | select(.title | startswith($TITLE_PREFIX))' )
13+
2314
latest="https://download.docker.com/linux/static/stable/x86_64/docker-$latest_version.tgz"
2415
current=$( git-repo/ci/images/get-docker-url.sh )
2516

@@ -28,12 +19,17 @@ if [[ $current = $latest ]]; then
2819
exit 0;
2920
fi
3021

31-
pushd git-repo-updated > /dev/null
32-
git config user.name "Spring Buildmaster" > /dev/null
33-
git config user.email "[email protected]" > /dev/null
34-
sed -i "s/version=.*/version=\"$latest_version\"/" ci/images/get-docker-url.sh
35-
git add ci/images/get-docker-url.sh > /dev/null
36-
commit_message="$title_prefix $latest_version"
37-
git commit -m "$commit_message" > /dev/null
38-
popd
39-
echo ${commit_message} > commit-details/message
22+
ISSUE_TITLE="$title_prefix $latest_version"
23+
24+
if [[ ${existing_upgrade_issues} = "" ]]; then
25+
curl \
26+
-s \
27+
-u ${GITHUB_USERNAME}:${GITHUB_PASSWORD} \
28+
-H "Content-type:application/json" \
29+
-d "{\"title\":\"${ISSUE_TITLE}\",\"milestone\":\"${milestone_number}\",\"body\": \"${latest}\",\"labels\":[\"status: waiting-for-triage\",\"type: task\"]}" \
30+
-f \
31+
-X \
32+
POST "https://api.github.com/repos/${GITHUB_ORGANIZATION}/${GITHUB_REPO}/issues" > /dev/null || { echo "Failed to create issue" >&2; exit 1; }
33+
else
34+
echo "Issue already exists."
35+
fi

ci/tasks/create-pull-request.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

ci/tasks/detect-docker-updates.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@
22
platform: linux
33
inputs:
44
- name: git-repo
5-
- name: git-repo-ci-docker
6-
outputs:
7-
- name: git-repo-updated
8-
- name: commit-details
95
params:
106
GITHUB_REPO:
117
GITHUB_ORGANIZATION:
8+
GITHUB_PASSWORD:
9+
GITHUB_USERNAME:
1210
MILESTONE:
1311
run:
1412
path: git-repo/ci/scripts/detect-docker-updates.sh

0 commit comments

Comments
 (0)