Skip to content

Commit 8c6dc8b

Browse files
committed
Merge branch '2.1.x' into 2.2.x
Closes gh-20358
2 parents 8469b62 + d0019cd commit 8c6dc8b

File tree

3 files changed

+55
-1
lines changed

3 files changed

+55
-1
lines changed

ci/pipeline.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,21 @@ jobs:
194194
GITHUB_USERNAME: ((github-username))
195195
JDK_VERSION: java13
196196
image: spring-boot-ci-image
197+
- name: detect-ubuntu-image-updates
198+
plan:
199+
- get: git-repo
200+
- get: every-wednesday
201+
trigger: true
202+
- get: spring-boot-ci-image
203+
- do:
204+
- task: detect-ubuntu-image-updates
205+
file: git-repo/ci/tasks/detect-ubuntu-image-updates.yml
206+
params:
207+
GITHUB_REPO: spring-boot
208+
GITHUB_ORGANIZATION: spring-projects
209+
GITHUB_PASSWORD: ((github-password))
210+
GITHUB_USERNAME: ((github-username))
211+
image: spring-boot-ci-image
197212
- name: build
198213
serial: true
199214
public: true
@@ -604,6 +619,6 @@ groups:
604619
- name: "Release"
605620
jobs: ["stage-milestone", "stage-rc", "stage-release", "promote-milestone", "promote-rc", "promote-release", "sync-to-maven-central"]
606621
- name: "CI Images"
607-
jobs: ["build-spring-boot-ci-images", "detect-jdk-updates"]
622+
jobs: ["build-spring-boot-ci-images", "detect-jdk-updates", "detect-ubuntu-image-updates"]
608623
- name: "Build Pull Requests"
609624
jobs: ["build-pull-requests"]
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
3+
ISSUE_TITLE="Upgrade Ubuntu version in CI images"
4+
5+
ubuntu="bionic"
6+
latest=$( curl -s "https://partner-images.canonical.com/core/$ubuntu/current/unpacked/build-info.txt" | awk '{split($0, parts, "="); print parts[2]}' )
7+
current=$( grep "ubuntu:$ubuntu" git-repo/ci/images/spring-boot-ci-image/Dockerfile | awk '{split($0, parts, "-"); print parts[2]}' )
8+
9+
if [[ $current = $latest ]]; then
10+
echo "Already up-to-date"
11+
exit 0;
12+
fi
13+
14+
existing_tasks=$( curl -s https://api.github.com/repos/${GITHUB_ORGANIZATION}/${GITHUB_REPO}/issues\?labels\=type:%20task\&state\=open\&creator\=spring-buildmaster )
15+
existing_upgrade_issues=$( echo "$existing_tasks" | jq -c --arg TITLE "$ISSUE_TITLE" '.[] | select(.title==$TITLE)' )
16+
17+
if [[ ${existing_upgrade_issues} = "" ]]; then
18+
curl \
19+
-s \
20+
-u ${GITHUB_USERNAME}:${GITHUB_PASSWORD} \
21+
-H "Content-type:application/json" \
22+
-d "{\"title\":\"${ISSUE_TITLE}\",\"body\": \"Upgrade to ubuntu:${ubuntu}-${latest}\",\"labels\":[\"status: waiting-for-triage\",\"type: task\"]}" \
23+
-f \
24+
-X \
25+
POST "https://api.github.com/repos/${GITHUB_ORGANIZATION}/${GITHUB_REPO}/issues" > /dev/null || { echo "Failed to create issue" >&2; exit 1; }
26+
else
27+
echo "Issue already exists."
28+
fi
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
platform: linux
3+
inputs:
4+
- name: git-repo
5+
params:
6+
GITHUB_REPO:
7+
GITHUB_ORGANIZATION:
8+
GITHUB_PASSWORD:
9+
GITHUB_USERNAME:
10+
run:
11+
path: git-repo/ci/scripts/detect-ubuntu-image-updates.sh

0 commit comments

Comments
 (0)